02-28-2014, 05:36 PM
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
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
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