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
Whats script areas problem? (ladder isue)
sabrinagsoledad Offline
Junior Member

Posts: 32
Threads: 10
Joined: Feb 2016
Reputation: 0
#1
Whats script areas problem? (ladder isue)

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);
}
02-25-2016, 03:03 AM
Find
Spelos Away
Banned

Posts: 231
Threads: 19
Joined: Sep 2014
#2
RE: Whats script areas problem? (ladder isue)

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: (Select All)
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);

02-25-2016, 07:52 AM
Find
sabrinagsoledad Offline
Junior Member

Posts: 32
Threads: 10
Joined: Feb 2016
Reputation: 0
#3
RE: Whats script areas problem? (ladder isue)

Hi. Thank you.

I tought that if an entity gets in touch with a script area I needed to use the Entity CollideCallbacks...
02-25-2016, 02:57 PM
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Whats script areas problem? (ladder isue)

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).

02-25-2016, 03:39 PM
Find
Darkfire Offline
Senior Member

Posts: 371
Threads: 22
Joined: May 2014
Reputation: 15
#5
RE: Whats script areas problem? (ladder isue)

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

02-26-2016, 11:15 PM
Find




Users browsing this thread: 1 Guest(s)