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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spawn monsters
tokugawa1 Offline
Junior Member

Posts: 37
Threads: 8
Joined: Aug 2012
Reputation: 0
#3
RE: Spawn monsters

(08-04-2012, 08:30 PM)Steve Wrote: easy one you just need some timers I don't really know how many seconds you want to have between the monster so I just make it 5 seconds.

void OnStart()
{
AddUseItemCallback("", "key_tomb_1", "mansion_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("key_tomb_1", "Spawn_Monster", true);
AddUseItemCallback("", "key_torture_chamber_1", "mansion_4", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("key_torture_chamber_1", "Spawn_Monster", true);
SetEntityPlayerInteractCallback("note_generic_3", "Spawn_Monster", true);
}


void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem("key_tomb_1");
SetSwingDoorLocked("mansion_4", false, true);
PlayGuiSound("unlock_door", 0.8f);
RemoveItem("key_torture_chamber_1");
}


void Spawn_Monster(string &in asEntity)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddTimer("timer01", 5.0f, "Secondmonster");
}


void Secondmonster(string& asTimer)
{
SetEntityActive("servant_brute_1", true);
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 1, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");
AddTimer("timer02", 5.0f, "Thirdmonster");
}

void Thirdmonster(string& asTimer)
{
SetEntityActive("servant_brute_2", true);
SetEntityActive("servant_brute_3", true);
SetEntityActive("servant_brute_4", true);
SetEntityActive("servant_grunt_2", true);
SetEntityActive("servant_grunt_3", true);
}


EDIT:
and it crashed because you had more { } than one in your void. Wink
aand also if you want:
SetEntityActive("servant_brute_2", true);
SetEntityActive("servant_brute_3", true);
SetEntityActive("servant_brute_4", true);
SetEntityActive("servant_grunt_2", true);
SetEntityActive("servant_grunt_3", true);
to have time between them make timers for them as well if you have any question ask me Big Grin
ok thx but i actually wanted to spawn the monsters when picking up something. when i pick up the first key the servant grunt_1 spawns, when i pick up the second key the servant_brute_1 spawns, and when i pick up the note_generic_3 the last monsters spawn :
SetEntityActive("servant_brute_2", true);
SetEntityActive("servant_brute_3", true);
SetEntityActive("servant_brute_4", true);
SetEntityActive("servant_grunt_2", true);
SetEntityActive("servant_grunt_3", true);
08-04-2012, 08:47 PM
Find


Messages In This Thread
Spawn monsters - by tokugawa1 - 08-04-2012, 08:26 PM
RE: Spawn monsters - by Steve - 08-04-2012, 08:30 PM
RE: Spawn monsters - by tokugawa1 - 08-04-2012, 08:47 PM
RE: Spawn monsters - by Steve - 08-04-2012, 09:06 PM
RE: Spawn monsters - by tokugawa1 - 08-04-2012, 09:22 PM
RE: Spawn monsters - by tokugawa1 - 08-04-2012, 09:50 PM
RE: Spawn monsters - by Steve - 08-04-2012, 09:34 PM
RE: Spawn monsters - by Steve - 08-05-2012, 05:00 PM
RE: Spawn monsters - by tokugawa1 - 08-05-2012, 07:45 PM
RE: Spawn monsters - by Steve - 08-05-2012, 07:46 PM



Users browsing this thread: 4 Guest(s)