The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Lantern Overheating (Intermediate)
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#1
Lantern Overheating (Intermediate)

Hey guys. I just made a Lantern Overheat script a while ago and decided to probably make it a little interesting so that each time you turned it on the overheating period will be longer.

SCRIPT:
Spoiler below!

PHP Code: (Select All)
void OnStart()
{
        
SetLocalVarFloat("OverheatLantern"0);
    
SetLocalVarInt("TimerDetect"0);
    
SetEntityCallbackFunc("ModLantern""DefineLanternOverheat");
    
AddTimer("mypenis"90.0f"Overheat");
}
///---LANTERN OVERHEAT SCRIPT---///
void DefineLanternOverheat(string &in asEntitystring &in type)
{
    if(
GetLanternActive() == true)
    {
    
AddLocalVarInt("TimerDetect"1);
    
AddTimer("TIMEROVERHEAT"60.0f"TimerLantern");
        
AddDebugMessage("I have one message for you."false);
    }

    else if(
GetLanternActive() == false)
    {
        if(
GetLocalVarInt("TimerDetect") == 1)
        {
            
RemoveTimer("TIMEROVERHEAT");
        }
    }
}

void TimerLantern(string &in asTimer)
{
    
AddLocalVarFloat("OverheatLantern"0.30f);
}

void Overheat(string &in asTimer)
{
    if(
GetLocalVarFloat("OverheatLantern") == 0.0f && GetLocalVarInt("TimerDetect") == 0)
    {
    
AddTimer(""120.0f"OverheatTimerStart");
    
SetLanternActive(falsetrue);
    
SetLanternDisabled(true);
    }
    
    else if(
GetLocalVarFloat("OverheatLantern") == 0.30f && GetLocalVarInt("TimerDetect") == 1)
    {
    
AddTimer(""150.0f"OverheatTimerStart");
    
SetLanternActive(falsetrue);
    
SetLanternDisabled(true);
    }

    else if(
GetLocalVarFloat("OverheatLantern") == 0.60f && GetLocalVarInt("TimerDetect") == 2)
    {
    
AddTimer(""180.0f"OverheatTimerStart");
    
SetLanternActive(falsetrue);
    
SetLanternDisabled(true);
    }

    else if(
GetLocalVarFloat("OverheatLantern") == 0.90f && GetLocalVarInt("TimerDetect") == 3)
    {
    
AddTimer(""210.0f"OverheatTimerStart");
    
SetLanternActive(falsetrue);
    
SetLanternDisabled(true);
    }
    
AddDebugMessage("...Dickbutt"false);
}

void OverheatTimerStart(string &in asTimer)
{
    
SetLanternDisabled(false);
}
///---LANTERN OVERHEAT SCRIPT---/// 


But if we see the workflow that means that when it's picked up, a callback will define what is overheating and then the script automatically starts a 90 second timer. And if I were to turn it on it'll add 0.30f to the LocalVarFloat. And it checks whether it's longer or not.

And this is where the problem started. It's more what have to do with workflow. I have a 90 second timer but the thing is that if in that timer I do not turn on the lantern then the script won't be useful.

So the question is that, What is the thing that I could do so that the Lantern script will be executed in that 90 second timer since turning it on is the up to the Player and the intro takes at least 90 - 120 seconds.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 03-22-2014, 05:33 AM by PutraenusAlivius.)
03-22-2014, 05:18 AM
Find


Messages In This Thread
Lantern Overheating (Intermediate) - by PutraenusAlivius - 03-22-2014, 05:18 AM
RE: Lantern Overheating (Intermediate) - by Wapez - 03-22-2014, 02:05 PM
RE: Lantern Overheating (Intermediate) - by Apfel - 03-23-2014, 04:03 PM



Users browsing this thread: 1 Guest(s)