Game Development Community

Console and objects

by arteria3d · in Torque Game Engine · 12/13/2004 (1:36 am) · 4 replies

Hi,

If i wish to make a simple object move on the screen (Yes its my pseduo swaying trees again!) rather than writing a script for each one - is there any way that a script could be wrriten, that allows for a specified object, i.e. my palm tree when inserted in the mission editor to then have the properties held in the script - hence it would move. So every time i inserted the palm tree in the mission editor - the script would automatically get attached to that object and move it??

Cheers

Steve

About the author

Owner of uk based Ltd company ArteriaMediaLtd. with a trading name of Arteria3d Website;arteria3d.com


#1
12/13/2004 (2:11 am)
I've wondered the same thing sort of. I would assume that there must be some way to loop through each object of a certain object type and during that loop assign the values. Sort of like a control array. But I havent got around to looking into it yet.

If there isn't there should be. I think there is a generic object class so who knows.

PS I am insanely hung over so please keep that in mind.
#2
12/14/2004 (10:54 pm)
There are script hooks in the editor that you can use to set up properties on objects... and there's an onAdd method that gets called when the object is created.
#3
12/15/2004 (4:20 am)
'script hook' - explain please. With regards to the onAdd, i now believe that all details within the onAdd function become part of the new object when placed - is this right?
#4
12/15/2004 (7:10 am)
There are fragments of script that the editor calls when it wants to create a new object; that might be a useful place to look. as for onAdd, it is called after the object is created, when it is being added to the scene.