So within my map, I am using Bluntstuffy's Soul Chest. They all work perfectly until I get to the reward. For my map I have added a custom weapon as the soul chest reward and to add it I replaced all mentions of ray_gun in the _soul_chest.gsc as well as replaced the model name for the model that appears. The custom reward works perfectly and can be picked up once all soul chests are completed. The only issue is that when you pick up the reward, you cant get rid of it. If you hit the box or buy a wall weapon and try to replace that gun it wont work and will instead just give you an extra weapon. You can keep doing this with every single weapon and it won't replace it. You just keep getting more and more weapons. I have tried to look at the issue but knowing me, it is most likely an error on my behalf. I may be wrong but it appears that the issue may be caused by this section of the script (I have replaced the custom weapon name with "WEAPON" to keep it secret):
if( player.has_gun == true ) { player switchtoweapon( "WEAPON" ); player givemaxammo( "WEAPON" ); player playsound( "ammo_pickup" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; }
else if( player.has_gun_upgr == true ) { player switchtoweapon( "WEAPON_upgraded" ); player givemaxammo( "WEAPON_upgraded" ); player playsound( "ammo_pickup" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; }
else if( weaplist.size <= 1 ) { player giveweapon( "WEAPON" ); player switchtoweapon( "WEAPON" ); player playsound( "weap_pickup_plr" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; }
else if( weaplist.size >= 2 ) { player takeweapon( old_gun ); player giveweapon( "WEAPON" ); player switchtoweapon( "WEAPON" ); player playsound( "weap_pickup_plr" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; } }
else if( player.WEAPON == true ) { iprintlnbold( "This one is not for you..!" ); } wait 0.1; } }
If anyone can help to debug this issue then it would be greatly appreciated. I have tried to fix it but being the dumbass I am, I have had no luck. Thanks in advance.
So within my map, I am using Bluntstuffy's Soul Chest. They all work perfectly until I get to the reward. For my map I have added a custom weapon as the soul chest reward and to add it I replaced all mentions of ray_gun in the _soul_chest.gsc as well as replaced the model name for the model that appears. The custom reward works perfectly and can be picked up once all soul chests are completed. The only issue is that when you pick up the reward, you cant get rid of it. If you hit the box or buy a wall weapon and try to replace that gun it wont work and will instead just give you an extra weapon. You can keep doing this with every single weapon and it won't replace it. You just keep getting more and more weapons. I have tried to look at the issue but knowing me, it is most likely an error on my behalf. I may be wrong but it appears that the issue may be caused by this section of the script (I have replaced the custom weapon name with "WEAPON" to keep it secret):
if( player.has_gun == true ) { player switchtoweapon( "WEAPON" ); player givemaxammo( "WEAPON" ); player playsound( "ammo_pickup" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; }
else if( player.has_gun_upgr == true ) { player switchtoweapon( "WEAPON_upgraded" ); player givemaxammo( "WEAPON_upgraded" ); player playsound( "ammo_pickup" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; }
else if( weaplist.size <= 1 ) { player giveweapon( "WEAPON" ); player switchtoweapon( "WEAPON" ); player playsound( "weap_pickup_plr" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; }
else if( weaplist.size >= 2 ) { player takeweapon( old_gun ); player giveweapon( "WEAPON" ); player switchtoweapon( "WEAPON" ); player playsound( "weap_pickup_plr" ); self notify( "took_gun" ); WEAPON delete(); self delete(); break; } }
else if( player.WEAPON == true ) { iprintlnbold( "This one is not for you..!" ); } wait 0.1; } }
If anyone can help to debug this issue then it would be greatly appreciated. I have tried to fix it but being the dumbass I am, I have had no luck. Thanks in advance.
Are you using Harry's Perks? If so normal giveweapon won't work, you need to use his give weapon function.
Add this to the top of stuffy's soulchest gsc:
Code Snippet
Plaintext
#include maps\_harrybo21_utilities;
and Replace all of these:
Code Snippet
Plaintext
giveweapon(gun) //gun = your gun, so you can do for example find/replace giveweapon("raygun"), etc.
with this:
Code Snippet
Plaintext
harrybo21_give_gun( gun ) // same as above, when replacing replace gun with your weapon name (or variable that stores the weapon name)
If you're not then giveweapon should work.
Last Edit: March 05, 2016, 11:24:43 pm by Scobalula