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

Simple problem

broken avatar :(
Created 6 years ago
by Joeycx
0 Members and 1 Guest are viewing this topic.
2,733 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
I have a trigger_multiple that i want to act as a message that can be triggered over and over again, but the script i have isn't working right. if anyone can help it would be great!

Code Snippet
Plaintext
area_text()
{
          trigger = getent("area_trigger","targetname"); //Trigger Multiple
          trigger SetCursorHint("HINT_NOICON");
          trigger SetHintString("Use me");

          trigger waittill("trigger");

          IPrintLn("Message message message message");
Marked as best answer by Joeycx 6 years ago
broken avatar :(
×
broken avatar :(
Location: usEarth
Date Registered: 30 July 2015
Last active: 3 years ago
Posts
118
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Current project: Afterlife
Signature
"The only time you should look back, is to see how far you've come."
Use a trigger_use instead, also if you want it to repeat the message whenever they use the trigger try something like this

Code Snippet
Plaintext
area_text()
{
        self endon("disconnect");
self endon("death");

trigger = getent("area_trigger","targetname");
trigger SetCursorHint("HINT_NOICON");
trigger SetHintString("Use me");

for(;;)
{
trigger waittill("trigger");
 
IPrintLn("Message message message message");
wait .1;
}
}
Last Edit: April 07, 2018, 07:24:03 am by StupidEdits
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
I imagine he “wants” it on touch, to say where the person is
broken avatar :(
×
broken avatar :(
Location: usEarth
Date Registered: 30 July 2015
Last active: 3 years ago
Posts
118
Respect
Forum Rank
Pack-a-Puncher
Primary Group
Member
My Contact & Social Links
More
Personal Quote
Current project: Afterlife
I imagine he “wants” it on touch, to say where the person is

Ah, not sure. I took it as he wanted it to act as a button since the hintstring says "use me".
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
silly anyway, iprintln prints to "everyone", and i have no idea why this is threaded on a player

which it presumably is based on the endons
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 so much guys! I chose Iprintln because i wanted the message to be on the corner and not distracting to the player triggering it, but i guess it shows for everyone instead of the one triggering it only.

Double Post Merge: April 07, 2018, 03:26:13 pm
I imagine he “wants” it on touch, to say where the person is

I would want that as well, where it can tell where the person is like "entering blah blah area" without using sethintstring and using iprintlnbold or iprintln idk
Last Edit: April 07, 2018, 03:26:13 pm by Joeycx
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
Thanks so much guys! I chose Iprintln because i wanted the message to be on the corner and not distracting to the player triggering it, but i guess it shows for everyone instead of the one triggering it only.

You can simply do this to make it show to only one player:

Code Snippet
Plaintext

user = undefined;

for(;;)
{
trigger waittill("trigger", user);
 
user IPrintLn("Message message message message");
wait .1;
}

You can also do that with a trigger_multiple
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 simply do this to make it show to only one player:

Code Snippet
Plaintext

user = undefined;

for(;;)
{
trigger waittill("trigger", user);
 
user IPrintLn("Message message message message");
wait .1;
}

You can also do that with a trigger_multiple

Thank you so much!
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
You can simply do this to make it show to only one player:

Code Snippet
Plaintext

user = undefined;

for(;;)
{
trigger waittill("trigger", user);
 
user IPrintLn("Message message message message");
wait .1;
}

You can also do that with a trigger_multiple

swear ive tried that before and it doesnt work? Maybe just iprintLnBold doesnt



anyway as for the OPs questions regarding only making it show up once until the player walks away


you can do this by threading another function on the player that touched it, set a variable on that player and use that variable on the "trigger" function, if it is defined and is true, then they already saw the print

then in the function we threaded on the player, check constantly if hes still touching that trigger, when he no longer is, unset that variable again

bo3 ( i know your asking for waw ) actually already has a trigger utility script that has support for this, maybe you can just modify that back to waw, ill pop that support below anyway

Code Snippet
Plaintext
//trigger_thread
function function_thread(ent, on_enter_payload, on_exit_payload)
{
ent endon("entityshutdown");

if(ent ent_already_in(self))
return;

add_to_ent(ent, self);

// iprintlnbold("Trigger " + self.targetname + " hit by ent " + ent getentitynumber());

if(isdefined(on_enter_payload))
{
[[on_enter_payload]](ent);
}

while(isdefined(ent) && ent istouching(self))
{
wait(0.01);
}

// iprintlnbold(ent getentitynumber() + " leaves trigger " + self.targetname + ".");

if(isdefined(ent) && isdefined(on_exit_payload))
{
[[on_exit_payload]](ent);
}

if(isdefined(ent))
{
remove_from_ent(ent, self);
}
}


uses other functions from that script, some of which you can prob just change or cut completely :

Code Snippet
Plaintext
function ent_already_in(trig)
{
if(!isdefined(self._triggers))
return false;

if(!isdefined(self._triggers[trig getentitynumber()]))
return false;

if(!self._triggers[trig getentitynumber()])
return false;

return true; // We're already in this trigger volume.
}

function add_to_ent(ent, trig)
{
if(!isdefined(ent._triggers))
{
ent._triggers = [];
}

ent._triggers[trig getentitynumber()] = 1;
}

function remove_from_ent(ent, trig)
{
if(!isdefined(ent._triggers))
return;

if(!isdefined(ent._triggers[trig getentitynumber()]))
return;

ent._triggers[trig getentitynumber()] = 0;
}

again ^ this would need - thats NEED - to be modified to work in waw



i posted some custom trigger script for waw ages ago that supports this already if you can find it. I believe makecents also did something similar, id imagine his also supports this
Last Edit: April 07, 2018, 05:52:00 pm by Harry Bo21

 
Loading ...