Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Display message when player tries to use lantern
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#4
RE: Display message when player tries to use lantern

(05-27-2016, 10:39 AM)Slanderous Wrote:
PHP Code: (Select All)
    if(GetLanternActive())
            {
                
//do stuff
            


Should work.

I tried that but the game didnt like it and threw back errors, I probably did something wrong.

(05-27-2016, 12:47 PM)Mudbill Wrote: How is your code?

It might be possible but I wouldn't recommend it: You could use a looping timer to check the lantern state and force it off though I don't expect it to be any better than that callback. That's why it's there anyway.

I simply put a script area over the map start position so when they spawn they hit it straight away:

Quote:AddEntityCollideCallback("Player", "ScriptArea_16", "LanternOff", true, 1);

void LanternOff(string &in asParent, string &in asChild, int alState)

{
SetLanternDisabled(true);

}

And then I have:

Quote:SetLanternLitCallback("NoUse");

void NoUse(bool abLit)



{
SetMessage("Messages", "NoLantern", 5);
}

I understand why it doesnt work, the lantern is is disabled so it cant light, I just need to figure a way around it.

05-27-2016, 03:58 PM
Find


Messages In This Thread
RE: Display message when player tries to use lantern - by serbusfish - 05-27-2016, 03:58 PM



Users browsing this thread: 1 Guest(s)