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


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Two problems
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#11
RE: Two problems

(12-19-2012, 11:57 AM)beecake Wrote: Ah! It's because it's SetEnemyDisableTriggers
I don't get any errors now but the monsters keep chasing me even though I've enter the CollideArea so their chase music keeps playing Sad I wrote it like this

void OnStart()



{
AddEntityCollideCallback("Player", "SpawnMonsters", "SpawnFunction_1", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_2", "SpawnFunction_2", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_3", "SpawnFunction_3", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_4", "SpawnFunction_4", false, 1);
AddEntityCollideCallback("Player", "SpawnMonsters_5", "SpawnFunction_5", false, 1);
AddEntityCollideCallback("Player", "Start_Credits", "Main_Credits", false, 1);
AddEntityCollideCallback("Player", "DisableMonster", "Disable", true, 1);
}

void SpawnFunction_1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_1", true);
ShowEnemyPlayerPosition("grunt_1");
SetEntityActive("grunt_2", true);
ShowEnemyPlayerPosition("grunt_2");
}

void SpawnFunction_2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_3", true);
ShowEnemyPlayerPosition("grunt_3");
SetEntityActive("grunt_4", true);
ShowEnemyPlayerPosition("grunt_4");
}

void SpawnFunction_3(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_5", true);
ShowEnemyPlayerPosition("grunt_5");
SetEntityActive("grunt_6", true);
ShowEnemyPlayerPosition("grunt_6");
}

void SpawnFunction_4(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_7", true);
ShowEnemyPlayerPosition("grunt_7");
SetEntityActive("grunt_8", true);
ShowEnemyPlayerPosition("grunt_8");
}

void SpawnFunction_5(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("grunt_9", true);
ShowEnemyPlayerPosition("grunt_9");
SetEntityActive("grunt_10", true);
ShowEnemyPlayerPosition("grunt_10");
}


void Main_Credits(string &in asParent, string &in asChild, int alState)
{
FadeOut(2);
PlayMusic("Music.ogg", false, 1, 1, 1, false);
StartCredits("what's going on.ogg", true, "Ending", "MainCredits", 9001);
}

void Disable(string &in asParent, string &in asChild, int alState)
{
SetEnemyDisableTriggers("grunt_1", true);
SetEnemyDisableTriggers("grunt_2", true);
SetEnemyDisableTriggers("grunt_3", true);
SetEnemyDisableTriggers("grunt_4", true);
SetEnemyDisableTriggers("grunt_5", true);
SetEnemyDisableTriggers("grunt_6", true);
SetEnemyDisableTriggers("grunt_7", true);
SetEnemyDisableTriggers("grunt_8", true);
SetEnemyDisableTriggers("grunt_9", true);
SetEnemyDisableTriggers("grunt_10", true);
}


void OnEnter()
{

}


void OnLeave()
{

}

12-19-2012, 12:11 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#12
RE: Two problems

-Check names.

-Try putting AddDebugMessage("ScriptWorks", false); inside void Disable (Remember to tick "Show Debug Messages" in the debug menu in amnesia.

-If it doesn't work, i guess there's no other solution than when the monster has seen you, with the ShowEnemyPlayer script you cannot stop it with anything else than SetEntityActive

Trying is the first step to success.
12-19-2012, 12:39 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#13
RE: Two problems

(12-19-2012, 12:39 PM)beecake Wrote: -Check names.

-Try putting AddDebugMessage("ScriptWorks", false); inside void Disable (Remember to tick "Show Debug Messages" in the debug menu in amnesia.

-If it doesn't work, i guess there's no other solution than when the monster has seen you, with the ShowEnemyPlayer script you cannot stop it with anything else than SetEntityActive

But I don't understand why do they keep chasing me even though they can't see or reach me?

12-19-2012, 02:00 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#14
RE: Two problems

ShowEnemyPlayerPosition is like removing the walls for the monsters, and giving the infinite sight range (I guess)

It's not doing that, but that's how it feel. You could have 5 walls between you and the monster, and we would still see you...

Trying is the first step to success.
12-19-2012, 02:02 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#15
RE: Two problems

(12-19-2012, 02:02 PM)beecake Wrote: ShowEnemyPlayerPosition is like removing the walls for the monsters, and giving the infinite sight range (I guess)

It's not doing that, but that's how it feel. You could have 5 walls between you and the monster, and we would still see you...

But I've done that on another map. I walk up to a door and suddenly a brute starts to smash it. Then if you run and hide behind a crate it will stop until it sees you again... That's what confuses me.

12-19-2012, 02:03 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#16
RE: Two problems

Then i don't know...

I've never used that line

Trying is the first step to success.
12-19-2012, 02:58 PM
Find
Storfigge Offline
Member

Posts: 101
Threads: 31
Joined: Sep 2012
Reputation: 0
#17
RE: Two problems

(12-19-2012, 02:58 PM)beecake Wrote: Then i don't know...

I've never used that line

The thing is that I want the grunts to run towards me when they see me instead of walk. Someone told me to do the ShowEnemyPlayerPosition code to make that happen.

12-19-2012, 03:58 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#18
RE: Two problems

Yea it works fine... How about instead of stopping the triggers on the grunt, then just setting it inactive, and then activate a new grunt?

Trying is the first step to success.
12-19-2012, 04:21 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#19
RE: Two problems

(12-19-2012, 03:58 PM)Storfigge Wrote: The thing is that I want the grunts to run towards me when they see me instead of walk.

For that just edit the grunt entity so that its default speed is fast enough to initiate the run animation and possibly also decrease the minimum speed for the run animation.

Tutorials: From Noob to Pro
12-19-2012, 05:21 PM
Website Find




Users browsing this thread: 1 Guest(s)