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

Change Hintstring Based if Player Has Perk

broken avatar :(
Created 9 years ago
by BrandynNew
0 Members and 1 Guest are viewing this topic.
2,442 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 December 2015
Last active: 3 years ago
Posts
68
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
BrandynNew's Groups
BrandynNew's Contact & Social Links
I am creating a custom perk, and I want to change the box price. death_reaper0 helped me out there, however, he said it was more complicated than he wanted to get into to change the hintstring for the box. Any help would be appreciated!
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 4 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
Signature
respect the dead

donates greatly appreciated :) paypal.me/F3ARxReaper666
discord server:
https://discord.gg/tsGHW99
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
a simple thing you can do is show both prices for all players
like replace
Code Snippet
Plaintext
	self set_hint_string( self, "default_treasure_chest_" + cost );

with

Code Snippet
Plaintext
	self sethintstring("Press & Hold &&1 To Use Magic Box [Cost: 950, Cost With PERK_NAME_HERE: 700]");
//self set_hint_string( self, "default_treasure_chest_" + cost );

in treasure_chest_think() in _zombiemode_weapons.gsc

this is just a simple way around it
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 December 2015
Last active: 3 years ago
Posts
68
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
BrandynNew's Groups
BrandynNew's Contact & Social Links
Thank you! I'm sure it would be almost unneedlessly complicated to change the string otherwise, so using that will be just fine!

Double Post Merge: November 17, 2016, 06:56:47 pm
I'm very sorry for having some many questions, you don't have to answer this if I've irritated you, but what allows you to write an if-then statement to change, say, the box cost, but not to change a hintstring? I've never scripted before, and I don't understand why you can do one but not the other.
Last Edit: November 17, 2016, 06:56:47 pm by BrandynNew
broken avatar :(
×
broken avatar :(
Location: aupotato
Date Registered: 27 September 2013
Last active: 4 years ago
Posts
588
Respect
Forum Rank
Zombie Enslaver
Primary Group
Community Scripter
My Groups
More
My Contact & Social Links
More
×
death_reaper0's Groups
Community Mapper Has released one or more maps to the UGX-Mods community which have been added to the UGX Map Manager.
Community Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Thank you! I'm sure it would be almost unneedlessly complicated to change the string otherwise, so using that will be just fine!

Double Post Merge: November 17, 2016, 06:56:47 pm
I'm very sorry for having some many questions, you don't have to answer this if I've irritated you, but what allows you to write an if-then statement to change, say, the box cost, but not to change a hintstring? I've never scripted before, and I don't understand why you can do one but not the other.

the price is just a varriable, a number that can be used is a math equasion (in this case, taking a number from another number, being your price and current points)
while a hintstring is technicly still a variable in a way, the trigger is programed to say whatever you set it as until its changed, the player trying to use it cant change it themselves, you need to program a change from something

im kinda droning on but the reason the string cant change is cause its affected by the trigger, not the player. if you do what i did with the price, it would only change after a use, meaning no matter what your cost is, it'll display whatever the cost was last time it was used. you need to go into a thing where theres a trigger for each player, instead of one trigger. like i said before i could do it but it would take a bit for me, and i probably wouldnt even do it the best way (something ive done in the past is check for the nearest player and display his string, but that would mess up if two players are next to the box)
i think harrybo21 had something for player specific triggers, dont know where it is though
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 9 December 2015
Last active: 3 years ago
Posts
68
Respect
Forum Rank
Rotting Walker
Primary Group
Member
×
BrandynNew's Groups
BrandynNew's Contact & Social Links
Ok, thank you. I understand more now. HarryBo21 did make a script for custom triggers, if that would be relevant here.
Last Edit: November 18, 2016, 01:44:40 pm by Dust

 
Loading ...