Jump to content

Mod Tool/Scripting: Difference between revisions

m
improved example of obj/camera movement tracking
(+ OnValueChange event)
m (improved example of obj/camera movement tracking)
Line 204: Line 204:
   
   
  if instr(cstr(in_ctxt.GetAttribute("Object")), ".kine.global") > 0 then
  if instr(cstr(in_ctxt.GetAttribute("Object")), ".kine.global") > 0 then
  if firstValue = false then
  if firstValue = false then
 
  ' add more exit conditions here
  ' e.g. selection mode
  ' selection count
  ' if obj is not an Oni obj or camera
   
   
    logmessage "Object at: " & selection(0).posx.value & " " & selection(0).posy.value & " " & selection(0).posz.value
' add more exit conditions here
    if replace(cstr(in_ctxt.GetAttribute("Object")),".kine.global", "") = "Camera" then
' e.g. selection mode
    logmessage "Obj is cam"
' selection count
    end if
' if obj is not an Oni obj or camera
    firstValue = true
    if selection.count > 0 and not replace(cstr(in_ctxt.GetAttribute("Object")),".kine.global", "") = "Camera_Interest" then
        logmessage "Object at: " & selection(0).posx.value & " " & selection(0).posy.value & " " & selection(0).posz.value
    end if
    if replace(cstr(in_ctxt.GetAttribute("Object")),".kine.global", "") = "Camera_Interest" then
        logmessage GetValue("Camera_Interest.kine.global.posx") & " " & _
          GetValue("Camera_Interest.kine.global.posy") & " " & _
          GetValue("Camera_Interest.kine.global.posz")
  logmessage "Obj is cam"
    end if
    firstValue = true
   else
   else
firstValue = false
    firstValue = false
   end if
   end if
  end if
  end if
8,316

edits