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
Using the PlayerInteractCallBack func
Rickvs Offline
Junior Member

Posts: 2
Threads: 1
Joined: Feb 2013
Reputation: 0
#1
Question  Using the PlayerInteractCallBack func

Hello guys, my name is Rick and I'm a complete noob when it comes to scripting, therefore help would be highly appreciated.

Situation I have in mind:
The player walks to a (locked) door, interacts with it, and suddenly a hallucinated monster appears behind him.

What I've got so far:
The player can interact with the door, the locked sound plays and obviously the door doesn't open, but nothing else happens...

Problem:
In the level editor, I clicked on the door and set the PlayerInteractCallBack tag to MonsterAppears.
In (mapname).hps I have this, copied from the wiki:

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


And of course the enter, leave, and startup fuctions.

This doesn't work. You might me thinking I'm seriously stupid if you see the problem, but I honestly can't find it. Do I need to add more code?
(This post was last modified: 02-16-2013, 07:12 PM by Rickvs.)
02-16-2013, 06:52 PM
Find
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#2
RE: Using the PlayerInteractCallBack func

Change:
PHP Code: (Select All)
void MonsterAppears(string &in asParentstring &in asChildint alState

To:
PHP Code: (Select All)
void MonsterAppears(string &in asEntity

In Ruins [WIP]
02-16-2013, 06:55 PM
Find
Rickvs Offline
Junior Member

Posts: 2
Threads: 1
Joined: Feb 2013
Reputation: 0
#3
RE: Using the PlayerInteractCallBack func

(02-16-2013, 06:55 PM)NaxEla Wrote: Change:
PHP Code: (Select All)
void MonsterAppears(string &in asParentstring &in asChildint alState

To:
PHP Code: (Select All)
void MonsterAppears(string &in asEntity
THANK YOU! Ooh, I can't believe it was that small... You made my day!
02-16-2013, 07:03 PM
Find




Users browsing this thread: 1 Guest(s)