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
Game Logic Question and Script Help
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#1
Game Logic Question and Script Help

After a monster has gone through all of it's pathnodes, will it disappear automatically?

And you'll be glad to know I'm this close |--| to completing the forth level (: Just gotta add little decor. tweaks like decals, furnature and storage decorations for that extra spice (;

Also, what's wrong with this script?

Spoiler below!

void OnStart()
{
SetEntityPlayerInteractCallback("ScareDoor_1", "ScareDoorScript", true);
AddUseItemCallback("ToTheNextLevelDoor_1", "ToTheNextLevelDoorKey_1", "UsedKeyOnDoor", true);
SetEntityPlayerInteractCallback("BooDoor_1", "BooSpawn", true);
}

void OnEnter()
{
}

void OnLeave()
{
}

void ScareDoorScript(string &in asEntity)
{
AddPropImpulse("ScareDoor_1", 0, 0, 5, "World");
    PlaySoundAtEntity("", "21_bang_door.snt", "ScareDoor_1", 0, false);
    PlaySoundAtEntity("", "21_intro_scream.snt", ScareDoor_1", 0, false);
SetSwingDoorLocked("SacreDoor_1", false, true);
}

void BooSpawn(string &in asEntity)
{
SetEntityActive("MrBoo_1", true);
    AddEnemyPatrolNode("MrBoo_1", "Node_1", 1, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_2", 1, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_3", 1, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_4", 2, "");
    AddEnemyPatrolNode("MrBoo_1", "Node_5", 2, "");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("ToTheNextLevelDoor_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", 0, false);
}


"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
(This post was last modified: 08-01-2011, 08:39 PM by ObsidianLegion.)
08-01-2011, 08:28 PM
Find
Kyle Offline
Posting Freak

Posts: 911
Threads: 36
Joined: Sep 2010
Reputation: 7
#2
RE: Game Logic Question and Script Help

Is there an error report for your script? Is there any specific part of your script that doesn't work?

The monster will disappear once it's out of the player's sight when it goes through all it's path nodes and waited the necessary time.

08-01-2011, 08:52 PM
Find
ObsidianLegion Offline
Member

Posts: 173
Threads: 53
Joined: Jun 2011
Reputation: 0
#3
RE: Game Logic Question and Script Help

(08-01-2011, 08:52 PM)Kyle Wrote: Is there an error report for your script? Is there any specific part of your script that doesn't work?

The monster will disappear once it's out of the player's sight when it goes through all it's path nodes and waited the necessary time.


38, 2: Unexpected End Of File

EDIT: Basically the ending line of the .hps

"Good men mean well; they just don't always end up doing well." -Isaac Clarke, Dead Space 2, Chapter 12
(This post was last modified: 08-01-2011, 08:59 PM by ObsidianLegion.)
08-01-2011, 08:56 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Game Logic Question and Script Help

void ScareDoorScript(string &in asEntity)
{
AddPropImpulse("ScareDoor_1", 0, 0, 5, "World");
    PlaySoundAtEntity("", "21_bang_door.snt", "ScareDoor_1", 0, false);
    PlaySoundAtEntity("", "21_intro_scream.snt", ScareDoor_1", 0, false);
SetSwingDoorLocked("SacreDoor_1", false, true);
}
You missed a quotation mark on the second PlaySoundAtEntity.

Tutorials: From Noob to Pro
08-01-2011, 09:25 PM
Website Find
Angerpull Offline
Member

Posts: 88
Threads: 24
Joined: Jun 2011
Reputation: 0
#5
RE: Game Logic Question and Script Help

When I set an enemy for patrol, it doesn't disappear. I've never had them do that at the end of their nodes. When let's say my Grunt walks through a node path, comes to the end and stops. Mine repeats the same pathnode patrol by going to the first node again.
08-02-2011, 01:10 AM
Find




Users browsing this thread: 1 Guest(s)