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
#1
Two problems

So the problems I have is:

1. I have a map where you run in a corridor and grunts appears behind you. I've used ShowEnemyPlayerPosition("???"); on all monsters to make them run after the player. At the end of the corridor there is a ladder that leads to the next floor. But once the layer has climbed it the monster still "runs" after you. The sound that starts when you get followed by them keep playing even though I've reached reached another floor and closed a hatch under me. Why does this happen and how do I stop it?

2. On the final level, before you reach the end that will start the credits you will be followed by a grunt. During the credits there is music playing but the same sound from my first problem keeps playing once the credits start. How do I stop all sound from the game except my credit theme during the credits?

Thanks.

12-13-2012, 01:49 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Two problems

(12-13-2012, 01:49 PM)Storfigge Wrote: So the problems I have is:

1. I have a map where you run in a corridor and grunts appears behind you. I've used ShowEnemyPlayerPosition("???"); on all monsters to make them run after the player. At the end of the corridor there is a ladder that leads to the next floor. But once the layer has climbed it the monster still "runs" after you. The sound that starts when you get followed by them keep playing even though I've reached reached another floor and closed a hatch under me. Why does this happen and how do I stop it?

2. On the final level, before you reach the end that will start the credits you will be followed by a grunt. During the credits there is music playing but the same sound from my first problem keeps playing once the credits start. How do I stop all sound from the game except my credit theme during the credits?

Thanks.
Showing your script could work for all of them. Nevertheless:

1: Have you tried "DisableEnemyTriggers("Nameofmonster", true);" ? Of course, activated when you climb the ladder

2: PlayMusic("Music.ogg", false, 1, 1, 1, false);

The bolded false means it doesn't loop when stopped. I hope that worked Wink

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-13-2012, 02:12 PM
Find
Storfigge Offline
Member

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

(12-13-2012, 02:12 PM)The chaser Wrote:
(12-13-2012, 01:49 PM)Storfigge Wrote: So the problems I have is:

1. I have a map where you run in a corridor and grunts appears behind you. I've used ShowEnemyPlayerPosition("???"); on all monsters to make them run after the player. At the end of the corridor there is a ladder that leads to the next floor. But once the layer has climbed it the monster still "runs" after you. The sound that starts when you get followed by them keep playing even though I've reached reached another floor and closed a hatch under me. Why does this happen and how do I stop it?

2. On the final level, before you reach the end that will start the credits you will be followed by a grunt. During the credits there is music playing but the same sound from my first problem keeps playing once the credits start. How do I stop all sound from the game except my credit theme during the credits?

Thanks.
Showing your script could work for all of them. Nevertheless:

1: Have you tried "DisableEnemyTriggers("Nameofmonster", true);" ? Of course, activated when you climb the ladder

2: PlayMusic("Music.ogg", false, 1, 1, 1, false);

The bolded false means it doesn't loop when stopped. I hope that worked Wink
A bit late but I'm still not quite sure what I'm suppose to do :S I'm still pretty new with coding this stuff.
Here is the code.

So where am I suppose to put in the code to make what i requested to work?



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);
}


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);
StartCredits("what's going on.ogg", true, "Ending", "MainCredits", 9001);
}








void OnEnter()
{


}




void OnLeave()
{


}

12-18-2012, 12:36 PM
Find
Kreekakon Offline
Pick a god and pray!

Posts: 3,063
Threads: 70
Joined: Mar 2012
Reputation: 124
#4
RE: Two problems

For problem number 1, you could always set the chasing Grunt(s) to inactive after you don't need it anymore, and set a new one active in its place which isn't chasing the player if you're afraid for whatever reason the player might backtrack his tracks, and discover that it has vanished.

Example:

SetEntityActive("grunt_9", false);

[Image: Tv0YgQb.gif]
Image by BandyGrass
(This post was last modified: 12-18-2012, 01:45 PM by Kreekakon.)
12-18-2012, 01:44 PM
Find
Storfigge Offline
Member

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

(12-18-2012, 01:44 PM)Kreekakon Wrote: For problem number 1, you could always set the chasing Grunt(s) to inactive after you don't need it anymore, and set a new one active in its place which isn't chasing the player if you're afraid for whatever reason the player might backtrack his tracks, and discover that it has vanished.

Example:

SetEntityActive("grunt_9", false);
I want those to be "true" because if I die I want them to respawn.

12-18-2012, 02:06 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#6
RE: Two problems

Use the scripts:

PlayMusic("Music.ogg", false, 1, 1, 1, false); ///Doesn't loop, put this in the function of your credits (void MainCredits)

DisableEnemyTriggers("Nameofmonster", true); //This disables anything that the monster could react to (player, sounds)
Put this when the player is up enough in the ladder so the grunts cannot kill him.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
12-18-2012, 02:13 PM
Find
Storfigge Offline
Member

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

(12-18-2012, 02:13 PM)The chaser Wrote: Use the scripts:

PlayMusic("Music.ogg", false, 1, 1, 1, false); ///Doesn't loop, put this in the function of your credits (void MainCredits)

DisableEnemyTriggers("Nameofmonster", true); //This disables anything that the monster could react to (player, sounds)
Put this when the player is up enough in the ladder so the grunts cannot kill him.
I don't understand what what to do with DisableEnemyTriggers("Nameofmonster", true); where am I suppose to put it? I made a script in the map and tried different ways to make it work but it just wont, I'm doing something wrong. Sorry but I'm no programmer Undecided and I'm not the brightest person either. I just experiment with different codes to make something happen and when that wont work i check for an easy solution here or on the wiki. I would really appreciate if you could simply tell me what to do. I made a script in the map, gave it a name and made an AddEntityCollideCallback. It's after that I get stuck. Thanks

12-19-2012, 01:25 AM
Find
FlawlessHappiness Offline
Posting Freak

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

void CollideFunction(string &in asParent, string &in asChild, int alState)
{
DisableEnemyTriggers("NameOfMonster", true);
}

Trying is the first step to success.
12-19-2012, 06:48 AM
Find
Storfigge Offline
Member

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

(12-19-2012, 06:48 AM)beecake Wrote: void CollideFunction(string &in asParent, string &in asChild, int alState)
{
DisableEnemyTriggers("NameOfMonster", true);
}
Already tried that and i doesn't work :/ I just get an error "Could not load script file" "No matching signatures to DisableEnemyTriggers(string@&, const bool)"

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

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

Ah! It's because it's SetEnemyDisableTriggers

Trying is the first step to success.
(This post was last modified: 12-19-2012, 11:58 AM by FlawlessHappiness.)
12-19-2012, 11:57 AM
Find




Users browsing this thread: 1 Guest(s)