I'm blind - adding a new model to aiplayer?
by Rodney (OldRod) Burns · in Torque Game Engine · 05/05/2005 (8:45 am) · 11 replies
I'm attempting to modify Kork to use the 'blue guy' model that Joe Maruschak (sp?) posted a while back. The problem is I don't see where to link this model to the aiplayer.
If I replace the standard player model with the blue guy, then both the player and Kork use it. I want just Kork to use it and then I'm going to use him as a base for adding NPCs, etc. Can someone point me to an example or a resource that shows how to change just Kork's model without changing the player model too?
Maybe it was lack of sleep last night or something, but I just can't seem to find where it is ;)
Thanks!
If I replace the standard player model with the blue guy, then both the player and Kork use it. I want just Kork to use it and then I'm going to use him as a base for adding NPCs, etc. Can someone point me to an example or a resource that shows how to change just Kork's model without changing the player model too?
Maybe it was lack of sleep last night or something, but I just can't seem to find where it is ;)
Thanks!
#3
So I copied all the files from the player directory over (so it's using the exact same .cfg, .dts, .dsq files as the player) and it still won't animate. The player model is the standard orc model and it animates fine when used as the player, so the files themselves are ok. It's just when I use those same files as an aiplayer.
Are aiplayer animations controlled somewhere else that needs changed as well?
05/08/2005 (8:01 am)
Ok, apparently there's more to this than meets the eye. I have the model in-game and showing up, but it doesn't animate.So I copied all the files from the player directory over (so it's using the exact same .cfg, .dts, .dsq files as the player) and it still won't animate. The player model is the standard orc model and it animates fine when used as the player, so the files themselves are ok. It's just when I use those same files as an aiplayer.
Are aiplayer animations controlled somewhere else that needs changed as well?
#4
Yeah, I've had that problem before, don't remember if I got it worked through tho but here's my guess. At the top of the aiplayer.cs there is an exec for the file with all of the info on the player animations etc... And in that file there is along with al of the ainmations a basefile, in this case, the starter.fps, the orc file, player.dts as it always is. So, my guess would to make another of the files located in the player directory with the base shape and all of the animations and change the baseshape to blueguy as you want it. Then, exec the new file somewhere, in the aiplayer.cs file I should think, and give it a try? Someone correct me please, I don't remember since I last did this.
Max
05/08/2005 (8:39 am)
Hey,Yeah, I've had that problem before, don't remember if I got it worked through tho but here's my guess. At the top of the aiplayer.cs there is an exec for the file with all of the info on the player animations etc... And in that file there is along with al of the ainmations a basefile, in this case, the starter.fps, the orc file, player.dts as it always is. So, my guess would to make another of the files located in the player directory with the base shape and all of the animations and change the baseshape to blueguy as you want it. Then, exec the new file somewhere, in the aiplayer.cs file I should think, and give it a try? Someone correct me please, I don't remember since I last did this.
Max
#5
05/08/2005 (8:59 am)
Yeah, that got it. Thanks for the quick reply. I just exec'd the player.cs file at the top of aiplayer.cs and it works now ;)
#6
Max
05/08/2005 (9:40 am)
Ok, great, one thing though, make sure that your players animations are playing, if I remember correctly I had a problem where the players animations weren't playing then because the other file was overwriting it...Max
#7
Thanks again!
05/08/2005 (10:43 am)
Yeah, it plays fine now. Kork now uses the BlueGuy model with the standard player animations and death scene :)Thanks again!
#8
My enemy name is Charest.
In server/scripts/payer.ca I added a new databloc : PlayerData(CharestBody) pointing to my .dts file (~/data/shapes/enemy/charest.dts)
In data/shape/player.cs I added a new databloc : TSShapeConstructor(CharestDts)
I receive the error:
"Trying to transform eye Node that does not exist in model!"
Do you have an idea?
Germ
05/20/2005 (2:54 pm)
Please could you tell me where I'm mistaken...My enemy name is Charest.
In server/scripts/payer.ca I added a new databloc : PlayerData(CharestBody) pointing to my .dts file (~/data/shapes/enemy/charest.dts)
In data/shape/player.cs I added a new databloc : TSShapeConstructor(CharestDts)
I receive the error:
"Trying to transform eye Node that does not exist in model!"
Do you have an idea?
Germ
#9
//AssertFatal(mDataBlock->eyeNode != -1, "Trying to transform eyeNode that does not exist in model!");
that's working now
05/20/2005 (3:07 pm)
I found the solution I comented this line in the engine ://AssertFatal(mDataBlock->eyeNode != -1, "Trying to transform eyeNode that does not exist in model!");
that's working now
#10
05/20/2005 (3:10 pm)
Could also have added an eye node to the model, that tends to work well, too ya know :)
#11
Also, Germain, I would reccomend uncommenting that line and just putting an "eye" node in your moddel, because if I'm correct the eye node may be needed for some AI scripts.... I mean like if you want your bots to shoot, they may do a raycast for the player from the eye node or whatnot, I'm not posative on this, I just think it would be a better idea.
:) -Max
05/20/2005 (4:20 pm)
Haha, yes, very true there dreamer(very nice job on all of those resources you've been submiting latley, very nice :) ). Also, Germain, I would reccomend uncommenting that line and just putting an "eye" node in your moddel, because if I'm correct the eye node may be needed for some AI scripts.... I mean like if you want your bots to shoot, they may do a raycast for the player from the eye node or whatnot, I'm not posative on this, I just think it would be a better idea.
:) -Max
Torque Owner Max Thomas
At the top of the aiPlayer.cs script, there is this line:
The "DemoPlayer" is what the AIplayer is using throughout the script, and the "PlayerBody" is the datablock for the player body in player.cs
So, what you have to do in player.cs is find the
Datablock and Copy is and rename the PlayerBody in it... Here's an example
In aiplayer.cs
and in player.cs with an extradatablock matching the
datablock
just changed into
And that would be all, granted under the new BluePlayerBody datablock in player.cs you would have to change the *.dts file to go to the blue guy.
Hope this all makes sence, Max