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
Script Help
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#2
RE: Script Help

Explain something to me.. Is the monster in the SAME room you are in when you try to open the door? or is he BEHIND the door you try to open?

And surprisingly, what you want to hapen is only about 3 lines of script long.

This will help you

void OnStart()
{
SetEntityPlayerInteractCallback("door", "MonsterActivate", true);
}

void MonsterActivate(string &in Entity)
{
SetEntityActive("Monster_1", true);
}

void OnEnter()
{
}

void OnLeave()
{
}

This is an example of what you want to happen. I'll explain.
"SetEntityPlayerInteractCallback" pretty much means you want something to happen when you interact with an entity, in this case, it's "door". "door" can be named anything you want as long as it matches up with the name of the entity in the HPL editor.
"MonsterActivate" is the name of the callback function, which can also be named whatever you want, it just has to match up with the callback itself "void MonsterActivate"
"void MonsterActivate" is where you put all the commands you want to happen once you interact with said entity ("door") In this case, you want the monster to activate which is "SetEntityActive". And yeah. Does that help any?
07-12-2011, 07:17 PM
Find


Messages In This Thread
Script Help - by GreyFox - 07-12-2011, 05:13 PM
RE: Script Help - by Zypherzemus - 07-12-2011, 07:17 PM
RE: Script Help - by GreyFox - 07-12-2011, 07:26 PM
RE: Script Help - by Zypherzemus - 07-12-2011, 08:38 PM
RE: Script Help - by GreyFox - 07-12-2011, 09:02 PM
RE: Script Help - by Kyle - 07-12-2011, 09:05 PM
RE: Script Help - by GreyFox - 07-13-2011, 07:05 PM
RE: Script Help - by Zypherzemus - 07-13-2011, 08:02 PM
RE: Script Help - by GreyFox - 07-13-2011, 08:13 PM
RE: Script Help - by ferryadams11 - 07-13-2011, 08:24 PM
RE: Script Help - by GreyFox - 07-13-2011, 09:16 PM



Users browsing this thread: 1 Guest(s)