• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Setting HintString on Triggers
#1
Okay so I have this box that I spawn and thread that box with a function that spawns a trigger inside it and then it tries to do SetCursorHint and SetHintString. Both, seem to fail....
Video:

Code:
PerkBoxFunction(pos, angle, powerIsRequired, cashAmountRequired, nameofItem, perkVariable, perkName, perkHudColor)
{
    level endon("game_ended");
    
    self.trigger = Spawn( "trigger_radius", self.origin, 0, 50, 72 );

    self.trigger SetCursorHint( "HINT_NOCION" );
    self.trigger SetHintString( "REQUIRE ELECTRCITY" );
    IPrintLn("SET THE PERK BOX STRING DEFAULT");
    level waittill("power_activated");
    IPrintLn("POWER ON");
    
    switch( nameofItem )
    {
        case "Quick Revive Pro":
            self.trigger SetHintString( &"AIZ_PERK_REVIVE_PRO" );
            break;
        case "Speed Reload":
            self.trigger SetHintString( &"AIZ_PERK_RELOAD" );
            break;
        case "Juggernaut":
            self.trigger SetHintString( &"AIZ_PERK_HEALTH" );
            break;
        case "Stamin Up":
            self.trigger SetHintString( &"AIZ_PERK_CONDITIONING" );
            break;
        case "Double Tap 2.0":
            self.trigger SetHintString( &"AIZ_PERK_DOUBLETAP" );`
            break;
        case "Stalker":
            self.trigger SetHintString( &"AIZ_PERK_STALKER" );
            break;
    }
    IPrintLn("Box: " + nameofItem);
    IPrintLn("Origin: " + self.trigger.origin);
    for(;;)
    {
        self.trigger waittill( "trigger", player );
        IPrintLn("HI PLAYER");
        team = player.team;
        if( team == "allies" )
            isAllies = true;
        else
            isAllies = false;
            

        if( isAllies && player UseButtonPressed() )
        {
            if( player.money >= cashAmountRequired)
            {
                if( perkVariable == 0 )
                {
                    player.money -= cashAmountRequired;
                    player notify("MONEY");
                    player thread maps\mp\gametypes\_rank::scorePopup( 0-cashAmountRequired, 0, (1,0,0), 1 );
                    player thread AImod\_Mod::TextPopup( nameofItem + "!" );
                    perkVariable = 1;
                    
                    if(nameofItem == "Quick Revive Pro")
                        player.autorevive = 1;
                    if(nameofItem == "Speed Reload")
                    {
                        player _setPerk("specialty_fastreload");
                        player _setPerk("specialty_quickdraw");
                    }
                    if(nameofItem == "Juggernaut")
                        player.maxhealth = 200;
                    if(nameofItem == "Stamin Up")
                    {
                        player _setPerk("specialty_marathon");
                        player _setPerk("specialty_lightweight");
                        player _setPerk("specialty_fastsprintrecovery");
                    }
                    if(nameofItem == "Double Tap 2.0")
                        player.stoppingpower = 1;
                    if(nameofItem =="Stalker")
                    {
                        player thread SetStalker();
                        player.stalker = 1;
                    }
                    player.zombieperks += 1;
                    wait 0.1;
                    player thread PerkHud( perkName, perkHudColor, nameofItem );
                    wait 1;    
                }
                else
                {
                    player iPrintln("^1You have already bought " + nameofItem + "!");
                    wait 1;
                }                        
            }
            else
            {
                player iPrintln("^1Not enough cash for " + nameofItem + ".  [COST: ^2$^3" + cashAmountRequired + "^7]");
                wait 1;
            }

        }
        wait 0.05;
    }
}

PerkBoxFunction is called from SpawnBoxes i.e.: block thread PerkBoxFunction(pos, angle, powerIsRequired, cashAmountRequired, nameofItem, perkVariable, perkName, perkHudColor);
SpawnBoxes is called like so:
SpawnBoxes("com_plasticcase_friendly", (2959,4763,203),(0,0,-50), (0,90,0), true, true, 16, "Juggernaut", "perkBox", true, 2500, player.juggernaut, "cardicon_juggernaut_2", (1,0.3,0.3), "Your Body Becomes Impenetrable");
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#2
Try adding this line:

Code:
self.trigger = Spawn( "trigger_radius", self.origin, 0, 50, 72 );
self.trigger useTriggerRequireLookAt(); //THIS
self.trigger SetCursorHint( "HINT_NOCION" );
self.trigger SetHintString( "REQUIRE ELECTRICITY" ); //FIXED TEXT FOR YOU

Ill wait for video Cool
  Reply
#3
(09-07-2014, 20:50)Yamato Wrote: Try adding this line:

Code:
self.trigger = Spawn( "trigger_radius", self.origin, 0, 50, 72 );
self.trigger useTriggerRequireLookAt(); //THIS
self.trigger SetCursorHint( "HINT_NOCION" );
self.trigger SetHintString( "REQUIRE ELECTRICITY" ); //FIXED TEXT FOR YOU

Ill wait for video Cool
Added video, let me try that.

Nope same thing :c
Also the cursorhint should have been NOICON derp :p
(but still doesn't work).
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#4
What dvars are you using at your mod?
  Reply
#5
(09-07-2014, 21:19)Yamato Wrote: What dvars are you using at your mod?
What kind of dvars you talking about? There's a lot of dvars set/modified.
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#6
(09-07-2014, 21:24)DidUknowiPwn Wrote:
(09-07-2014, 21:19)Yamato Wrote: What dvars are you using at your mod?
What kind of dvars you talking about? There's a lot of dvars set/modified.

Forget about it, I just found this thing on an old mod I made, I guess it worked:

I aplied the commands to the box instead of to the trigger
  Reply
#7
I could go about redoing the entire mapedit system but that'll take way too long. I can send all the GSC's when you're back on steam later.
Edit: I tried applying to the box itself didn't work either.
Edit2: Copied your little box function and put that on onPlayerSpawned and got no hintStrings o.o
[Image: 4f41a46f5c.jpg]
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#8
(09-07-2014, 22:45)DidUknowiPwn Wrote: I could go about redoing the entire mapedit system but that'll take way too long. I can send all the GSC's when you're back on steam later.
Edit: I tried applying to the box itself didn't work either.
Edit2: Copied your little box function and put that on onPlayerSpawned and got no hintStrings o.o
[Image: 4f41a46f5c.jpg]

Until tomorrow I wont connect, without hardcore mode does it work? :S
  Reply
#9
Actually that might actually be it let me give it a shot.
Holy shit it worked!
[Image: 9d9bcedf2f.jpg]
I love you Yama <3333
Do not take life too seriously. You will never get out of it alive.
[Image: UGPjFJa.jpg]
  Reply
#10
(09-08-2014, 00:21)DidUknowiPwn Wrote: Actually that might actually be it let me give it a shot.
Holy shit it worked!
I love you Yama <3333

Enjoy your fucked up hud Troll
  Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)