UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

Upgraded Weapon Problem

HOT
broken avatar :(
Created 6 years ago
by Joeycx
0 Members and 1 Guest are viewing this topic.
4,160 views
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
Hi! I'm wondering since i have an upgraded_upgraded weapon, that can i make it so i can buy wall ammo off the wall for an upgraded_upgraded weapon, and to change the pack a punch price for an upgraded_upgraded weapon to be different from 5000? Also can that weapon be removed from the mystery box once it has been double pap, to prevent a useless weapon in a mystery box? If anyone could help me, that would be appreciated :)
Last Edit: May 24, 2018, 06:52:02 am by Joeycx
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website
I can't really remember who helped me to do it, but make cents talked about the normal in here. Maybe you can just edit it to be _upgraded_upgraded in the script.

https://www.ugx-mods.com/forum/index.php/topic,8396.msg91080.html#msg91080
Last Edit: May 30, 2018, 10:00:43 am by Tim Smith
broken avatar :(
×
broken avatar :(
Location: gbMilton Keynes
Date Registered: 17 January 2014
Last active: 4 years ago
Posts
6,877
Respect
1,004Add +1
Forum Rank
Immortal
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
If you want scripts / features made for you, then contact me by PM or email / skype etc
it will cost you tho so if you have no intention of reciprocating don't even waste my time ;)
×
Harry Bo21's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Harry Bo21's Contact & Social Links[email protected]HarryBo21HarryBo000
Hi! I'm wondering since i have an upgraded_upgraded weapon, that can i make it so i can buy wall ammo off the wall for an upgraded_upgraded weapon, and to change the pack a punch price for an upgraded_upgraded weapon to be different from 5000? Also can that weapon be removed from the mystery box once it has been double pap, to prevent a useless weapon in a mystery box? If anyone could help me, that would be appreciated :)
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
Thanks tim, but i'm looking for help with an upgraded_upgraded weapon instead of _upgraded weapon only lol.
broken avatar :(
×
broken avatar :(
Location: gbNewport
Date Registered: 2 November 2014
Last active: 2 years ago
Posts
1,265
Respect
Forum Rank
Zombie Colossus
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Embrace the Darkness
×
Tim Smith's Groups
Tim Smith's Contact & Social Linkstimsmith90THEREALBaDBoY17TimSmithMy clan Website



3 words changed the hole meaning, read it again. I was talking in script, already know that he has the weapons done already.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
Signature
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
I have an old topic on zombiemodding.com where it tells you all the stuff you meed to change for wall-buy, ammo, hasweapon checks etc. You would have to look for it. Search for my username ( also BluntStuffy and try something like _upgraded_upgraded )
If you cant find it i can try and look for it tonight/tomorrow
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
I have an old topic on zombiemodding.com where it tells you all the stuff you meed to change for wall-buy, ammo, hasweapon checks etc. You would have to look for it. Search for my username ( also BluntStuffy and try something like _upgraded_upgraded )
If you cant find it i can try and look for it tonight/tomorrow

OMFG thank you so much. I've been trying to find a solution for this for ages. But i also have 2 questions regarding this.
1: In your post you said something about alt ammo, is alt ammo purchasable from the original weapon trigger? (ex: buys type 99, upgrades it, it gets gl attachment, buys type 99 upgraded ammo)

2: the hintstring don't seem to update from the script. The prices are 5000 for _upgraded_upgraded ammo but buying a gun, it just lists " 500(gun price) || 350 (ammo price) || 4500 (upgraded ammo price " instead of updating _upgraded price and adding _upgraded_upgraded's price. I also changed the orignal pap price in the script but it shows as 4500 still.

Sorry if i'm asking too much, but any tip or advice would be appreciated!

The post regarding double pap: https://zombiemodding.com/index.php?topic=12383.0 (Idk if i can post zm links)

broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Quote
OMFG thank you so much. I've been trying to find a solution for this for ages. But i also have 2 questions regarding this.
1: In your post you said something about alt ammo, is alt ammo purchasable from the original weapon trigger? (ex: buys type 99, upgrades it, it gets gl attachment, buys type 99 upgraded ammo)

Tbh, i'm not really sure anymore. It's been a while since i messed with that ( as you can see from the date ). You would have to try and see, if it doesn't you could Always change the function in _zombiemode_weapons that give the ammo to the players.
I was trying some weird stuff with alt-weapons and ammo, so just ignore the talk about alt-ammo etc if you dont use it.

Quote
2: the hintstring don't seem to update from the script. The prices are 5000 for _upgraded_upgraded ammo but buying a gun, it just lists " 500(gun price) || 350 (ammo price) || 4500 (upgraded ammo price " instead of updating _upgraded price and adding _upgraded_upgraded's price. I also changed the orignal pap price in the script but it shows as 4500 still.
The hintstrings are 'fixed' so they wont update themself. You need to change them. So look for the sethintstring() lines. Most of them for weapons and PaP look like this:
Code Snippet
Plaintext
		weapon_cabs[i] SetHintString( &"ZOMBIE_CABINET_OPEN_1500" ); 

where it has the & infront of the " This indicates it's a localized string ( so it adjusts itself to the language you install the game with. You can either go to /raw/english/localizedstrings/ and look for the zombie.str. Then you can adjust them in there. You can also just hard-code them in your scripts by removing the & and just typing them out:
Code Snippet
Plaintext
		weapon_cabs[i] SetHintString( "Open weapon cabinet. Cost [1500]" ); 


Since there's no real benefit in localized strings for modding you are prob easier of just hardcoding them.

Spoiler: click to open...
btw, the hintstrings for weapons are in the add_zombie_weapon() function:
Code Snippet
Plaintext
	add_zombie_weapon( "kar98k_scoped_zombie", 					&"ZOMBIE_WEAPON_KAR98K_S_750", 				750,	"vox_ppsh",		5);
hope that helps,
Blunt


Last Edit: May 30, 2018, 04:43:34 pm by BluntStuffy
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
Tbh, i'm not really sure anymore. It's been a while since i messed with that ( as you can see from the date ). You would have to try and see, if it doesn't you could Always change the function in _zombiemode_weapons that give the ammo to the players.
I was trying some weird stuff with alt-weapons and ammo, so just ignore the talk about alt-ammo etc if you dont use it.
The hintstrings are 'fixed' so they wont update themself. You need to change them. So look for the sethintstring() lines. Most of them for weapons and PaP look like this:
Code Snippet
Plaintext
		weapon_cabs[i] SetHintString( &"ZOMBIE_CABINET_OPEN_1500" ); 

where it has the & infront of the " This indicates it's a localized string ( so it adjusts itself to the language you install the game with. You can either go to /raw/english/localizedstrings/ and look for the zombie.str. Then you can adjust them in there. You can also just hard-code them in your scripts by removing the & and just typing them out:
Code Snippet
Plaintext
		weapon_cabs[i] SetHintString( "Open weapon cabinet. Cost [1500]" ); 


Since there's no real benefit in localized strings for modding you are prob easier of just hardcoding them.

Spoiler: click to open...
btw, the hintstrings for weapons are in the add_zombie_weapon() function:
Code Snippet
Plaintext
	add_zombie_weapon( "kar98k_scoped_zombie", 					&"ZOMBIE_WEAPON_KAR98K_S_750", 				750,	"vox_ppsh",		5);
hope that helps,
Blunt

Thank you so much for helping me. I found the string used for upgrading the weapon but setting it up is quite messy
Code Snippet
Plaintext
self SetHintString( &"ZOMBIE_WEAPONCOSTAMMO", cost, get_ammo_cost( self.zombie_weapon_upgrade ) ); 

but i'm unable to set up the values without setting the cost and get_ammo_cost, so if i do
Code Snippet
Plaintext
self SetHintString( "Upgraded Ammo [2500], Double Upgraded Ammo [5000]", cost, get_ammo_cost( self.zombie_weapon_upgrade ) ); 
it would appear like "Upgraded Ammo [2500], Double Upgraded Ammo [5000] 1000500" in game so i'm guessing the end numbers are the cost, and get_ammo_cost so how am i able to put them in so it will show the upgraded cost, double upgraded cost, weapon cost and ammo cost?  I tried the localized way and i was wondering why you said there was no benefit in doing it that way? Also is there a way to change the pap cost for _upgraded and _upgraded_upgraded? Sorry if i'm asking for to much lol.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
You can add a variable in a string with a + and if you want to continue the string you simply add a + after that and add a new string. So for example:

Code Snippet
Plaintext
	weapon_cost = 1000;
ammo_cost = 500;
pap_ammo = 4500;
pap2x_ammo = 8000;

trigger sethintstring( "Buy weapon, Cost: "+weapon_cost+" Ammo Cost "+ammo_cost+"Pap Ammo Cost: "+pap_ammo+" Double PaP ammo Cost: "+pap2x_ammo );


Localized strings are really only usefull if you want to release multiple langue-versions of your map. If you only make an english version using localized strings is only extra work for nothing.


You can change the pap-hintstring, sure. It will be more complicated to make it display the correct price depending on if you appraoch the machine with a paped or a non-paped weapon. But you can simply do something like.
"Press Use to upgrade weapon [5000]. Double upgrade [10000]"
It should be in zombiemode_perks somewhere, just search for sethintstring

broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
You can add a variable in a string with a + and if you want to continue the string you simply add a + after that and add a new string. So for example:

Code Snippet
Plaintext
	weapon_cost = 1000;
ammo_cost = 500;
pap_ammo = 4500;
pap2x_ammo = 8000;

trigger sethintstring( "Buy weapon, Cost: "+weapon_cost+" Ammo Cost "+ammo_cost+"Pap Ammo Cost: "+pap_ammo+" Double PaP ammo Cost: "+pap2x_ammo );


Localized strings are really only usefull if you want to release multiple langue-versions of your map. If you only make an english version using localized strings is only extra work for nothing.


You can change the pap-hintstring, sure. It will be more complicated to make it display the correct price depending on if you appraoch the machine with a paped or a non-paped weapon. But you can simply do something like.
"Press Use to upgrade weapon [5000]. Double upgrade [10000]"
It should be in zombiemode_perks somewhere, just search for sethintstring

I'm a very horrible at scripting so what you said was a bit confusing but i got it, i was able to use the sethingstring instead of the localized strings by doing this
Code Snippet
Plaintext
self SetHintString( "For Weapon [Cost: "+cost+"], Ammo ["+get_ammo_cost( self.zombie_weapon_upgrade )+"], Upgraded Ammo [Cost: 2500], Double Upgraded Ammo [Cost: 5000]" ); 
It worked in game but idk if could cause problems later on. But thank you so much for helping me :) One other question, i'm using harry's scripts for perks and pap so the strings and sethintstrings for the pap price aren't called there i think, because i looked for sethintstring and nothing regarding pap showed up so idk.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
Quote
It worked in game but idk if could cause problems later on. But thank you so much for helping me :)

That should work fine.


Quote
One other question, i'm using harry's scripts for perks and pap so the strings and sethintstrings for the pap price aren't called there i think, because i looked for sethintstring and nothing regarding pap showed up so idk.

Havent used those myself, so i couldn't tell you. Guess just open all files that come with it at the same time, and search through all of them at the same time for sethintstring(). Think i've seen him put a lot of variables at the top of his scripts, so it's eaasier for user to edit.
So it could be he included them as a 'setting' and stored the string in a variable at the top of a script somewhere..
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
That should work fine.


Havent used those myself, so i couldn't tell you. Guess just open all files that come with it at the same time, and search through all of them at the same time for sethintstring(). Think i've seen him put a lot of variables at the top of his scripts, so it's eaasier for user to edit.
So it could be he included them as a 'setting' and stored the string in a variable at the top of a script somewhere..

I found the variable
Code Snippet
Plaintext
// ================================= PRECACHE MDOELS SHADERS AND WEAPON FILES AND SETTINGS =================================
harrybo21_perks_upgrade_add_machine( "normal_pack_a_punch", 5000, 30, "zombie_vending_packapunch", "zombie_vending_packapunch_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_machine( "alcatraz_pack_a_punch", 5000, 30, "bo2_p6_zm_al_vending_pap", "bo2_p6_zm_al_vending_pap_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_machine( "tranzit_pack_a_punch", 5000, 30, "bo2_p6_anim_zm_buildable_pap", "bo2_p6_anim_zm_buildable_pap_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_animated_machine( "origins_pack_a_punch", 5000, 30, "bo2_p6_zm_tm_packapunch", %fxanim_zom_tomb_packapunch_all_build_anim, %fxanim_zom_tomb_packapunch_all_break_anim, "tomb_perk_sting_pap", undefined,

But i wouldn't know how to script it to allow 5000 for the 1st upgrade and 10000 for 2nd upgrade since the script line is structured by
Code Snippet
Plaintext
( pap_name, pap_price, pap_gun_height, pap_model, pap_on_model, pap_sting, pap_jingle, pap_use, pap_idle_sound )

there's also this
Code Snippet
Plaintext
self.trig SetHintString( "Press & hold ^6&&1^7 to buy Pack A Punch [Cost: " + level.pack_a_punches[ self.trig.script_string ].pap_price + "]" );

but it works the same way as the script you showed me. so idk, very confusing lol.
broken avatar :(
×
broken avatar :(
Location: nlApeldoorn
Date Registered: 17 December 2013
Last active: 1 year ago
Posts
1,187
Respect
1,404Add +1
Forum Rank
Zombie Colossus
Primary Group
Community Scripter Elite
My Groups
More
My Contact & Social Links
More
Personal Quote
It aint much, if it aint Dutch
×
BluntStuffy's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Community Scripter Elite Has shown excellence and experience in the area of custom scripting in the UGX-Mods community.
Oil Rig Beta Access
Oil Rig Beta Access
BluntStuffy's Contact & Social LinksBluntstuffy@BluntZombieBluntStuffyStuffyZombie
I found the variable
Code Snippet
Plaintext
// ================================= PRECACHE MDOELS SHADERS AND WEAPON FILES AND SETTINGS =================================
harrybo21_perks_upgrade_add_machine( "normal_pack_a_punch", 5000, 30, "zombie_vending_packapunch", "zombie_vending_packapunch_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_machine( "alcatraz_pack_a_punch", 5000, 30, "bo2_p6_zm_al_vending_pap", "bo2_p6_zm_al_vending_pap_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_machine( "tranzit_pack_a_punch", 5000, 30, "bo2_p6_anim_zm_buildable_pap", "bo2_p6_anim_zm_buildable_pap_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_animated_machine( "origins_pack_a_punch", 5000, 30, "bo2_p6_zm_tm_packapunch", %fxanim_zom_tomb_packapunch_all_build_anim, %fxanim_zom_tomb_packapunch_all_break_anim, "tomb_perk_sting_pap", undefined,

But i wouldn't know how to script it to allow 5000 for the 1st upgrade and 10000 for 2nd upgrade since the script line is structured by
Code Snippet
Plaintext
( pap_name, pap_price, pap_gun_height, pap_model, pap_on_model, pap_sting, pap_jingle, pap_use, pap_idle_sound )

All this stuff has nothing to do with the hintstring/price. it's for spawning the models etc



Quote
there's also this
Code Snippet
Plaintext
self.trig SetHintString( "Press & hold ^6&&1^7 to buy Pack A Punch [Cost: " + level.pack_a_punches[ self.trig.script_string ].pap_price + "]" );

but it works the same way as the script you showed me. so idk, very confusing lol.

That's the string you need to change, just type whatever you want here just like with the weapons. ( the .pap_price  variable sets the price for the normal pap, you can search where that variable is set.
broken avatar :(
×
broken avatar :(
Location: vn
Date Registered: 23 February 2015
Last active: 3 years ago
Posts
208
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
Joeycx's Groups
Joeycx's Contact & Social Links
All this stuff has nothing to do with the hintstring/price. it's for spawning the models etc



That's the string you need to change, just type whatever you want here just like with the weapons. ( the .pap_price  variable sets the price for the normal pap, you can search where that variable is set.

But this is the pap_price
Code Snippet
Plaintext
harrybo21_perks_upgrade_add_machine( "normal_pack_a_punch", 5000, 30, "zombie_vending_packapunch", "zombie_vending_packapunch_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_machine( "alcatraz_pack_a_punch", 5000, 30, "bo2_p6_zm_al_vending_pap", "bo2_p6_zm_al_vending_pap_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_machine( "tranzit_pack_a_punch", 5000, 30, "bo2_p6_anim_zm_buildable_pap", "bo2_p6_anim_zm_buildable_pap_on", "mx_packa_sting", "mx_packa_jingle", "packa_weap_upgrade", "packa_rollers_loop" );
harrybo21_perks_upgrade_add_animated_machine( "origins_pack_a_punch", 5000, 30, "bo2_p6_zm_tm_packapunch", %fxanim_zom_tomb_packapunch_all_build_anim, %fxanim_zom_tomb_packapunch_all_break_anim, "tomb_perk_sting_pap", undefined, "tomb_perk_machine_pap", undefined );
The line with the 5000, when i change it, it changes the price, i just don't know how to make it 5000 for the first pap and 10000 for the second pap.

This is the structure harry put it as, so it matches the above and the pap_price already has a variable.
Code Snippet
Plaintext
harrybo21_perks_upgrade_add_machine( pap_name, pap_price, pap_gun_height, pap_model, pap_on_model, pap_sting, pap_jingle, pap_use, pap_idle_sound )

sorry if it sound like im contradicting you but i tried finding the pap_price and the only variable was the 5000 in the precache mdoels shaders and weapon files and settings.

 
Loading ...