Frictional Games Forum (read-only)

Full Version: How do you make a ladder go down by pulling a lever?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I can't find a way to make a ladder go down by pulling a lever, I give up! all! don't send me links to engine scripts, I already checked there and couldn't find on how to make the ladder go down by pulling the lever! I want it to be just like in Justine, but when you pull the lever the ladder goes down alone, not something else to happen! I really want to know what's the code to that but this is what I found in the Justine code

Code:
void RollDownLadder()
{    
    if(GetLocalVarInt("ManualLadderPlaced") == 1) return;    // Manual ladder attached, so do not roll down this ladder.

    RotatePropToSpeed("cogwheel_tiny03_1", 1, 1, 0, 0, 1, false, "");
    RotatePropToSpeed("cogwheel_tiny03_2", 1, 1, 0, 0, -1, false, "");
    
    for(int i=1;i<5;i++)
        SetMoveObjectState("ladder4m_tileable_"+i, -1.12);
        
    AddTimer("stoproll", 9.0f, "TimerStopRoll");
    
    PlaySoundAtEntity("laddermove", "L01_ladder_move", "AreaLadderSounds", 1.0, false);
    PlaySoundAtEntity("laddermove2", "L01_ladder_move02", "AreaLadderSounds", 1.0, false);
    PlaySoundAtEntity("beingmove", "L01_ladder", "AreaLadderSounds", 0.0, false);
}

void TimerStopRoll(string &in asTimer)
{
    RotatePropToSpeed("cogwheel_tiny03_1", 0.5f, 0.5f, 0, 0, 0, false, "");
    RotatePropToSpeed("cogwheel_tiny03_2", 0.5f, 0.5f, 0, 0, 0, false, "");
    
    SetEntityActive("LadderArea_1", true);
    
    StopSound("laddermove", 0.5f);
    StopSound("laddermove2", 0.5f);
    
    PlaySoundAtEntity("stopmove", "L01_ladder", "AreaLadderSounds", 0.0, false);
}

the code confuses me a little bit, I don't know why because I don't know what I'm supposed to do in the level editor and the script at the same time! can you guys pls help :/

Can someone give me the whole code: example give me the code with everything blank, and I will fill everything myself, like the names and the functions and stuff! yeah pretty pls
The ladder you want to move down is a MoveObject. Therefore you use the SetMoveObjectState script. It will make the ladde move in the set axis (Y in this entity's case). It's quite simple, really.

Firstly make sure you're using the correct ladder entity. If it has the AngularOffsetArea box at the bottom of the entity tab, then you know it's a MoveObject. After that just call the script when you want the ladder to move.
But what's the ode to make a static ladder turn into a tileable ladder and go down when pulling a lever?

If you want you can give me the whole code for that, and I will fill the names, timers, functions and etc

pretty pls!!!, Sad
Are you even trying to make your custom story yourself? I mean, sorry for sounding like a douchebag but you're creating tons of these threads where people just give you code, try using the Wiki and learning the development process yourself mate!
well yes, But I seriously tried going on the wiki, really. But the problem is that i don't exactly know what's the code for it, that's the problem!Undecided But I am going to credit everyone for helping me on this forum of course.

But how am I going to know which code I'm going to use for the ladder and lever? Huh
make the ladder one that the player can manipulate. Make it through script one that a player can not touch, but where physics still apply to it, and set it inactive.

After they pull the lever activate it.
(03-01-2014, 04:33 PM)Badcat5550 Wrote: [ -> ]well yes, But I seriously tried going on the wiki, really. But the problem is that i don't exactly know what's the code for it, that's the problem!Undecided But I am going to credit everyone for helping me on this forum of course.

But how am I going to know which code I'm going to use for the ladder and lever? Huh

This.

http://www.youtube.com/user/MrMudbill/vi...&flow=grid

As far as I can see, this guy is pasting every script in the description, and he also posts some things on the forum sometimes. He has some tutorials explaining the things that you've asked for earlier.