Jump to content

Self Moving Objects UFO? Sorted


Recommended Posts

hello :D

i have seen a working UFO on KWKSND server and was wondering how u make objects move

i had a quick look at setElementVelocity in the wiki and im pretty sure thats what i need but am unsure as to how to do the settings

i was thinking that maybe i should set velocity along some coordinates and then set timers to change direction so it moves in a circle but i dont know if thats the right way to go

any advice would be appreciated but im not looking for a working script just an idea of how to begin as i have been trying to learn this lua scripting for a few months now and i think im starting to get the idea

i want to use objectID : 17512 ( big round building ) as the UFO / floating platform

THANX FOR ANY REPLYS :D

EDIT : sorry everyone i have just found move object command in the wiki will post if i get anywhere

EDIT : 2

have just tried this

function battleplatform ( player, commandname ) 
         local battleplatform = createObject ( 17512, posX="-704.44897460938" posY="942.72790527344" posZ="78.641380310059" rotX="0" rotY="0" rotZ="0"/> 
         outputChatBox ( "Batlle Platform Has Been Launched" ) 
         moveObject ( battleplatform, 10000, posX="-694" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )  
         moveObject ( battleplatform, 10000, posX="-684" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )  
         moveObject ( battleplatform, 10000, posX="-694" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )  
         moveObject ( battleplatform, 10000, posX="-704" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )           
         outputChatBox ( "Battle Platform Is On The Move" )  
end 

but it doesnt seem to do anything / no message to chatbox / no errors in server

any ideas where im goin wrong?

EDIT : 3 tried simplifying it and doing create and move commands separately but still no message to chatbox and no error in server :roll:

Edited by Guest
Link to comment

hello :D

i have seen a working UFO on KWKSND server and was wondering how u make objects move

i had a quick look at setElementVelocity in the wiki and im pretty sure thats what i need but am unsure as to how to do the settings

i was thinking that maybe i should set velocity along some coordinates and then set timers to change direction so it moves in a circle but i dont know if thats the right way to go

any advice would be appreciated but im not looking for a working script just an idea of how to begin as i have been trying to learn this lua scripting for a few months now and i think im starting to get the idea

i want to use objectID : 17512 ( big round building ) as the UFO / floating platform

THANX FOR ANY REPLYS :D

EDIT : sorry everyone i have just found move object command in the wiki will post if i get anywhere

EDIT : 2

have just tried this

function battleplatform ( player, commandname )         local battleplatform = createObject ( 17512, posX="-704.44897460938" posY="942.72790527344" posZ="78.641380310059" rotX="0" rotY="0" rotZ="0"/>         outputChatBox ( "Batlle Platform Has Been Launched" )         moveObject ( battleplatform, 10000, posX="-694" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )          moveObject ( battleplatform, 10000, posX="-684" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )          moveObject ( battleplatform, 10000, posX="-694" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )          moveObject ( battleplatform, 10000, posX="-704" posY="942" posZ="78" rotX="0" rotY="0" rotZ="0" )                   outputChatBox ( "Battle Platform Is On The Move" ) end

but it doesnt seem to do anything / no message to chatbox / no errors in server

any ideas where im goin wrong?

EDIT : 3 tried simplifying it and doing create and move commands separately but still no message to chatbox and no error in server :roll:

Edited by Guest
Link to comment

hi

try to delet /> on line 3.

and why do you don´t just use this:

createObject ( 17512, -704.44897460938, 942.72790527344, 78.641380310059, 0, 0, 0 ) 

I deleted the /> and the posX= etc. stuff, it think thats wrong! (delete the same on moveObjekt)

Link to comment

hi

try to delet /> on line 3.

and why do you don´t just use this:

createObject ( 17512, -704.44897460938, 942.72790527344, 78.641380310059, 0, 0, 0 )

I deleted the /> and the posX= etc. stuff, it think thats wrong! (delete the same on moveObjekt)

Link to comment

i noticed the /> just after i posted the script :oops:

i did try to use the createObject command before but i had the syntax wrong

i keep putting posX and stuff in getting confused with the .MAP file

thanx for the help as im getting somewhere now and the object is being created

just got to get it movin now

ONCE AGAIN THANX LOADS :D

GOT IT GOIN THANX AGAIN

function createplatform( player, commandname) 
         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local moved = X + 10 
         moveObject ( battleplatform, 1000, moved, Y, Z ) 
end 

dont know why i got so confused just went back to the wiki and clicked all of a sudden

and special thanxto u XetaQuake i would have been there all day trying to figure out that posX and stuff wasnt needed

sorry to be a pain but could anyone give me an idea as to how to move the object in other directions

i want it to fly around in a big square ( 1000 east, 1000 north, 1000 west, 1000 south )

i have tried to add to the function but i dont know if i need another function for each movement or if its possible to put all movements into the same function

this is what im trying but it ignores the first moveObject command and moves me north but not west

function createplatform( player, commandname) 
         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local movedwest = X + 1000 
         local movedeast = X - 1000 
         local movednorth= Y + 1000 
         local movedsouth= Y - 1000 
         local X1,Y1,Z1 = getElementPosition ( battleplatform )          
         moveObject ( battleplatform, 100000, movedwest, Y, Z )  
         moveObject ( battleplatform, 100000, X1, movednorth, Z1 ) 
end 

Edited by Guest
Link to comment

i noticed the /> just after i posted the script :oops:

i did try to use the createObject command before but i had the syntax wrong

i keep putting posX and stuff in getting confused with the .MAP file

thanx for the help as im getting somewhere now and the object is being created

just got to get it movin now

ONCE AGAIN THANX LOADS :D

GOT IT GOIN THANX AGAIN

function createplatform( player, commandname)         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local moved = X + 10         moveObject ( battleplatform, 1000, moved, Y, Z )end

dont know why i got so confused just went back to the wiki and clicked all of a sudden

and special thanxto u XetaQuake i would have been there all day trying to figure out that posX and stuff wasnt needed

sorry to be a pain but could anyone give me an idea as to how to move the object in other directions

i want it to fly around in a big square ( 1000 east, 1000 north, 1000 west, 1000 south )

i have tried to add to the function but i dont know if i need another function for each movement or if its possible to put all movements into the same function

this is what im trying but it ignores the first moveObject command and moves me north but not west

function createplatform( player, commandname)         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local movedwest = X + 1000         local movedeast = X - 1000         local movednorth= Y + 1000         local movedsouth= Y - 1000         local X1,Y1,Z1 = getElementPosition ( battleplatform )                  moveObject ( battleplatform, 100000, movedwest, Y, Z )          moveObject ( battleplatform, 100000, X1, movednorth, Z1 )end

Edited by Guest
Link to comment

         local movedwest = X + 1000 
         local movedeast = X - 1000 

Swap the signs. West = X - 1000, East = X + 1000.

The 2nd moveObject will not have effect as you call the moveObject on the same object and your time arg = 1000, which is 1sec, but the next moveObject is called just after it. Use setTimer() to call moveObject function with a delay.

Link to comment

         local movedwest = X + 1000         local movedeast = X - 1000

Swap the signs. West = X - 1000, East = X + 1000.

The 2nd moveObject will not have effect as you call the moveObject on the same object and your time arg = 1000, which is 1sec, but the next moveObject is called just after it. Use setTimer() to call moveObject function with a delay.

Link to comment

have now tried it with a timer but i get a bad argument error on the timer

im pretty sure its right going by the wiki

function createplatform( player, commandname ) 
         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local east = X + 100 
         moveObject ( battleplatform, 10000, east, Y, Z ) 
end 
  
setTimer ( platformnorth, 1000, 1 ) 
  
function platformnorth () 
         local X1,Y1,Z1 = getElementPosition ( battleplatform ) 
         local north = Y1 + 100 
         moveObject ( battleplatform, 10000, X1, north, Z1 ) 
end 
  

this seems to be almost there :D

function createplatform( player, commandname ) 
         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local east = X + 100 
         moveObject ( battleplatform, 10000, east, Y, Z ) 
         setTimer ( ( platformnorth ), 1000, 1 ) 
end 
  
  
  
function platformnorth () 
         local X1,Y1,Z1 = getElementPosition ( battleplatform ) 
         local north = Y1 + 100 
         moveObject ( battleplatform, 10000, X1, north, Z1 ) 
end 

but gives me an bad argument error on getElementPosition in the PLATFORMNORTH function

and attempt to perform arithmetic on nil value Y1

Got It GOIN :D

function createplatform( player, commandname) 
         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local movedwest = X + 1000 
         local movedeast = X - 1000 
         local movednorth= Y + 1000 
         local movedsouth= Y - 1000 
         local X1,Y1,Z1 = getElementPosition ( battleplatform )         
         moveObject ( battleplatform, 100000, movedwest, Y, Z ) 
         setTimer ( moveObject, 11000, 1, battleplatform , 100000, X1, movednorth, Z1 )  
end 

Link to comment

have now tried it with a timer but i get a bad argument error on the timer

im pretty sure its right going by the wiki

function createplatform( player, commandname )         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local east = X + 100         moveObject ( battleplatform, 10000, east, Y, Z )end setTimer ( platformnorth, 1000, 1 ) function platformnorth ()         local X1,Y1,Z1 = getElementPosition ( battleplatform )         local north = Y1 + 100         moveObject ( battleplatform, 10000, X1, north, Z1 )end 

this seems to be almost there :D

function createplatform( player, commandname )         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local east = X + 100         moveObject ( battleplatform, 10000, east, Y, Z )         setTimer ( ( platformnorth ), 1000, 1 )end   function platformnorth ()         local X1,Y1,Z1 = getElementPosition ( battleplatform )         local north = Y1 + 100         moveObject ( battleplatform, 10000, X1, north, Z1 )end

but gives me an bad argument error on getElementPosition in the PLATFORMNORTH function

and attempt to perform arithmetic on nil value Y1

Got It GOIN :D

function createplatform( player, commandname)         local battleplatform = createObject ( 17512, -704, 942, 78, 0, 0, 0 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local movedwest = X + 1000         local movedeast = X - 1000         local movednorth= Y + 1000         local movedsouth= Y - 1000         local X1,Y1,Z1 = getElementPosition ( battleplatform )                 moveObject ( battleplatform, 100000, movedwest, Y, Z )         setTimer ( moveObject, 11000, 1, battleplatform , 100000, X1, movednorth, Z1 ) end

Link to comment

sorry to double post but im trying something a little different

function createplatform ( player, commandname ) 
         local battleplatform = createObject ( 3885, -734, 956, 11 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local movedup = 737, 955, 46 
         local movedtoairport = -1410, -5, 41 
         local moveddown = -1410, -5, 12 
         moveObject ( battleplatform, 5000, movedup ) 
         setTimer ( moveObject, 7000, 1, ( battleplatform, 35000, movedtoairport ) )  
         setTimer ( moveObject, 44000, 1, ( battleplatform, 5000, moveddown ) ) 
end 

i keep getting this error

INFO: Loading script failed: C:/Mta Server/mods/deathmatch/resourcecache/hafr/ctvdebug.lua:650: ')' expected near ','

ive been looking at it for a while now and i cant see where im going wrong

i think ive got the syntax right going by the wiki but obviously not :?

i have also tried it like this

        setTimer ( moveObject, 7000, 1, battleplatform, 35000, movedtoairport )  
         setTimer ( moveObject, 44000, 1, battleplatform, 5000, moveddown ) 

but i get an error telling me it expects ) near battleplatform :roll:

Any advice / help appreciated THANX

Link to comment

sorry to double post but im trying something a little different

function createplatform ( player, commandname )         local battleplatform = createObject ( 3885, -734, 956, 11 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local movedup = 737, 955, 46         local movedtoairport = -1410, -5, 41         local moveddown = -1410, -5, 12         moveObject ( battleplatform, 5000, movedup )         setTimer ( moveObject, 7000, 1, ( battleplatform, 35000, movedtoairport ) )          setTimer ( moveObject, 44000, 1, ( battleplatform, 5000, moveddown ) )end

i keep getting this error

INFO: Loading script failed: C:/Mta Server/mods/deathmatch/resourcecache/hafr/ctvdebug.lua:650: ')' expected near ','

ive been looking at it for a while now and i cant see where im going wrong

i think ive got the syntax right going by the wiki but obviously not :?

i have also tried it like this

        setTimer ( moveObject, 7000, 1, battleplatform, 35000, movedtoairport )          setTimer ( moveObject, 44000, 1, battleplatform, 5000, moveddown )

but i get an error telling me it expects ) near battleplatform :roll:

Any advice / help appreciated THANX

Link to comment

You can not assign 3 values to a variable

local movedup = 737, 955, 46 
local movedtoairport = -1410, -5, 41 
local moveddown = -1410, -5, 12 
  

This is wrong because these variable have only the first value after '=' sign, but moveObject requires 3 coords (x,y,z). You have to use 3 different variables or a table.

  
local movedup, movedtoairport, moveddown = { 737, 955, 46 }, { -1410, -5, 41 }, { -1410, -5, 12 } 
setTimer( moveObject, 7000, 1, battleplatform, 35000, movedtoairport[ 1 ], movedtoairport[ 2 ], movedtoairport[ 3 ] ) 
  

Link to comment

You can not assign 3 values to a variable

local movedup = 737, 955, 46local movedtoairport = -1410, -5, 41local moveddown = -1410, -5, 12 

This is wrong because these variable have only the first value after '=' sign, but moveObject requires 3 coords (x,y,z). You have to use 3 different variables or a table.

 local movedup, movedtoairport, moveddown = { 737, 955, 46 }, { -1410, -5, 41 }, { -1410, -5, 12 }setTimer( moveObject, 7000, 1, battleplatform, 35000, movedtoairport[ 1 ], movedtoairport[ 2 ], movedtoairport[ 3 ] ) 

Link to comment

Thanx 50p i shall see what i can do :D

i tried it as u have shown above but the platform goes straight off in one direction

it should raise from the ground go to the airport and then land

im getting confused somewhere but im not sure where

EDIT : have decided to use multiple variables as i seem to understand those :)

i am hoping to make a platform that floats around the map taking players to points of interest and possibly using multiple platforms for an ariel combat sort of deathmatch

i also found an object : ID of 2780 that makes fog

i was considering trying to attach some to the underside of the platform to disguise it as a cloud ( sort of inspired by old tv show MONKEY ) but im not sure what sort of load that would put on the computers anyone know if all the timers and stuff i would have to run for the platforms would be to much ro is it a case of just give it a go and see what happens

Thanx for l :roll: kin

EDIT : 2

just had another thought

would it be possible to put the player inside an object

i want to try and put people inside the submarine ( cant remember ID at the moment ) and then use moveObject to take them on an undersea tour

by the way i have stuck 4 fog machines on the platform and it doesnt seem to be any problem and im up to 5 setTimer's and that seems ok as well :D

Link to comment

Thanx 50p i shall see what i can do :D

i tried it as u have shown above but the platform goes straight off in one direction

it should raise from the ground go to the airport and then land

im getting confused somewhere but im not sure where

EDIT : have decided to use multiple variables as i seem to understand those :)

i am hoping to make a platform that floats around the map taking players to points of interest and possibly using multiple platforms for an ariel combat sort of deathmatch

i also found an object : ID of 2780 that makes fog

i was considering trying to attach some to the underside of the platform to disguise it as a cloud ( sort of inspired by old tv show MONKEY ) but im not sure what sort of load that would put on the computers anyone know if all the timers and stuff i would have to run for the platforms would be to much ro is it a case of just give it a go and see what happens

Thanx for l :roll: kin

EDIT : 2

just had another thought

would it be possible to put the player inside an object

i want to try and put people inside the submarine ( cant remember ID at the moment ) and then use moveObject to take them on an undersea tour

by the way i have stuck 4 fog machines on the platform and it doesnt seem to be any problem and im up to 5 setTimer's and that seems ok as well :D

Link to comment

these are a few of the ideas ive been messing with very rough at the moment but they work

i include them with the broph resource that comes with MTA SERVER

here U go

all server side scripts

root = getRootElement () 
players = getElementsByType ( "player" ) 
  
function tourplatform( player, commandname ) 
         setElementPosition ( player, -734, 956, 14 ) 
         local tourplatform = createObject ( 3885, -734, 956, 12 ) 
         outputChatBox ( "Tour Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( tourplatform ) 
         local xup = -624 
         local yup = 953 
         local zup = 39 
         local xnewair = -565 
         local ynewair = 956 
         local znewair = 17 
         local xontour = 88 
         local yontour = 1339 
         local zontour = 71 
         local x69spot = 332 
         local y69spot = 1968 
         local z69spot = 55 
         local x69go = 332 
         local y69go = 1989 
         local z69g0 = 55 
         local xabair = 350 
         local yabair = 2490 
         local zabair = 27 
         setTimer ( moveObject, 2000, 1, tourplatform, 10000, xup, yup, zup ) 
         setTimer ( moveObject, 12500, 1, tourplatform, 35000, xnewair, ynewair, znewair ) 
         setTimer ( moveObject, 60000, 1, tourplatform, 35000, xontour, yontour, zontour ) 
         setTimer ( moveObject, 95500, 1, tourplatform, 35000, x69spot, y69spot, z69spot ) 
         setTimer ( moveObject, 131000, 1, tourplatform, 10000, x69go, y69go, z69go ) 
         setTimer ( moveObject, 141500, 1, tourplatform, 35000, xabair, yabair, zabair ) 
end 
  
addCommandHandler ( "tourplatform", tourplatform ) 

No. 2

root = getRootElement () 
players = getElementsByType ( "player" ) 
  
function createplatform( player, commandname) 
         setElementPosition ( player, -734, 956, 14 ) 
         local battleplatform = createObject ( 3885, -734, 956, 12 ) 
         local fog1 = createObject ( 2780, -734, 956, 12 ) 
         local fog2 = createObject ( 2780, -735, 956, 12 ) 
         local fog3 = createObject ( 2780, -736, 956, 12 ) 
         local fog4 = createObject ( 2780, -737, 956, 12 ) 
         attachElementToElement ( fog1, battleplatform, 0, 6, -1 ) 
         attachElementToElement ( fog2, battleplatform, 0, -6, -1 ) 
         attachElementToElement ( fog3, battleplatform, 6, 0, -1 ) 
         attachElementToElement ( fog4, battleplatform, -6, 0, -1 ) 
         outputChatBox ( "Batlle Platform Is Ready" ) 
         local X,Y,Z = getElementPosition ( battleplatform ) 
         local xup = -737 
         local yup = 955 
         local zup = 46 
         local xebair = -1410 
         local yebair = -5 
         local zebair = 41 
         local xebairland = -1410 
         local yebairland = -5 
         local zebairland = 12 
         setTimer ( outputChatBox, 8000, 1, player, "Battle Platform Is On The Move" ) 
         setTimer ( moveObject, 10000, 1, battleplatform, 5000, xup, yup, zup ) 
         setTimer ( moveObject, 22000, 1, battleplatform, 60000, xebair, yebair, zebair )  
         setTimer ( moveObject, 98000, 1, battleplatform, 5000, xebairland, yebairland, zebairland ) 
end 
  
addCommandHandler ( "createplatform", createplatform ) 

No. 3

root = getRootElement () 
players = getElementsByType ( "player" ) 
  
function toursetup ( player, commandname ) 
         setElementPosition ( player, -720, 961, 13 ) 
         local tourtest = createObject ( 3885, -720, 961, 11 ) 
         outputChatBox ( "tourtest ready" ) 
         local x,y,z = getElementPosition ( battleplatform ) 
         local xlaunch = -720 
         local ylaunch = 961 
         local zlaunch = 49 
         local xfirstmove = 104 
         local yfirstmove = 1465 
         local zfirstmove = 81 
         local xsecondmove = 335 
         local ysecondmove = 1985 
         local zsecondmove = 17 
         local xthirdmove = 333 
         local ythirdmove = 1985 
         local zthirdmove = 82 
         local xfourthmove = 356 
         local yfourthmove = 2495 
         local zfourthmove =15 
         local xfifthmove = 355 
         local yfifthmove = 2495 
         local zfifthmove = 87 
         local xsixthmove = 1446 
         local ysixthmove = 1371 
         local zsixthmove = 84 
         local xseventhmove = 1444 
         local yseventhmove = 1375 
         local zseventhmove = 10 
         local xeighthmove = -1357 
         local yeighthmove = 33 
         local zeighthmove = 105 
         local xninthmove = -1421 
         local yninthmove = -41 
         local zninthmove = 13 
         local xtenthmove = -1273 
         local ytenthmove = 502 
         local ztenthmove = 58 
         local xeleventhmove = -1307 
         local yeleventh move = 493 
         local zeleventhmove = 17 
         moveObject ( tourtest, 5000, xlaunch, ylaunch, zlaunch ) 
         setTimer ( moveObject, 5500, 1, tourtest, 35000, xfirstmove, yfirstmove, zfirstmove ) 
         setTimer ( moveObject, 41000, 1, tourtest, 35000, xsecondmove, ysecondmove, zsecondmove ) 
         setTimer ( moveObject, 76500, 1, tourtest, 5000, xthirdmove, ythirdmove, zthirdmove ) 
         setTimer ( moveObject, 82000, 1, tourtest, 35000, xfourthmove, yfourthmove, zfourthmove ) 
         setTimer ( moveObject, 117500, 1, tourtest, 5000, xfifthmove, yfifthmove, zfifthmove ) 
         setTimer ( moveObject, 123000, 1, tourtest, 35000, xsixthmove, ysixthmove, zsixthmove ) 
         setTimer ( moveObject, 158500, 1, tourtest, 5000, xseventhmove, yseventhmove, zseventhmove ) 
         setTimer ( moveObject, 164000, 1, tourtest, 45000, xeighthmove, yeighthmove, zeighthmove ) 
         setTimer ( moveObject, 209500, 1, tourtest, 25000, xninthmove, yninthmove, zninthmove ) 
         setTimer ( moveObject, 235000, 1, tourtest, 25000, xtenthmove, ytenthmove, ztenthmove ) 
         setTimer ( moveObject, 261000, 1, tourtest, 25000, xeleventhmove, yeleventhmove, zeleventhmove ) 
end 
  
addCommandHandler ( "tourtest", toursetup ) 

all ive done is add up the timers for moveObject to move in different directions

very long winded way of doing it but i dont really understand the maths system yet

biggest problem i have with the platforms is that U cant see them properly from underneath. i was thinking of adding interiors to them or maybe trying to find an object that is visible and attaching it to underside

currently working on making big ship ( object ID 17512 i think its a stadium ) that flys to where u want then spawns loads of little ships ( object ID 3885 ) that drop down and attack ( hoping to use minigun and sam site scripts attached to them ) either a certian area for an assault sort of thing or something for players to fire from with the minigun

will post when working :D

Link to comment

these are a few of the ideas ive been messing with very rough at the moment but they work

i include them with the broph resource that comes with MTA SERVER

here U go

all server side scripts

root = getRootElement ()players = getElementsByType ( "player" ) function tourplatform( player, commandname )         setElementPosition ( player, -734, 956, 14 )         local tourplatform = createObject ( 3885, -734, 956, 12 )         outputChatBox ( "Tour Platform Is Ready" )         local X,Y,Z = getElementPosition ( tourplatform )         local xup = -624         local yup = 953         local zup = 39         local xnewair = -565         local ynewair = 956         local znewair = 17         local xontour = 88         local yontour = 1339         local zontour = 71         local x69spot = 332         local y69spot = 1968         local z69spot = 55         local x69go = 332         local y69go = 1989         local z69g0 = 55         local xabair = 350         local yabair = 2490         local zabair = 27         setTimer ( moveObject, 2000, 1, tourplatform, 10000, xup, yup, zup )         setTimer ( moveObject, 12500, 1, tourplatform, 35000, xnewair, ynewair, znewair )         setTimer ( moveObject, 60000, 1, tourplatform, 35000, xontour, yontour, zontour )         setTimer ( moveObject, 95500, 1, tourplatform, 35000, x69spot, y69spot, z69spot )         setTimer ( moveObject, 131000, 1, tourplatform, 10000, x69go, y69go, z69go )         setTimer ( moveObject, 141500, 1, tourplatform, 35000, xabair, yabair, zabair )end addCommandHandler ( "tourplatform", tourplatform )

No. 2

root = getRootElement ()players = getElementsByType ( "player" ) function createplatform( player, commandname)         setElementPosition ( player, -734, 956, 14 )         local battleplatform = createObject ( 3885, -734, 956, 12 )         local fog1 = createObject ( 2780, -734, 956, 12 )         local fog2 = createObject ( 2780, -735, 956, 12 )         local fog3 = createObject ( 2780, -736, 956, 12 )         local fog4 = createObject ( 2780, -737, 956, 12 )         attachElementToElement ( fog1, battleplatform, 0, 6, -1 )         attachElementToElement ( fog2, battleplatform, 0, -6, -1 )         attachElementToElement ( fog3, battleplatform, 6, 0, -1 )         attachElementToElement ( fog4, battleplatform, -6, 0, -1 )         outputChatBox ( "Batlle Platform Is Ready" )         local X,Y,Z = getElementPosition ( battleplatform )         local xup = -737         local yup = 955         local zup = 46         local xebair = -1410         local yebair = -5         local zebair = 41         local xebairland = -1410         local yebairland = -5         local zebairland = 12         setTimer ( outputChatBox, 8000, 1, player, "Battle Platform Is On The Move" )         setTimer ( moveObject, 10000, 1, battleplatform, 5000, xup, yup, zup )         setTimer ( moveObject, 22000, 1, battleplatform, 60000, xebair, yebair, zebair )          setTimer ( moveObject, 98000, 1, battleplatform, 5000, xebairland, yebairland, zebairland )end addCommandHandler ( "createplatform", createplatform )

No. 3

root = getRootElement ()players = getElementsByType ( "player" ) function toursetup ( player, commandname )         setElementPosition ( player, -720, 961, 13 )         local tourtest = createObject ( 3885, -720, 961, 11 )         outputChatBox ( "tourtest ready" )         local x,y,z = getElementPosition ( battleplatform )         local xlaunch = -720         local ylaunch = 961         local zlaunch = 49         local xfirstmove = 104         local yfirstmove = 1465         local zfirstmove = 81         local xsecondmove = 335         local ysecondmove = 1985         local zsecondmove = 17         local xthirdmove = 333         local ythirdmove = 1985         local zthirdmove = 82         local xfourthmove = 356         local yfourthmove = 2495         local zfourthmove =15         local xfifthmove = 355         local yfifthmove = 2495         local zfifthmove = 87         local xsixthmove = 1446         local ysixthmove = 1371         local zsixthmove = 84         local xseventhmove = 1444         local yseventhmove = 1375         local zseventhmove = 10         local xeighthmove = -1357         local yeighthmove = 33         local zeighthmove = 105         local xninthmove = -1421         local yninthmove = -41         local zninthmove = 13         local xtenthmove = -1273         local ytenthmove = 502         local ztenthmove = 58         local xeleventhmove = -1307         local yeleventh move = 493         local zeleventhmove = 17         moveObject ( tourtest, 5000, xlaunch, ylaunch, zlaunch )         setTimer ( moveObject, 5500, 1, tourtest, 35000, xfirstmove, yfirstmove, zfirstmove )         setTimer ( moveObject, 41000, 1, tourtest, 35000, xsecondmove, ysecondmove, zsecondmove )         setTimer ( moveObject, 76500, 1, tourtest, 5000, xthirdmove, ythirdmove, zthirdmove )         setTimer ( moveObject, 82000, 1, tourtest, 35000, xfourthmove, yfourthmove, zfourthmove )         setTimer ( moveObject, 117500, 1, tourtest, 5000, xfifthmove, yfifthmove, zfifthmove )         setTimer ( moveObject, 123000, 1, tourtest, 35000, xsixthmove, ysixthmove, zsixthmove )         setTimer ( moveObject, 158500, 1, tourtest, 5000, xseventhmove, yseventhmove, zseventhmove )         setTimer ( moveObject, 164000, 1, tourtest, 45000, xeighthmove, yeighthmove, zeighthmove )         setTimer ( moveObject, 209500, 1, tourtest, 25000, xninthmove, yninthmove, zninthmove )         setTimer ( moveObject, 235000, 1, tourtest, 25000, xtenthmove, ytenthmove, ztenthmove )         setTimer ( moveObject, 261000, 1, tourtest, 25000, xeleventhmove, yeleventhmove, zeleventhmove )end addCommandHandler ( "tourtest", toursetup )

all ive done is add up the timers for moveObject to move in different directions

very long winded way of doing it but i dont really understand the maths system yet

biggest problem i have with the platforms is that U cant see them properly from underneath. i was thinking of adding interiors to them or maybe trying to find an object that is visible and attaching it to underside

currently working on making big ship ( object ID 17512 i think its a stadium ) that flys to where u want then spawns loads of little ships ( object ID 3885 ) that drop down and attack ( hoping to use minigun and sam site scripts attached to them ) either a certian area for an assault sort of thing or something for players to fire from with the minigun

will post when working :D

Link to comment

If you know the target location of the moving object then you can check if it has reached its destination. When it does you can start the next move object sequence (and so on). This is probably a better way of doing it because you do not have to write down every single move object call. Also consider loading the paths from a configuration file instead of hard coding it in your script.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...