Frictional Games Forum (read-only)
Whats script areas problem? (ladder isue) - 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: Whats script areas problem? (ladder isue) (/thread-40413.html)



Whats script areas problem? (ladder isue) - sabrinagsoledad - 02-25-2016

Hi.
I wrote this to make the ladder item (the one that u pick up) to interact with an Area (LadderArea) to make appear the static item lader (LadderJoint). But for some reason... i cant make the item interacts with the area... its like the area wasnt there for interact.

(info for the script below; "LladerItem" the pickup ladder / "LadderArea" its an Area where the pickup ladder will interact / and LadderJoint and ClimbArea is the two items that will apear to let me go up.
Dont know whats my mistake.
I make the Area where the ladder interacts TO huge to make it sure to find it yet nothing... or that makes it even worst?

void OnStart()
{
AddEntityCollideCallback ("LadderItem", "LadderArea", "PutLadderToClimb", true, 1);
}

void PutLadderToClimb (string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "05_attach_ladder.snt", "LadderArea", 0, false);
RemoveItem("LadderItem");
SetEntityActive("LadderJoint", true);
SetEntityActive("ClimbArea", true);
}


RE: Whats script areas problem? (ladder isue) - Spelos - 02-25-2016

First of all you should make sure that Interaction is enabled on the area:
[Image: rqRK3oA.png]

If the ladder is an inventory item, you can't use Entity Collide Callbacks, use this instead:

PHP Code:
void OnStart()

    
AddUseItemCallback("""LadderItem""LadderArea""PutLadderToClimb"true);
}

void PutLadderToClimb (string &in asItemstring &in asEntity)

    
PlaySoundAtEntity("""05_attach_ladder.snt""LadderArea"0false);
    
RemoveItem("LadderItem");
    
SetEntityActive("LadderJoint"true);
    
SetEntityActive("ClimbArea"true);




RE: Whats script areas problem? (ladder isue) - sabrinagsoledad - 02-25-2016

Hi. Thank you.

I tought that if an entity gets in touch with a script area I needed to use the Entity CollideCallbacks...


RE: Whats script areas problem? (ladder isue) - Mudbill - 02-25-2016

That is correct; an entity colliding with a script area DOES use AddEntityCollideCallback. But INVENTORY items do not collide, they are interacted with upon something else (used with).


RE: Whats script areas problem? (ladder isue) - Darkfire - 02-26-2016

If you still have problems, make the script area bigger than the ladder area and remove it after you've activated the ladder area.