Game Development Community

BF-style Packs?

by Okashira · in Torque Game Engine · 07/16/2006 (9:21 am) · 6 replies

How hard would it be to implement Battlefield-style 'packs' to the FPS Starter Kit? Like everytime you spawn you choose one of the (let's say 5) 'packs'. Depending on which pack you choose you will start with a different weapon and you will have a different character model.

Thanks,
Okashira

PS : I am currently working with the TGE Demo.

#1
07/16/2006 (9:30 am)
Fairly easy. All you'd really need to do is impliment a selection GUI and when whichever character is clicked mount a weapon(s) to them. This can be done in the demo, though I think the resources use GUI object view...
#2
07/16/2006 (10:53 am)
@Matt
Thanks alot. I am assuming that you could do the same thing (as you said with mounting a weapon) only have it change the model to change it to a different model(duh)?

Thanks,
Okashira
#3
07/16/2006 (10:56 am)
Yes. Just having 1 character spawn with a different weapon would be highly recommended for a quick prototype. From game.cs gameconnection:createPlayer()

%player.setInventory(Crossbow,1);
%player.setInventory(CrossbowAmmo,10);
%player.mountImage(CrossbowImage,0);

That all is added on player spawn.

Exodus's team resource would be worth looking at. It does something very similar to this.
#4
07/17/2006 (1:50 pm)
@Matt
Thanks for the code, but what about changing the character model?

Thanks,
Okashira
#5
07/17/2006 (1:54 pm)
C2 did one found here However, it does require GuiObjectView in its current state which requires source changes.
#6
07/17/2006 (2:59 pm)
I use a commandToServer to send the player's loadout choices to the server, then I assign them to dynamic values in the server's gameConnection object for that player. When the player spawns, it just checks to see
which player model, weapon, sidearm, and 'special item' that they chose to spawn with from the GUI.

This code is not complete, you will definitely want to make sure the player does not choose anything you
don't want them choosing (tankTurretImage, etc).

function serverCmdChooseLoadout(%client, %weapon, %sidearm, %specItem, %playerModel)
{
%client.weapon = %weapon;
%client.sidearm = %sidearm;
%client.specItem = %specItem;
%client.playerModel = %playerModel;
}

then in createPlayer just use those values to assign the appropriate weapon, player model, etc.