Which object do I inherit from (Oh the wicked web we weave)
by Terence Tan · in Torque Game Engine · 06/07/2006 (6:36 pm) · 2 replies
For the last few days I have been trying to:
a) Create a new object type (AISpawnPoint)
b) Allow it to be dropped in as a mission object
c) Have editable fields such as numSpawn, shapeFile etc.
The basic idea here is to create a object which displays the shape of the monster which will be spawned. Allow you to click on the object to change things like the number of monster that will spawn, health, what guns it carries etc.
So I did that, looking at fxShapeReplicator and other tutorials/resources.
What I tried first was have a TSStatic member and inherit from SceneObject. When the user changed the shapeFile, it would update the TSStatic object (i.e. remove it and re-create it). BUT..when I go into the world (because I am using registerObject/unregisterObject) there are 2 objects one on top of the other. Of course picking the object get confusing cause there's 2 of them.
OK..fine back track..inherit the object of the TSStatic..maybe I can play around with the onAdd/onRemove functions so that it doesn't create a shape instance until the a shapefile name is set. Nope...doesn't work because you need the Parent::onAdd in TSStatic to be called to register as a SimObject.
Duh..
Other than cloning the code in TSStatic and backing up to a SceneObject inherit, I am not sure what else to try?
I'm probably missing some Gee Whiz...thing..I should have thought of that?
Terence
--------------------------
"Codezzz..da Codezz...show me da Codezz...Books are stupid"
Where's my sig?
a) Create a new object type (AISpawnPoint)
b) Allow it to be dropped in as a mission object
c) Have editable fields such as numSpawn, shapeFile etc.
The basic idea here is to create a object which displays the shape of the monster which will be spawned. Allow you to click on the object to change things like the number of monster that will spawn, health, what guns it carries etc.
So I did that, looking at fxShapeReplicator and other tutorials/resources.
What I tried first was have a TSStatic member and inherit from SceneObject. When the user changed the shapeFile, it would update the TSStatic object (i.e. remove it and re-create it). BUT..when I go into the world (because I am using registerObject/unregisterObject) there are 2 objects one on top of the other. Of course picking the object get confusing cause there's 2 of them.
OK..fine back track..inherit the object of the TSStatic..maybe I can play around with the onAdd/onRemove functions so that it doesn't create a shape instance until the a shapefile name is set. Nope...doesn't work because you need the Parent::onAdd in TSStatic to be called to register as a SimObject.
Duh..
Other than cloning the code in TSStatic and backing up to a SceneObject inherit, I am not sure what else to try?
I'm probably missing some Gee Whiz...thing..I should have thought of that?
Terence
--------------------------
"Codezzz..da Codezz...show me da Codezz...Books are stupid"
Where's my sig?
About the author
#2
Uhhh...forgot to mention i checked out AIGuard already. Got it running..but doesn't do what I want it too...(i.e. for example you have script data changes)...I want a non programmer to add AI and not touch scripts ( not me..go away you flaky game designer with your 15th request).
06/07/2006 (7:29 pm)
Mike,Uhhh...forgot to mention i checked out AIGuard already. Got it running..but doesn't do what I want it too...(i.e. for example you have script data changes)...I want a non programmer to add AI and not touch scripts ( not me..go away you flaky game designer with your 15th request).
Torque Owner Mike Rowley
Mike Rowley
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=6773
It works great. This is the standing guard mod, and there is a link on the page for a roving guard as well.