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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help Enemy Patroling and Disapearing: Help!
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#21
RE: Enemy Patroling and Disapearing: Help!

AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_1", 2, "");

Is this supposed to be

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");

That is the name of a default pathnode. Unless you erased that last letter on purpose, it might cause the grunt to follow nothing. Just wondering.

04-27-2012, 11:56 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#22
RE: Enemy Patroling and Disapearing: Help!

(04-27-2012, 11:11 AM)heyitsrobert97 Wrote:
(04-27-2012, 08:21 AM)Cocomunches Wrote:
Quote: ////////////////////////////
// Run when entering map
void OnStart()

{
SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);
}

void OnPickup(string &in asEntity)
{
SetEntityActive ("Monster_Grunt", true);
AddTimer("monsterstart", 60.0f, "byegrunt");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_1", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_2", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_3", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_4", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_5", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_6", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_7", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_8", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_9", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_10", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_11", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_12", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_13", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_14", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_15", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_16", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_17", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_18", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_19", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_20", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_21", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_22", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_23", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_24", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_25", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_26", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_27", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_28", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_29", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_30", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_31", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_32", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_33", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_34", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_35", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_36", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_37", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_38", 0, "");
}

void byegrunt(string &in asTimer)
{
SetEntityActive ("Monster_Grunt", false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(2.0f, 0);
}
You Can Delete The Collide area to create areanodes. you just add them right after you spawn the grunt like i did. I also Added Something to The void OnLeave() to help you. it will stop the music (if you have any) and fade it out when you exit the map to main menu or another map Big Grin

haha, thanks! Also, very stupid question, how do you add music?


(04-27-2012, 11:56 AM)TeamSD Wrote: AddEnemyPatrolNode("Monster_Grunt", "PathNodeAre_1", 2, "");

Is this supposed to be

AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");

That is the name of a default pathnode. Unless you erased that last letter on purpose, it might cause the grunt to follow nothing. Just wondering.
:| i feel stupid. haha, thanks very much, IT WORKS!!!!

(This post was last modified: 04-27-2012, 09:07 PM by Cocomunches.)
04-27-2012, 08:45 PM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#23
RE: Enemy Patroling and Disapearing: Help!

Im glad it worked. Do not feel stupid. You have no idea how many times i've done similar grammar errors. They are hard to spot because they don't cause the game to crash. Nothing just happens and it is pain in the ass.


Here is a copypaste from engine scripts page for the music:

void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

Plays music.

asMusicFile - the music to play + extension .ogg

abLoop - determines whether a music track should loop

afVolume - volume of the music

afFadeTime - time in seconds until music reaches full volume

alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - highest, 1 - lower, etc

If you need more help just say so.



(This post was last modified: 04-27-2012, 09:24 PM by TeamSD.)
04-27-2012, 09:24 PM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#24
RE: Enemy Patroling and Disapearing: Help!

(04-27-2012, 09:24 PM)TeamSD Wrote: Im glad it worked. Do not feel stupid. You have no idea how many times i've done similar grammar errors. They are hard to spot because they don't cause the game to crash. Nothing just happens and it is pain in the ass.


Here is a copypaste from engine scripts page for the music:

void PlayMusic(string& asMusicFile, bool abLoop, float afVolume, float afFadeTime, int alPrio, bool abResume);

Plays music.

asMusicFile - the music to play + extension .ogg

abLoop - determines whether a music track should loop

afVolume - volume of the music

afFadeTime - time in seconds until music reaches full volume

alPrio - priority of the music. Note that only the music with the highest priority can be heard! 0 - highest, 1 - lower, etc

If you need more help just say so.

'Nother nooby question is how would I put these into the .hps?

like, if you can show an example.
04-28-2012, 02:06 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#25
RE: Enemy Patroling and Disapearing: Help!

Hey, if you or anyone else can help me out with this, I keep getting similar errors from last time.


Quote:////////////////////////////
// Run when entering map
void OnStart()

{
SetEntityPlayerInteractCallback("scareactive2", "OnPickup", true);
}

void OnPickup(string &in asEntity)
{
SetEntityActive ("Monster_Grunt", true);
AddTimer("monsterstart", 60.0f, "byegrunt");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_7", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_10", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_13", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_19", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_25", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_26", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_27", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_28", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_29", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_30", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_31", 2, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_32", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_33", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_37", 0, "");
AddEnemyPatrolNode("Monster_Grunt", "PathNodeArea_38", 0, "");
}

void byegrunt(string &in asTimer)
{
SetEntityActive ("Monster_Grunt", false);
}

{
SetEntityPlayerInteractCallback("celltwelvekey", "OnPickup", true);
}

void OnPickup(string &in asEntity)
{
SetEntityActive ("baisle", true);
AddTimer("monsterstart", 400.0f, "byegrunt");
AddEnemyPatrolNode("baisle", "PathNodeArea_39", 2, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_41", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_42", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_43", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_44", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_45", 2, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_46", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_47", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_48", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_49", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_50", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_51", 2, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_52", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_53", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_54", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_55", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_56", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_57", 2, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_58", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_59", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_60", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_61", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_62", 0, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_63", 2, "");
AddEnemyPatrolNode("baisle", "PathNodeArea_64", 0, "");
}

void byegrunt(string &in asTimer)
{
SetEntityActive ("baisle", false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
StopMusic(2.0f, 0);
}


The added part is where Basil (Monster) Is.
(This post was last modified: 04-28-2012, 05:26 AM by Cocomunches.)
04-28-2012, 05:25 AM
Find
TeamSD Offline
Member

Posts: 51
Threads: 3
Joined: Apr 2012
Reputation: 2
#26
RE: Enemy Patroling and Disapearing: Help!

void byegrunt(string &in asTimer) appaers in your script twice. name the other one like this for example.

void byegrunt2(string &in asTimer)

04-28-2012, 06:58 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#27
RE: Enemy Patroling and Disapearing: Help!

edited fix
(This post was last modified: 04-28-2012, 08:49 PM by Cocomunches.)
04-28-2012, 07:17 AM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#28
RE: Enemy Patroling and Disapearing: Help!

(04-28-2012, 06:58 AM)TeamSD Wrote: void byegrunt(string &in asTimer) appaers in your script twice. name the other one like this for example.

void byegrunt2(string &in asTimer)
FATAL ERROR: Could not load script file



ExecuteString (1,1) : ERR :No matching signatures to 'OnEnter()'

Main (58,1): ERR : Unexpected token '{'

04-28-2012, 08:49 PM
Find
Dutton Offline
Member

Posts: 121
Threads: 3
Joined: Apr 2012
Reputation: 2
#29
RE: Enemy Patroling and Disapearing: Help!

opon changing the void byegrunt(string &in asTimer) to
void byegrunt2(string &in asTimer)


You remembered to change:
AddTimer("monsterstart", 400.0f, "byegrunt");

to
AddTimer("monsterstart", 400.0f, "byegrunt2");


??

[Image: 15isy6C]
(This post was last modified: 05-06-2012, 05:07 PM by Dutton.)
05-06-2012, 05:06 PM
Find
Cocomunches Offline
Junior Member

Posts: 36
Threads: 6
Joined: Apr 2012
Reputation: 1
#30
RE: Enemy Patroling and Disapearing: Help!

(05-06-2012, 05:06 PM)Dutton Wrote: opon changing the void byegrunt(string &in asTimer) to
void byegrunt2(string &in asTimer)

You remembered to change:
AddTimer("monsterstart", 400.0f, "byegrunt");

to
AddTimer("monsterstart", 400.0f, "byegrunt2");


??
Yes I did. Everything worked out fine! Thanks to all!
05-10-2012, 01:17 AM
Find




Users browsing this thread: 4 Guest(s)