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
Multiple Issues Help Setting up the elevator machine
serbusfish Offline
Member

Posts: 211
Threads: 75
Joined: Aug 2012
Reputation: 0
#19
RE: Setting up the elevator machine

(05-09-2013, 02:27 PM)JustAnotherPlayer Wrote: It's
PHP Code: (Select All)
if(alState == 1//1 up, -1 down, 0 between
{


But how do I tell it which lever should be at that state? As it stands it is checking the 'LocalVarInt' for Wheels and Coal, there is no lever currently defined.

Here is the actual code I have (its from frictionals script and is placed before the onstart bit, its a bit strange but it works):

void StartMachine(string sEntity)
{
    PlaySoundAtEntity("s1"+sEntity, "13_ignite", sEntity, 0.2f, false);
    PlaySoundAtEntity("s2"+sEntity, "13_machine_fail", sEntity, 0.2f, false);

    if(GetLocalVarInt("WheelOK") == 3 && GetLocalVarInt("Coal") == 3)
    {
        for(int i=1;i<=6;i++){
            CreateParticleSystemAtEntity("DoneP"+i, "ps_steam.ps", "DoneParticles_"+i, true);
            PlaySoundAtEntity("DoneS"+i, "13_steam", "DoneParticles_"+i, 0.5, true);
        }
        for(int i=1;i<=8;i++)
            CreateParticleSystemAtEntity("SteamP"+i, "ps_steam_cloud.ps", "SteamCloud_"+i, true);
        
        SetGlobalVarInt("ElevatorMachineRunning", 1);
        
        
        
        StartScreenShake(0.03f, 2.0f, 0.5f,1.5f);
        
        PlaySoundAtEntity("s3"+sEntity, "13_machine_run", sEntity, 2, true);
        PlaySoundAtEntity("s31"+sEntity, "13_machine_extra", sEntity, 2, true);
        PlaySoundAtEntity("s4"+sEntity, "13_whomp", sEntity, 4, true);
        
        PlayMusic("13_puzzle_machine.ogg", false, 1.0f, 0.5f, 10, false);
        
        GiveSanityBoost();
        
        RunWheels(1.0f,-1.0f);
        
        SetLeverStuckState(sEntity, 1, false);
    }
    else
    {
        StartScreenShake(0.01f, 1.0f, 0.25,0.5f);

        AddTimer("stopwheels", 1, "TimerMachineError");
        
        RunWheels(1.0f,-1.0f);

(This post was last modified: 05-09-2013, 02:52 PM by serbusfish.)
05-09-2013, 02:52 PM
Find


Messages In This Thread
Setting up the elevator machine - by serbusfish - 05-07-2013, 01:30 AM
RE: Setting up the elevator machine - by Rapture - 05-07-2013, 03:09 AM
RE: Setting up the elevator machine - by serbusfish - 05-09-2013, 02:52 PM



Users browsing this thread: 1 Guest(s)