Game Development Community

DefaultPlayers Weapon

by Scottie Sirius · in Game Mechanics Kit · 01/04/2010 (2:02 pm) · 4 replies

I got GMK installed but can't figure out where to change the default weapon back to what it was. I want to use the crossbow rather than the little gun that shoots the neon green peas...lol.
Where do I go to change it?

#1
01/05/2010 (3:58 pm)
for the bots it in
game\scripts\server\logickingMechanics\SampleObjects\spaceOrcBot.cs

around lines 88-100 in stock script

maxDamage = 50;//10000;

maxInv[CrossbowAmmo] = 5000;
};

datablock PlayerData(SpaceOrcBotData2 : SpaceOrcBotData)
{
weapon = CrossbowImage;
ammo = CrossbowAmmo;
ammoCount = 3000;
shootingDelay = 2000;
shootingDelayVariant = 2000;
};
#2
01/05/2010 (8:00 pm)
Wouldn't that just change the SpaceOrcs weapon?
In player.cs I have all of the weapons listed but don't see how to switch to the one I want.
#3
01/10/2010 (11:41 am)
Hi Scot,

Please check this
..gameartdatablocksplayer.cs

In DefaultPlayerData you can add more types of weapon to be in inventory.

Change BlasterGun and Ammo to Crossbow.
maxInv[BlasterGun] = 1;
maxInv[BlasterAmmo] = 10000;

The following code from

..gamescriptsserverlogickingMechanicspackages.cs

It sets the blaster as main weapon

function GameCore::loadOut(%game, %player)
    {
        %player.setInventory(BlasterGun, 1);
        %player.setInventory(BlasterAmmo,%player.maxInventory(BlasterAmmo));
                
    }
#4
01/11/2010 (10:59 am)
Thanks Yuri, working like a charm!