User Tools

Site Tools


Sidebar

hpl2:tutorials:script:slight_oil_recovery

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:

void OilRecovery ( string &in asTimer ) 
{       
        if ( GetLanternActive() == false ) { AddPlayerLampOil( 0.25 ); }
        AddTimer ( "", 5, "OilRecovery" ); 
}

Then, add this line inside your OnStart() function

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

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.txt · Last modified: 2013/07/26 23:04 by amn