Easy questions
by Christian · in Technical Issues · 12/24/2006 (10:39 am) · 4 replies
I'm trying to use the commands possible, http://tdn.garagegames.com/wiki/images/0/03/Playerdump.pdf has a lot of them. Whether for my player or an aiPlayer. I have been unsuccessful so far. If I add one of those to my code, what do I put to make it work correctly? For example would I do for applyDamage:
%player.applyDamage(30); or
aiPlayer.applyDamage(30); etc. I don't know the context of how to use them.
%player.applyDamage(30); or
aiPlayer.applyDamage(30); etc. I don't know the context of how to use them.
About the author
#2
setInvincibleMode() - (float time, float speed)
setMoveDestination() - (Point3F goal, bool slowDown=true)Tells the AI to move to the location
provided.
setDamageLevel() - (float level)
setDamageState() - (string state)
I'm trying to move the character where I want, heal them, etc. I haven't got those to work, I don't quite get what i'm suppose to put in for float time, float speed, Point3f goal, bool slowDown=true, float level, string state). That's not exactly my origonal question.....
12/25/2006 (12:43 pm)
Thanks for taking the time to respond. Last night I loaded a game about 100 times and finally got it working thanks to a couple peoples help. The TND website I posted at the top that has a list of commands, I haven't figured out most of them... for example setInvincibleMode() - (float time, float speed)
setMoveDestination() - (Point3F goal, bool slowDown=true)Tells the AI to move to the location
provided.
setDamageLevel() - (float level)
setDamageState() - (string state)
I'm trying to move the character where I want, heal them, etc. I haven't got those to work, I don't quite get what i'm suppose to put in for float time, float speed, Point3f goal, bool slowDown=true, float level, string state). That's not exactly my origonal question.....
#3
To be honest, I haven't touched TGE in well over a year now. I've been mucking about with TGB (much more fun, IMHO - I won't bore you with my opinionated reasoning).
Merry Christmas!
12/25/2006 (4:23 pm)
I don't know the details of the AIPlayer, but I'd assume the goal is a 3D point on the map where it should go. It'd be easy to find by placing a static object on the mission map, record where it is, and use those values.To be honest, I haven't touched TGE in well over a year now. I've been mucking about with TGB (much more fun, IMHO - I won't bore you with my opinionated reasoning).
Merry Christmas!
#4
impObj.applyDamage(50);
impObj.applyRepair(55);
impObj.Damage(55);
impObj.isCloaked(true);
impObj.isHidden(true);
impObj.setDamageLevel(30);
impObj.setDamageState(30);
impObj.setEnergyLevel(55);
impObj.setMoveDestination(356 308 217);
If anyone else knows how to use them properly that would be cool.
12/25/2006 (5:46 pm)
Yeah, i've tried all these:impObj.applyDamage(50);
impObj.applyRepair(55);
impObj.Damage(55);
impObj.isCloaked(true);
impObj.isHidden(true);
impObj.setDamageLevel(30);
impObj.setDamageState(30);
impObj.setEnergyLevel(55);
impObj.setMoveDestination(356 308 217);
If anyone else knows how to use them properly that would be cool.
Torque Owner Scott Coursey
Yellow Duck Software
Using "aiPlayer" in this context means you're referring to a specific name of an object, as defined in:
new SomeObject ( aiPlayer ) { class = SomeClass; };
Unless you're defining a single instance of "aiPlayer", then this may be problematic at best. Let's say you want to have three objects of "SomeObject" (not sure what object you're going to base it on). This is an error:
new SomeObject ( aiPlayer) ...
new SomeObject ( aiPlayer) ...
new SomeObject ( aiPlayer) ...
You will get a console error for this due to a conflict in the naming. The names passed in creation either need to be empty (let the engine define them), or unique.
If the "aiPlayer" is an actual object (as defined inside the C++ code itself), then you can call:
new aiPlayer (aiPlayer1)...
new aiPlayer (aiPlayer2)...
new aiPlayer (aiPlayer3)...
This will define the three objects, but you'll still need to refer to them properly.
Another way to create an object (which I make use of extensively) is to base everything off a ScriptObject(). Here's how I do my units:
%list = new SimSet(); for ( %x = 0; %x < 10; %x ++ ) { %ob = new ScriptObject () { class = myClass; }; %list.add ( %ob ); }Now you're left with "%list" (a local variable) containing all ten of your AIs (it'd be a better idea to define the list as a "$list" - a global variable). You can trace through the AIs as:
for ( %x = 0; %x < $list.getCount (); %x ++ ) { %ob = $list.getObject ( %x ); %ob.Think (); }Ugh. I think I'm starting to ramble. It's 4am and I need sleep.
Have I answered your question? Probably not. Tell me and I'll correct my post.
Good night.