How to add a bot with a different model then the player ?
by Michael Schaumburg · in Technical Issues · 11/24/2002 (10:26 am) · 8 replies
I have succesfully integrated the terrainPreviewGui control where you can select the mission and the player model. I have two different models to start. Now, when I add a bot from the console during the game, I want to add the other model to be different from the player. Is that possible ?? I dumpt the properties and methods of the bot but I can't find a way to change the model. Any ideas ??
Michael
Michael
#2
My greatest question also is, if I start a LAN multiplayer game, the client gets always the same player like the server. How can we start a multiplayer game with different player types ?? Is it not possible with TGE ??? That might be stupid to have only one kind of player. Any suggestions ??
11/29/2002 (5:19 am)
I did what you say and make for each player different datablocks. Also the player cs files are different. Like that, it is possible to create a different bot. There occurs one problem. I noticed when I start a LAN multiplayer game, that I have two same player and on the sever a different bot, but now the one player on the client has no animation. That is only when I start another datablock then the player datablock. What's happen ?My greatest question also is, if I start a LAN multiplayer game, the client gets always the same player like the server. How can we start a multiplayer game with different player types ?? Is it not possible with TGE ??? That might be stupid to have only one kind of player. Any suggestions ??
#3
could you post your
look something like:
$playerFiles[0] = %mod @ "/server/scripts/player1.cs";
$playerFiles[1] = %mod @ "/server/scripts/player2.cs";
And are you sure you have this:
I haven't tested this in Multiplayer, though...
so there really may be a problem with it...
11/29/2002 (6:00 am)
Not really sure what you are talking about...could you post your
function TerrainPreviewGui::loadPlayerShapes(%mod)to see if the paths to your player files
look something like:
$playerFiles[0] = %mod @ "/server/scripts/player1.cs";
$playerFiles[1] = %mod @ "/server/scripts/player2.cs";
And are you sure you have this:
Quote:
In order to switch players/cars in a mod-specific way, I set a global variable in this new GUI file named
"$playerCSFile" and in the "game.cs" file of the actual mod I call:
//exec("./player.cs");
exec($playerCSFile);
I haven't tested this in Multiplayer, though...
so there really may be a problem with it...
#4
the terrainPreviewGUI works fine, no problem to start with different kind of players. But how do you start a LAN multiplayer game with different player on the server side then of the client ? Always when the client joins a multiplayer game he uses the same player then the server. Let us say I have two player types (maybe a man and a women), how will you start on the client to play with the women, when the server is playing with the man ??
Someone on the forum said:
It is an anti cheat system build in torque that makes sure that all clients are using the same model:
I can't believe it, this means in a multiplayer game all are using the same model !! Such a powerful engine with such a great restriction. What a stupid game it will be..........
Stefan there is also a little problem with your terrainPreviewGUI. If I stay with the tribes2 skin conventions, in the player preview all the models doesn't have a skin. They are white. In the engine the skin is ok. I mean if your skins are named like:
base.spears.png
red.spears.png and so on
The skin convention are necassary if you want to change the skin in your game.
11/29/2002 (6:17 am)
Hi Stefan,the terrainPreviewGUI works fine, no problem to start with different kind of players. But how do you start a LAN multiplayer game with different player on the server side then of the client ? Always when the client joins a multiplayer game he uses the same player then the server. Let us say I have two player types (maybe a man and a women), how will you start on the client to play with the women, when the server is playing with the man ??
Someone on the forum said:
It is an anti cheat system build in torque that makes sure that all clients are using the same model:
I can't believe it, this means in a multiplayer game all are using the same model !! Such a powerful engine with such a great restriction. What a stupid game it will be..........
Stefan there is also a little problem with your terrainPreviewGUI. If I stay with the tribes2 skin conventions, in the player preview all the models doesn't have a skin. They are white. In the engine the skin is ok. I mean if your skins are named like:
base.spears.png
red.spears.png and so on
The skin convention are necassary if you want to change the skin in your game.
#5
I guess the problem is the global var
$playerCSFile
I guess simply changing it to something client specific should help...
could you please try to change all occurences of
$playerCSFile
to
$pref::Player::CSFile
or something like that - that should be client specific then and hopefully solve the problem...
maybe I can find some time this weekend to try it myself...
Hm, yeah, to use a different skin naming convention, you'd have to change the .cc file (check GuiObjectView::setObjectModel())...
11/29/2002 (8:46 am)
Aah, now I think I got you....I guess the problem is the global var
$playerCSFile
I guess simply changing it to something client specific should help...
could you please try to change all occurences of
$playerCSFile
to
$pref::Player::CSFile
or something like that - that should be client specific then and hopefully solve the problem...
maybe I can find some time this weekend to try it myself...
Hm, yeah, to use a different skin naming convention, you'd have to change the .cc file (check GuiObjectView::setObjectModel())...
#6
11/29/2002 (9:31 am)
Stefan, I think that's not the way we have to search, because if a client joins a multiplayer game he didn't use your gui.He is using the join server gui. This means the variable isn't set. So all the informations which level and which model should load on the client, are coming from the server I think ! You don't have the possibility now, to select a player when you join a multiplayer game.
#7
Didn't think of that... well, then it should be "easy"... add the player selection to the "JoinServerGui"... :)
11/29/2002 (9:34 am)
Hehe, yeah, that's true... :pDidn't think of that... well, then it should be "easy"... add the player selection to the "JoinServerGui"... :)
#8
eg. In GuiObjectView::setObjectModel the name convention base.blabbla is handled. I can't figure out why there is no skin in the preview.
11/29/2002 (10:49 am)
You think it's easy like this ?? No, I don't think so, why we are the first then who figured this out,hehe. No I think this will make problems for sure. If the model is different on the client side (same name like on the server but different file size) the server quits the starting and tells you that you don't have the same file. Strongly I think it's true: Only the same model on both sides Server & client : shit.eg. In GuiObjectView::setObjectModel the name convention base.blabbla is handled. I can't figure out why there is no skin in the preview.
Torque Owner Adrian St. Onge
%player = new AIPlayer() {
dataBlock = LightMaleHumanArmor;
aiPlayer = false;
team = $aiTeam;
};
MissionCleanup.add(%player);
I assume you've created new datablocks for each different "type" of player. All you would have to do is
change the value of the "dataBlock" variable above to
point to a different datablock of a different player "type".
But, hey, you never know I could be wrong. :P
-- Adrian St. Onge