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

Best way to go about player specific hintstrings

broken avatar :(
Created 9 years ago
by Harry Bo21
0 Members and 1 Guest are viewing this topic.
1,912 views
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
Currently im using a hud elem on each player and changing the variable that has the text in it

But id really like to use the normal hint system, but I also really want to be able to change the hint thats displayed to each player at will

example

Press F to build
Building
Press F to Take

but to player 2 would say

Need Parts

Press F to Take

whats the best way to go about this, ive never even looked into the hintstring code tbh
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 3 years ago
Posts
605
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
i don't think there is a way to do it with the already put inplace system. it sucks and you should probably just stick with your current system or make a different one. i had the idea of changing the visibility with setinvisibleto and the other one with to triggers but those to functions are buggy as far as I've used them and only show for one of the players there set visible to.
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
Signature
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
are you wanting to do this with 2 players using the trigger at the same exact moment, if so then youll need to use multiple triggers and hide and show which trigger you want to be displayed to each player.

if its just one person using the trigger at a time then you can do it by doing a distance check between the player and the trigger and modifying the text depending on if they have a part or not.
broken avatar :(
×
broken avatar :(
[UGX] Documentation Writer & Programmer
Location: usLos Angeles, CA
Date Registered: 23 August 2013
Last active: 6 months ago
Posts
1,322
Respect
Forum Rank
Zombie Colossus
Primary Group
UGX Team Member
My Groups
More
My Contact & Social Links
More
Personal Quote
(ง º ω º )ง u wont sum m8y?
Signature
Do not take life too seriously. You will never get out of it alive.
×
DidUknowiPwn's Groups
UGX Team Member
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.
BO3 Modtools Alpha
BO3 Modtools Alpha
This user has access to the Black Ops 3 Modtools Alpha
Create localizedstrings by following this:
STR_SOMETHING_0 -> "Press &&1 to do whatever on player 0"
STR_SOMETHING_1 -> "Press &&1 to do whatever on player 1"
etc.

In your trigger do this (make sure it's a trigger_radius)
self SetHintString (&"STR_SOMETHING_" + player.entity_num);
Would suggest hiding the trigger if there's no player touching it and then show after the string is set as it might change weirdly. Unless you set a blank string when no one is touching it.
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
×
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
are you wanting to do this with 2 players using the trigger at the same exact moment, if so then youll need to use multiple triggers and hide and show which trigger you want to be displayed to each player.

if its just one person using the trigger at a time then you can do it by doing a distance check between the player and the trigger and modifying the text depending on if they have a part or not.
Yes, and i mean i want to avoid the need for extra triggers

I do it ok with a hud elem, its just if theres a hintstring in range too, both comes up, and theres a bunch of times that "could" happen, so i wanted something better
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
Yes, and i mean i want to avoid the need for extra triggers

I do it ok with a hud elem, its just if theres a hintstring in range too, both comes up, and theres a bunch of times that "could" happen, so i wanted something better

Like dukip said you can do it by using a trigger_radius to test that player is close enough to the trigger, or like I said you could do a distance check to do the same thing. Just depends on if you want to use a trigger_radius or a trigger_use for your trigger. But once you've verified that the player is close enough to the trigger to use it then just modify the hintString depending on if they have the part or not just like you are for the hug element
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
×
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
but if two people are touching it, itll flicker between them

the hud element is client specific, a hintstring is 1 to the trigger

if i change it, itll change to one, display that, change to the other, display that - repeat
Last Edit: July 16, 2015, 04:15:13 pm by Harry Bo21
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 11 March 2014
Last active: 3 years ago
Posts
264
Respect
Forum Rank
Mr. Elemental
Primary Group
Member
×
buttkicker845's Groups
buttkicker845's Contact & Social Links
but if two people are touching it, itll flicker between them

the hud element is client specific, a hintstring is 1 to the trigger

if i change it, itll change to one, display that, change to the other, display that - repeat

if you do something like this it won't flicker when 2 people use it, the hintString will just say whatever the first if statement sets it to

Code Snippet
Plaintext
dist = 128*128;
if(self.hasPart && DistanceSquared (self.origin,trig.origin) < dist)
{
        trig setHintString("Press and hold &&1 to add the part");
}
else if(!self.hasPart &&  DistanceSquared (self.origin,trig.origin) < dist)
{
          trig setHintString("You need a part");
}
else
{
          trig setHintString("");
}

so in this case it will tell both players they can add the part.
given this isnt as accurate as the hud elements but it will not just flicker back and forth. and can be used if you don't want 2 triggers or 2 hud elements for your hintStrings

 
Loading ...