"send ship1 x=¿¿, y=??, wait"
"send ship1 x=¿, y=?, wait"
"send ship1 x=!, y=¡, wait"
pause 300
"send ship1 x=¡, y=?, wait"
set random value "v_ship_movement_delay" 0 to 10000 -- will set random value between 0 & 10 seconds
pause for "v_ship_movement_delay" -- will pause for random value generated above
execute a script > (see code block below)
setRandCharPos()
local x, y -- empty variables
local w = 1920 -- replace with intended scene width
local h = 1080 -- replace with intended scene height
local char = Characters["ship1"] -- replace with intended character name
function setRandCharPos()
x = math.random(w); y = math.random(h) -- create random destination
char.CharacterDestination = {x = x, y = y} -- set new destination
registerEventHandler("mainLoop", "CPLoop")
end
function CPLoop()
if char.Position.x == x and char.Position.y == y then
startAction("Actions[dynamic_ship_movement]")
unregisterEventHandler("mainLoop", "CPLoop")
end
local active = false
local x, y -- empty variables
local w = 1920 -- replace with intended scene width
local h = 1080 -- replace with intended scene height
local char = getObject("Characters[ship1]") -- replace with intended character name
function setRandCharPos()
x = math.random(w); y = math.random(h) -- create random destination
char:setValue( VCharacterDestination, {x = x, y = y} ) -- set new destination
active = true
end
function CPLoop()
if char:getPoint(VCharacterPosition).x == x and char:getPoint(VCharacterPosition).y == y and active then
startAction("Actions[dynamic_ship_movement]")
active = false
end
registerEventHandler("mainLoop", "CPLoop")
local nave1 = getObject('Characters[Nimbus]')
nave1 :setValue(VCharacterDestination, { x=math.random(6000), y = math.random(3000)})
getObject('Characters[Nimbus]'):setValue( VCharacterDestination, { x = math.random(6000), y = math.random(3000) } )