Results 1 to 4 of 4

Thread: change the trigger from the script

  1. #1
    Private
    Join Date
    Aug 2013
    Posts
    95
    Thanks
    13
    Thanked 4 Times in 3 Posts

    change the trigger from the script

    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

  2. #2
    Brigadier General
    Join Date
    Oct 2012
    Posts
    994
    Thanks
    20
    Thanked 588 Times in 388 Posts
    Quote Originally Posted by ORDI View Post
    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:

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

  3. #3
    Assadministrator IzNoGoD's Avatar
    Join Date
    Aug 2012
    Posts
    1,718
    Thanks
    17
    Thanked 1,068 Times in 674 Posts
    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.
    "Does not work" is an error report for a bug between keyboard and chair.

    All hail Artie Effem

  4. #4
    Private pollo's Avatar
    Join Date
    Jul 2012
    Location
    Spain
    Posts
    116
    Thanks
    93
    Thanked 69 Times in 35 Posts
    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:

    PHP Code:
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •