Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] - Area Collide Script Activation
Author Message
Rokotain Offline
Member

Posts: 54
Joined: Jul 2011
Reputation: 0
Post: #1
[Solved] - Area Collide Script Activation

Hello Forum People! Smile

I'm quite new to scripting and don't understand 100% of Frictional Games's Scripting Tutorial. Blush

Basically what I want is that whenever the player walks into "Area1" he activates "Area2" which then activates "servant_grunt_1".

"Area1" is enabled at start of map.
"Area2" is disabled at start of map until "Area1" activates the script.

I need help with what to write in the script, something like PlayerCollide(Callback?).


What I currently have, is PlayerLookAtCallback, which causes the grunt to spawn whenever I look at the 2 areas I have specified :/

And there is no CollideCallback in the Script-Area Entity Tabs, only LookAtCallback & InteractCallback.

In this case, would colliding with the area count as an InteractCallback?

Also, I'm Norwegian so please excuse if there are any typos. Angel

Thanks for reading xD!
-Rokotain

*EDIT - I found the soultion in another help thread c:
Thanks anyways!

Still feel free to post answers here as it will help other players find the solution C:!
(This post was last modified: 07-20-2011 08:31 PM by Rokotain.)
07-20-2011 08:07 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Joined: Mar 2009
Reputation: 67
Post: #2
RE: [Solved] - Area Collide Script Activation

You should write in scripting file because the entity that collides and being collided are two different entities and you cannot specify two of them at the same time in level editor.

List of available functions are here: http://wiki.frictionalgames.com/hpl2/amn..._functions
And this page has lots of user made tutorials: http://wiki.frictionalgames.com/hpl2/tutorials/start

07-20-2011 11:37 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Rokotain Offline
Member

Posts: 54
Joined: Jul 2011
Reputation: 0
Post: #3
RE: [Solved] - Area Collide Script Activation

Thank you for the helpful links Smile !

I'm becomming more adept to this with time.
Such as now, I have this:

void OnStart()
{
AddEntityCollideCallback("Player", "AreaActivateLookGrunt", "ActivateLookGrunt", true, 1);
}


void ActivateLookGrunt(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("AreaLookGrunt", true);
AddEntityCollideCallback("Player", "AreaLookGrunt", "LookAtGrunt", true, 1);
}

void LookAtGrunt(string &in asParent, string &in asChild, int alState)
{
    SetEntityActive("ghostgrunt", true);
}

It works very well and this is what I was looking for.
I posted it here in case someone else needing help for this^^

Thanks again Angel
07-21-2011 05:27 PM
Find all posts by this user Quote this message in a reply
Tanshaydar Offline
From Beyond

Posts: 3,085
Joined: Mar 2009
Reputation: 67
Post: #4
RE: [Solved] - Area Collide Script Activation

Glad you got it working!
Good luck!

07-21-2011 05:38 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)