The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Monster script
giacomo9 Offline
Junior Member

Posts: 37
Threads: 11
Joined: Nov 2012
Reputation: 0
#1
Monster script

I've got a situation: on floor lays a key. When player pick up this key, a monster appears behind the closed door. What script I must use (and where put it), when I want to monster break the door after spawn and chase the player? Here's a full script of my custom story (bold scripts is the "monster" and "pick up a key" scripts, of course) Btw. sorry for mistakes, my English is not very good I think Big Grin

////////////////////////////
// Run when starting map
void OnStart()
{
AddUseItemCallback("", "basementkey_1", "basement_1", "KeyOnDoor", true);
AddEntityCollideCallback("Player", "tp_1", "DeadOne", true, 1);
AddEntityCollideCallback("Player", "tp_2", "ColinBody", true, 1);
SetEntityCallbackFunc("corridorkey", "OnPickup");
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("basement_1", false, true);
PlaySoundAtEntity("", "unlock_door", "basement_1", 0, false);
}




void DeadOne(string &in asParent, string &in asChild, int alStates)
{
SetEntityActive("GhostOne", true);
AddPropForce("GhostOne", 0, 0, -100000, "world");
PlaySoundAtEntity("", "24_iron_maiden.snt", "GhostOne", 0, false);
}




void ColinBody(string&in asParent, string &in asChild, int alStates)
{
SetEntityActive("ColinBody", true);
AddPropForce("ColinBody", 0, 0, 1000000, "world");
PlaySoundAtEntity("", "24_burn.snt", "ColinBody", 0, false);
}




void OnPickup(string &in asEntity, string &in type)
{
SetEntityActive("stevie_1", true);
}
11-19-2012, 10:46 PM
Find


Messages In This Thread
Monster script - by giacomo9 - 11-19-2012, 10:46 PM
RE: Monster script - by Rowzter - 11-19-2012, 10:59 PM
RE: Monster script - by giacomo9 - 11-19-2012, 11:13 PM
RE: Monster script - by Rowzter - 11-19-2012, 11:20 PM
RE: Monster script - by liquiddr3amz - 11-23-2012, 08:16 AM
RE: Monster script - by The chaser - 11-23-2012, 08:52 AM
RE: Monster script - by liquiddr3amz - 11-23-2012, 04:33 PM
RE: Monster script - by FlawlessHappiness - 11-23-2012, 05:27 PM
RE: Monster script - by liquiddr3amz - 11-23-2012, 05:38 PM
RE: Monster script - by The chaser - 11-23-2012, 05:57 PM
RE: Monster script - by liquiddr3amz - 11-24-2012, 03:18 AM
RE: Monster script - by The chaser - 11-24-2012, 12:03 PM
RE: Monster script - by FlawlessHappiness - 11-24-2012, 09:05 AM



Users browsing this thread: 1 Guest(s)