You received a phone call. A phone call that could possibly change your life forever. The last chance, to save a life.

Post tutorial Report RSS Slight Oil Recovery

This tutorial will help teach you how to regain oil when your lantern is inactive.

Posted by on - Basic Client Side Coding

This tutorial is pretty easy.
Here is the basic script:

Under the OnStart, add this timer:
AddTimer ( "", 5, "OilRecovery" );

void OilRecovery ( string &in asTimer )

{
if (GetLanternActive() == false);
{
AddPlayerLampOil (0.25);
}

AddTimer("", 5, "OilRecovery");
}

When you start the map, the OnStart will activate, meaning the timer will activate. When it activated, it will trigger that every 5 seconds of inactive use for the lantern, it will regain 0.25% of oil. However, you can change the numbers to anything you want.

If you changed the 0.25 to 50 and change the time of 5 seconds to 2 seconds, than every 2 seconds, the lantern will regain 50% of oil.

In the end, this is NOT my own tutorial, but a cool little feature I saw at the Engine Scripts page. I just changed things around so its not exactly like the script. I increased the time slightly on my script with more oil. I have this set to one map. I don't know if you have to do this for multiple maps (I'll assume you do) or if it will work throughout all maps.

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: