2 different players in the fps demo
by Gadi · in Torque Game Engine · 04/06/2006 (4:03 pm) · 8 replies
Im trying to put 2 different players in the fps demo and I can't do it
Does anybody can tell me how to do it and send me this with aliitle gui ?
Does anybody can tell me how to do it and send me this with aliitle gui ?
About the author
#2
in the fps starter kit you get just the ork player i want to put
more different players with weapons that what I need
I tried to call to different object but I get an error
04/06/2006 (5:02 pm)
I mean player data datablock type with 2 or more playersin the fps starter kit you get just the ork player i want to put
more different players with weapons that what I need
I tried to call to different object but I get an error
#3
For human players:
In server/scripts/game.cs, under GameConnection::createPlayer(%this, %spawnPoint), there is:
// Create the player object
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
You would change PlayerBody to the PlayerData datablock you want to put in.
For AI players:
In server/scripts/aiPlayer.cs
datablock PlayerData(DemoPlayer : PlayerBody)
{
shootingDelay = 2000;
};
You would do the same here for AI players as you would for human players; change the PlayerBody to what you want to include.
Hope this helps.
04/07/2006 (1:51 pm)
I myself am still learning a good deal of TGE, so I don't know how much I can help you here.For human players:
In server/scripts/game.cs, under GameConnection::createPlayer(%this, %spawnPoint), there is:
// Create the player object
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
You would change PlayerBody to the PlayerData datablock you want to put in.
For AI players:
In server/scripts/aiPlayer.cs
datablock PlayerData(DemoPlayer : PlayerBody)
{
shootingDelay = 2000;
};
You would do the same here for AI players as you would for human players; change the PlayerBody to what you want to include.
Hope this helps.
#4
04/08/2006 (7:50 am)
Thanks alot danny
#5
datablock PlayerData(DemoPlayer : PlayerBody)
{
shootingDelay = 2000;
};
04/10/2006 (5:33 am)
I'm trying to add two AiPlayers too. But when i change PlayerBody to my own Datablock in the part of code above, my TGE got an fatal error and exits. datablock PlayerData(DemoPlayer : PlayerBody)
{
shootingDelay = 2000;
};
#6
I'd like to put my own AiPlayer, not using the same datablock of PlayerBody.
Anyone could help me with this?
04/10/2006 (5:53 am)
Antoher question.I'd like to put my own AiPlayer, not using the same datablock of PlayerBody.
Anyone could help me with this?
#7
datablock PlayerData(OrcMaleHumanArmor : lightmalehumanarmor)
{
classname = "Armor";
shapeFile = "~/data/shapes/spaceOrc/player.dts";
debrisShapeName = "~/data/shapes/spaceOrc/debris_player.dts";
};
I'm applying it to my NPC in the mission file as follows
new AIPlayer(Bob) {
position = "1121.2 451.103 259.86";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "OrcMaleHumanArmor";
};
04/11/2006 (3:32 am)
Don't know if this will help but this is how I do it, inheriting from the standard datablock and then changing a few params so that I can use different models for different AI characters.datablock PlayerData(OrcMaleHumanArmor : lightmalehumanarmor)
{
classname = "Armor";
shapeFile = "~/data/shapes/spaceOrc/player.dts";
debrisShapeName = "~/data/shapes/spaceOrc/debris_player.dts";
};
I'm applying it to my NPC in the mission file as follows
new AIPlayer(Bob) {
position = "1121.2 451.103 259.86";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "OrcMaleHumanArmor";
};
#8
I made this, but my character is loaded together with the Orc weapon. Why this happens?
What's the difference between this code:
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
And this:
new AIPlayer(Bob) {
position = "1121.2 451.103 259.86";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "OrcMaleHumanArmor";
};
Thanks in Advance,
Gustavo
04/11/2006 (4:54 am)
Thanks Dave.I made this, but my character is loaded together with the Orc weapon. Why this happens?
What's the difference between this code:
%player = new Player() {
dataBlock = PlayerBody;
client = %this;
};
And this:
new AIPlayer(Bob) {
position = "1121.2 451.103 259.86";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "OrcMaleHumanArmor";
};
Thanks in Advance,
Gustavo
Torque Owner D B
For 2 human players, you can look at this resource:
www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10170
For 2 AI Players, there's a thread here that may help:
www.garagegames.com/mg/forums/result.thread.php?qt=42210