PDA

View Full Version : change the trigger from the script



ORDI
9th May 2015, 10:36
Hello everybody

i'm making a map with paying doors.
in radiant i use the trigger use touch
and in the script i use hintstring: self sethintstring("Press [^3F^7] for open the door! (^31000^1$^7)");

i would like to know if it's possible to remove or change the trigger for another trigger when the player paid the door. (i can hide the hintstring but the icon use touch is still here)
there is a function or something to change the classname? or to remove the icon ? or the trigger can become an entity?

ORDI
xf: ordi37zk

Tally
9th May 2015, 10:45
Hello everybody

i'm making a map with paying doors.
in radiant i use the trigger use touch
and in the script i use hintstring: self sethintstring("Press [^3F^7] for open the door! (^31000^1$^7)");

i would like to know if it's possible to remove or change the trigger for another trigger when the player paid the door. (i can hide the hintstring but the icon use touch is still here)
there is a function or something to change the classname? or to remove the icon ? or the trigger can become an entity?

ORDI
xf: ordi37zk

Lower the trigger under the map so that players can't touch it. You can raise it again back to its original position when you need it. There is a stock function to do both of these things:


trigger maps\mp\_utility::triggerOff();


trigger maps\mp\_utility::triggerOn();

IzNoGoD
9th May 2015, 12:04
you can trigger sethintstring(&"this is not a door"); after precaching. Or you can change the configstring containing the string on a per-player basis, but that requires libcod.

pollo
12th May 2015, 21:01
If you want 2 triggers at the same position (1 hidden and 1 shown) you can hide one of your triggers (using the func Tally mentioned before) and, after the first trigger is enabled, hide it and show the hidden one.

In other words, you have 2 triggers in the same position (no matter which sort of trigger):

#1
key:targetname
value:trig1

#2
key:targetname
value:trig2

Now in script:


trig()
{
trig1 = getent("trig1","targetname");
trig2 = getent("trig2","targetname");

//disable first the second trigger
trig2 maps\mp\_utility::triggerOff();

while(1)
{
trig1 waittill("trigger",user);
user iprintlnbold("trig1 disabled");
trig1 maps\mp\_utility::triggerOff();
wait 1;

//"enables" the second trigger again
trig2 maps\mp\_utility::triggerOn();
user iprintlnbold("trig2 enabled");
wait 1;

break;
}
}

1: trig2 -> disabled
2: player activates trig1
3: trig 1 -> disabled, trig2 -> enabled