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
Level Help
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: Level Help

(03-14-2011, 05:31 AM)SampleFriend Wrote: I'm new to this editor, I've used other editors in the past like Source SDK.
Just the scripting is a little confusing, I need to know how to create an event when I pick up a key and a monster spawns outside the room, smashes the door and after about 30 seconds walks off and de-spawns.

Any help is appreciated

Thanks Big Grin

Well, the only thing is, there are a lot of variables when it comes to scripting. But I'll give you an example to work off of.

OnStart()
{
//Key_01, the name of the key entity.
SetEntityPlayerInteractCallback("key_01", "spawn_monster", true);
//Add an Area Script with the name Area_1, just in front of the door the player enters.
AddEntityCollideCallback("Player", "Area_1", "close_door", true, 1);
}

void spawn_monster(string &in asEntity)
{
//monster_1, name of the monster entity.
SetEntityActive("monster_1", true);

//Add a path node inside the room, name it node_1
AddEnemyPatrolNode("monster_1", "node_1", 30.0f, "");
//Add a path node outside the room, name it node_2
AddEnemyPatrolNode("monster_1", "node_2", 0.0f, "");
//Add a area script outside the room, with node_2 inside of it
AddEntityCollideCallback("monster_1", "Area_2", "despawn_monster", true, 1);
}

void close_door(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorLocked("door_1", true, true);
}

void despawn_monster(string &in asEntity)
{
SetEntityActive("monster_1", false);
}

If you like, I can go into detail of the script. You'll have to go back and change the names of the entities in your map for this to work. As I said, VARIABLES

Also, check this out.
http://wiki.frictionalgames.com/hpl2/amn..._functions
(This post was last modified: 03-14-2011, 06:27 AM by Russ Money.)
03-14-2011, 05:51 AM
Find


Messages In This Thread
Level Help - by SampleFriend - 03-14-2011, 05:31 AM
RE: Level Help - by Russ Money - 03-14-2011, 05:51 AM
RE: Level Help - by SampleFriend - 03-14-2011, 05:57 AM
RE: Level Help - by Russ Money - 03-14-2011, 06:27 AM
RE: Level Help - by SampleFriend - 03-14-2011, 06:31 AM
RE: Level Help - by Russ Money - 03-14-2011, 07:16 AM
RE: Level Help - by SampleFriend - 03-14-2011, 08:02 AM
RE: Level Help - by Russ Money - 03-14-2011, 08:17 AM
RE: Level Help - by SampleFriend - 03-14-2011, 08:27 AM
RE: Level Help - by Russ Money - 03-14-2011, 08:31 AM
RE: Level Help - by SampleFriend - 03-14-2011, 08:46 AM
RE: Level Help - by Russ Money - 03-14-2011, 09:38 AM
RE: Level Help - by SampleFriend - 03-14-2011, 09:57 AM



Users browsing this thread: 1 Guest(s)