Different enemy models?
by Snowhill06 · in Torque Game Engine Advanced · 06/13/2007 (2:24 pm) · 9 replies
Could someone post an example file or code on how to make it so that you can have different enemy models instead of it being the same as the default player model? I know how to do ai but not so that the ai characters are a different model than the player. Basically I want to know how to make it so you are not fighting against yourself! An example file or code would make the process easy and I could use it as a template to add different enemys to my game.
#2
06/13/2007 (4:56 pm)
My problem is not actually making the player model.I bought the adam and soldier packs which already have the there player.cs setup. I can replace the default space orc model but the ai models are all still the same. I am not sure what .cs file I need to add to the aiPlayer.cs,player.cs or what? Is there a example mission file I can download somewhere that has a different enemy model than that of the player? Also I have searched and searched this site and still havnt found either an example or an easy tutorial on how to do this!
#3
This " datablock PlayerData(DemoPlayer : LightMaleHumanArmor) " is inherit from the player datablock in the player.cs. Add the below line to the datablock PlayerData(DemoPlayer : LightMaleHumanArmor) after line 29. Make sure you change the path to your model.
This should give you different aiPlayer model in game.
Dont forget to exec the player.cs in the data/shapes model folder at the top of server/scripts/player.cs. Change to fit yours.
06/13/2007 (5:41 pm)
If you are using the demo folder goto demo/server/scripts. Open aiPlayer.cs and scroll down to line 27.This " datablock PlayerData(DemoPlayer : LightMaleHumanArmor) " is inherit from the player datablock in the player.cs. Add the below line to the datablock PlayerData(DemoPlayer : LightMaleHumanArmor) after line 29. Make sure you change the path to your model.
shapeFile = "~/data/shapes/Orc/player.dts";
This should give you different aiPlayer model in game.
Dont forget to exec the player.cs in the data/shapes model folder at the top of server/scripts/player.cs. Change to fit yours.
exec("~/data/shapes/Orc/player.cs");
#4
new AIPlayer(Bob) { datablock = "PlayerBody"; position = LocalClientConnection.camera.getPosition(); };
like it is in the TGE is it a different command in the TGEA?If so what is the new command?
06/14/2007 (10:49 am)
Thanks but for some reasone I cant get any bots to spawn. I thought the code for spawining ai bots was new AIPlayer(Bob) { datablock = "PlayerBody"; position = LocalClientConnection.camera.getPosition(); };
like it is in the TGE is it a different command in the TGEA?If so what is the new command?
#5
06/14/2007 (1:24 pm)
Hmm well I think what he ment was he wanted them randomized between the 3 models that he has.
#6
06/14/2007 (3:11 pm)
Come on doesnt anyone know if the code for spawning bots in TGEA is different than TGE? If it is could someone please please tell me?!!
#7
06/14/2007 (3:15 pm)
Have you looked at alienforce's port of the starter.fps? if there is a change he would have had to use it there. I would think anyway. Not really a programmer so I'm just guessing.
#8
Check your log for errors. Things like a datablock named "PlayerBody" might not be valid or defined.
06/14/2007 (3:55 pm)
The code for spawning bots hasn't significantly changed in TGEA. However, there are situational factors that come in.Check your log for errors. Things like a datablock named "PlayerBody" might not be valid or defined.
#9
06/14/2007 (5:12 pm)
I got working now! Thanks everyone for your help I really appreciate it!
Torque 3D Owner Mark Dynna
* Create a new model using a program like Maya, 3DS Max, or MilkShape and export it as a DTS.
* Create a new PlayerData datablock for the new DTS
* Spawn your new aiPlayer baddies using the newly defined datablock.
If you need more details on these individual points I suggest you pound the search engine and do some digging. There is plenty of information on the first 2 especially.