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
How do you make a ladder go down by pulling a lever?
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#1
How do you make a ladder go down by pulling a lever?

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

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
(This post was last modified: 02-28-2014, 05:46 PM by Radical Batz.)
02-28-2014, 05:36 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#2
RE: How do you make a ladder go down by pulling a lever?

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.

(This post was last modified: 02-28-2014, 05:52 PM by Mudbill.)
02-28-2014, 05:51 PM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#3
RE: How do you make a ladder go down by pulling a lever?

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
(This post was last modified: 03-01-2014, 02:01 PM by Radical Batz.)
03-01-2014, 02:01 PM
Find
Traggey Offline
is mildly amused

Posts: 3,257
Threads: 74
Joined: Feb 2012
Reputation: 185
#4
RE: How do you make a ladder go down by pulling a lever?

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!
03-01-2014, 04:12 PM
Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#5
RE: How do you make a ladder go down by pulling a lever?

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 post was last modified: 03-01-2014, 04:33 PM by Radical Batz.)
03-01-2014, 04:33 PM
Find
7heDubz Offline
Posting Freak

Posts: 1,329
Threads: 40
Joined: Feb 2013
Reputation: 41
#6
RE: How do you make a ladder go down by pulling a lever?

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, 05:37 PM
Find
Slanderous Offline
Posting Freak

Posts: 1,606
Threads: 78
Joined: Dec 2012
Reputation: 63
#7
RE: How do you make a ladder go down by pulling a lever?

(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.
03-01-2014, 07:35 PM
Find




Users browsing this thread: 2 Guest(s)