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

Scripting Question

broken avatar :(
Created 11 years ago
by MJPWGaming
0 Members and 1 Guest are viewing this topic.
1,575 views
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 26 March 2014
Last active: 5 years ago
Posts
200
Respect
Forum Rank
Mr. Elemental
Primary Group
Donator ♥
My Groups
More
×
MJPWGaming's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
MJPWGaming's Contact & Social Links
Hi so how to I go about hiding a trigger/hintstring till it gets after a point in my script?

And also how do I script a hintstring XD

Im sorry Im trying my best :)
Marked as best answer by MJPWGaming 11 years ago
broken avatar :(
×
broken avatar :(
Location: usLouisiana
Date Registered: 1 January 2014
Last active: 1 year ago
Posts
65
Respect
Forum Rank
Rotting Walker
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Beginner Scripter && A7X Deathbat
×
idogftw's Groups
idogftw's Contact & Social LinksIdogftw00
Here is a little example I made that has both things you want.
Code Snippet
Plaintext
main()
{
trigger = getEnt("test","targetname"); //Regular trigger
trigger thread hint(); //Threading the hint function
}

hint()
{
trig_hide = getEnt("hide","targetname"); //This is the trigger you are going to hide

trig_hide hide(); //This hides the trigger you want hidden till later

//Also the self is the trigger that you used in main to thread the hint function

self setCursorHint("HINT_NOICON"); //This make sure there is no hand icon if you don't want it remove this line
self setHintString("What you want hintstring to say"); //This is how you set a hintstring

self waittill("trigger", player);

iprintln("Unhiding trig_hide");

trig_hide show(); //This shows the trigger that you hid earlier in the code
}

Hope this helps
Last Edit: July 23, 2015, 09:51:02 am by idogftw
broken avatar :(
×
broken avatar :(
☭ Soviet Commander ☭
Location: us
Date Registered: 13 August 2012
Last active: 10 years ago
Posts
2,789
Respect
Forum Rank
King of the Zombies
Primary Group
Community Daedra
My Groups
More
My Contact & Social Links
More
Signature
Let's keep this thread on topic from here on in. -DBZ

+1 to off-topic reply -DBZ

lmao. Too funny.

Goliath Script Placer: http://ugx-mods.com/forum/index.php/topic,11234.msg125257/topicseen.html#new

"...Christ, people. Learn C, instead of just stringing random characters
together until it compiles (with warnings)..."

-Linus Torvalds
×
daedra descent's Groups
Community Daedra
Community Daedra
daedra descent's Contact & Social LinksBlueSoviet
Pro tip: don't assume something is defined. It'll get you in some nasty situations depending on what your doing.

add an isDefined() check after attempting to get an entity, like so:

Code Snippet
Plaintext
	trigger = getEnt("test","targetname"); //Regular trigger
if(!isDefined(trigger))
         return;

Edit: forum screws up indentation. the if() check goes on the same line as getEnt while return is indented one more.
Last Edit: July 23, 2015, 11:37:33 am by daedra descent

 
Loading ...