Modme Forums

How to change starting weapon in Stock Maps?

Game Modding | Call of Duty: Black Ops 3 | Scripting


franc710:

How i have to set up the _clientids.gsc in order to change the starting weapon on any of the stock maps? I only find tutorials on how to do it in Custom Maps.

Thanks in advance!


Harry Bo21:

Don’t mess with that

Copy one of the power up scripts to your mod in the same directory and add it to your zone - it’ll override the stock one so you can hook from there


franc710:

Don’t mess with that

Copy one of the power up scripts to your mod in the same directory and add it to your zone - it’ll override the stock one so you can hook from there

Mh that's clear, but i'm trying to call for the function in order to work and i receive syntax/no generated data errors during link. Sorry for asking maybe this question that may be stupid, but how i integrate it properly?

startingWeapon = "";
weapon = getWeapon(startingWeapon);
level.start_weapon = (weapon);

This is the function that changes starting weapon if i'm not mistaken, i'm trying to set it into into my mod folder/scripts/zm/_zm_powerup_full_ammo.gsc which is one of the powerup gsc from root bo3. I already added it to zone

Thanks Harry for the help/patience with a newcomer in modding like me by the way


Harry Bo21:

Your setting it first, the map is then setting it back after

Have to delay it

In the end I think I just did a callback when you spawn, took the gun they get back off them and force gave my own


The line you’ve done will also be in mapname.gsc - which is happening later


franc710:

Your setting it first, the map is then setting it back after

Have to delay it

In the end I think I just did a callback when you spawn, took the gun they get back off them and force gave my own


The line you’ve done will also be in mapname.gsc - which is happening later

Ok, i correctly set the call back on player spawn and i don't receive anymore errors during link, but as expected the starting weapon doesn't change since i don't how to set "took the gun they get back off them and force gave my own" into script. How i should do it?

Thanks again for helping since i'm still learning the fundamentals of scripting with mod tools


Harry Bo21:

Ok, i correctly set the call back on player spawn and i don't receive anymore errors during link, but as expected the starting weapon doesn't change since i don't how to set "took the gun they get back off them and force gave my own" into script. How i should do it?

Thanks again for helping since i'm still learning the fundamentals of scripting with mod tools

On respawn you will, you need to manually take their gun back and give the other instead of the level.start_weapon = bit

Wait .5;
Self takeweapon( getweapon( “pistol_standard” ) );
Self giveweapon( getweapon( “your weapon” ) );
Self switchtoweapon( getweapon( “your weapon” ) );

Instead


franc710:

On respawn you will, you need to manually take their gun back and give the other instead of the level.start_weapon = bit

Wait .5;
Self takeweapon( getweapon( “pistol_standard” ) );
Self giveweapon( getweapon( “your weapon” ) );
Self switchtoweapon( getweapon( “your weapon” ) );

Instead

It totally makes sense now, but i got the error about "Uninitialized local variable" referring to the pistol_standard, it needs to be defined?

EDIT: nevermind, figured it out, it works!


Harry Bo21:

Nice

Remember it’s a different weapon on dlc5 maps so you would need to handle that


franc710:

Nice

Remember it’s a different weapon on dlc5 maps so you would need to handle that

I'll keep that in mind, thanks Harry!