UGX-Mods

Call of Duty 5: World at War => Help Desk => Scripting => Topic started by: BuIlDaLiBlE on July 28, 2015, 07:21:06 am

Title: Starting weapon replaces
Post by: BuIlDaLiBlE on July 28, 2015, 07:21:06 am
So, I ported a gun from Black Ops (M1911), everything perfect except that if I buy a wall weapon or use mystery box to acquire second weapon, the first one (M1911, obviously) gets replaced. How to deal with this weird thingy?
Title: Re: Starting weapon replaces
Post by: JBird632 on July 28, 2015, 07:33:23 am
You may have changed the starting pistol in _loadout.gsc but you have to go through all scripts and change it as well.
The scripts off the top of my head are _zombiemode_weapons.gsc dlc3_code.gsc and I think _zombiemode_perks.gsc
Title: Re: Starting weapon replaces
Post by: Rorke on July 28, 2015, 07:36:39 am
i had this troubble i fixed it by adding a extra weapon slot in_loadout.gsc and by changing the starting pistole in another gsc file
Title: Re: Starting weapon replaces
Post by: BluntStuffy on July 28, 2015, 07:36:49 am
the fact the box is swapping it out is caused by: treasure_chest_give_weapon() in _zombiemode_weapons.
You could do as Jbird said and edit some stuff, or you could simply name your new colt zombie_colt as well.
Title: Re: Starting weapon replaces
Post by: Rorke on July 28, 2015, 07:38:48 am
in _zombiemode_weapons.gsc find this line:
if( primaryWeapons == "zombie_colt" )

make sure its the same weapon file name as _loadout.gsc and thats it done
Title: Re: Starting weapon replaces
Post by: MakeCents on July 28, 2015, 12:20:08 pm
What he^ said but change it like this:

Code Snippet
Plaintext
			if( primaryWeapons.size == 1)//primaryWeapons[i] == "zombie_colt" )

That way if you have multliple starting pistols or change it in the next map, you don't have this issue anymore. Prob can make it <= 1 really but should never be an issue unless you have a bug.
Title: Re: Starting weapon replaces
Post by: MZslayer11 on July 28, 2015, 03:05:52 pm
A quick search led me to this: http://ugx-mods.com/forum/index.php/topic,5601.msg62000.html#msg62000 (http://ugx-mods.com/forum/index.php/topic,5601.msg62000.html#msg62000)
Title: Re: Starting weapon replaces
Post by: Rorke on July 28, 2015, 03:23:39 pm
A quick search led me to this: http://ugx-mods.com/forum/index.php/topic,5601.msg62000.html#msg62000 (http://ugx-mods.com/forum/index.php/topic,5601.msg62000.html#msg62000)
which is basically what i said
Title: Re: Starting weapon replaces
Post by: BuIlDaLiBlE on July 28, 2015, 06:35:06 pm
Thank you all for the answers! I was shocked that I didn't realize that by myself, probably 'cuz I was scripting at night.