Frictional Games Forum (read-only)
Attaching ladder pieces together - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Attaching ladder pieces together (/thread-21132.html)



Attaching ladder pieces together - serbusfish - 04-11-2013

I was wondering how do you go about creating a ladder that needs an extra piece attaching before it becomes functional?


RE: Attaching ladder pieces together - PutraenusAlivius - 04-11-2013

You need to have a ladder area in active, use AUIC for attaching ladder, SEA for activating it, SPLA for looking.


RE: Attaching ladder pieces together - serbusfish - 04-11-2013

(04-11-2013, 03:45 PM)JustAnotherPlayer Wrote: You need to have a ladder area in active, use AUIC for attaching ladder, SEA for activating it, SPLA for looking.


Ok, first of all SEA is Set Entity Active, SPLA is Start player look at, but what is AUIC?

Second, how do you make it so a piece of the ladder is added to the inventory? (you can do that right?)


RE: Attaching ladder pieces together - NaxEla - 04-11-2013

(04-11-2013, 06:30 PM)serbusfish Wrote:
(04-11-2013, 03:45 PM)JustAnotherPlayer Wrote: You need to have a ladder area in active, use AUIC for attaching ladder, SEA for activating it, SPLA for looking.


Ok, first of all SEA is Set Entity Active, SPLA is Start player look at, but what is AUIC?

Second, how do you make it so a piece of the ladder is added to the inventory? (you can do that right?)

There's a ladder item (that you can pick up and it goes in your inventory) in entities/ptest.


RE: Attaching ladder pieces together - serbusfish - 04-11-2013

(04-11-2013, 06:43 PM)NaxEla Wrote:
(04-11-2013, 06:30 PM)serbusfish Wrote:
(04-11-2013, 03:45 PM)JustAnotherPlayer Wrote: You need to have a ladder area in active, use AUIC for attaching ladder, SEA for activating it, SPLA for looking.


Ok, first of all SEA is Set Entity Active, SPLA is Start player look at, but what is AUIC?

Second, how do you make it so a piece of the ladder is added to the inventory? (you can do that right?)

There's a ladder item (that you can pick up and it goes in your inventory) in entities/ptest.

Found it, cheers.

EDIT:

Rather than make another thread I have another quick question, I have a lever that unlocks a door, however when I pull the level down to open the door when I let go it pops back up and re-locks the door, how do you stop this happening?


RE: Attaching ladder pieces together - NaxEla - 04-11-2013

I'm not sure what your script looks like (it would help if you posted it), but this should work fine:
PHP Code:
void OnStart()
{
    
SetEntityConnectionStateChangeCallback("lever_name""LeverStateChange");
}

void LeverStateChange(string &in asEntityint alState)
{
    if(
alState == -1) {
        
SetSwingDoorLocked("door_name"falsetrue);
    }

You might need to change -1 to 1 (I can't remember which value is down and which is up).


RE: Attaching ladder pieces together - PutraenusAlivius - 04-12-2013

For the lever thing,
PHP Code:
void OnStart()
{
SetEntityConnectionStateChangeCallback("LEVERNAME""DoorUnlockLever");
}

void DoorUnlockLever(string &in asEntityint alState)
{
if(
alState == -1)
{
SetSwingDoorLocked("DOORNAME"falsetrue);
}
if(
alState == 0)
{
SetSwingDoorLocked("DOORNAME"truetrue);
}

I think it's like that.

For the ladder thing, (if you still need help, if not, I'm just letting this to be here.)
PHP Code:
void OnStart()
{
AddUseItemCallback("""ITEMTOUSENAME""ENTITYFORUSENAME""LadderAttach"true);
}

void LadderAttach(string &in asItemstring &in asEntity)
{
SetEntityActive("LADDERAREANAME"true);
StartPlayerLookAt("ENTITYTOLOOKNAME"66"");
PlaySoundAtEntity("""05_attach_ladder.snt"0.1ffalse); 
AddTimer(""3.0f"StopPlrLookAt"); //Change the 3.0f to how long you want the player look at time to end. (In Seconds)
}

void StopPlrLookAt(string &in asTimer)
{
StopPlayerLookAt();