User Tools

Site Tools


Sidebar

hpl2:tutorials:script:slight_oil_recovery

This is a feature i did for my custom story
to help the player continue.

Create the following function in your script file:

 
<code php>
void OilRecovery ( string &in asTimer ) 
{
        if ( GetLanternActive() == false ) { 
        AddPlayerLampOil( 0.25 ); }

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

</code>

Then, add this line inside your OnStart() function

 
<code php>
AddTimer ( "", 5, "OilRecovery" );

</code>

When the map starts, it triggers a timer that every 5 seconds recovers 0.25 oil if the player is not using his lantern.
Increase the number if you think 0.25 is too low.

Amn.-

hpl2/tutorials/script/slight_oil_recovery.1373321636.txt.gz · Last modified: 2013/07/08 22:13 by amn