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
Enemy Path help!!
Peku Offline
Junior Member

Posts: 6
Threads: 1
Joined: Dec 2011
Reputation: 0
#1
Enemy Path help!!

I tried to spawn a brute and make a path and the "loop" thing for it, but it doesn't work.
It crashes and says "main (160, 7) : ERR E : Unexpected end of file"



//===========================================
// Starter's Script File!
//===========================================

//===========================================
// This runs when the map first starts
void OnStart()
{
GiveItemFromFile("lantern", "lantern.ent"); for(int i=0;i<5;i++)

GiveItemFromFile("tinderbox_"+i, "tinderbox.ent");

AddEntityCollideCallback("Player", "ScriptArea_1", "MonsterVoice1", true, 1);

AddEntityCollideCallback("Player", "ScriptArea_4", "MonsterSpawn1", true, 1);

AddEntityCollideCallback("Player", "ScriptArea_5", "MonsterSpawnOff1", true, 1);

AddEntityCollideCallback("Player", "ScriptArea_2", "CloseDoor", true, 1);

AddEntityCollideCallback("Player", "ScriptArea_6", "OpenDoor", true, 1);

AddEntityCollideCallback("Player", "ScriptArea_7", "MonsterSpawn2", true, 1);

AddEntityCollideCallback("Player", "ScriptArea_8", "PrisonerVoice1", true, 1);

AddUseItemCallback("", "Cell_Key1", "door_1", "KeyOnDoor", true);

AddEntityCollideCallback("Player", "ScriptArea_9", "MonsterFunction", true, 1);

AddEntityCollideCallback("Player", "MonsterEnd", "MonsterEnd", true, 1);

AddEntityCollideCallback("servant_brute_1", "PNScriptArea", "MonsterFunction2", false, 1);
}

void TimerDoneLookAt(string &in asTimer)
{
StopPlayerLookAt();
}

void KeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("door_1", false, true);
PlaySoundAtEntity("", "unlock_door.snt", "door_1", 0.0f, true);
}

void CloseDoor(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("door_1", true, true);

SetSwingDoorLocked("door_1", true, true);

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);

PlaySoundAtEntity("", "close_door.snt", "Player", 0, false);

GiveSanityDamage(15.0f, true);
}

void MonsterVoice1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "enabled.snt", "torch_static01_3", 0, false);
}

void MonsterSpawn1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
}

void MonsterSpawnOff1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", false);
}

void OpenDoor(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("iron_maiden_1", 50, 1, 50, "World"); //red is x axis, blue is z axis, green is y axis.

PlaySoundAtEntity("", "react_breath_slow.snt", "Player", 0, false);

PlaySoundAtEntity("", "react_scare.snt", "Player", 0, false);

GiveSanityDamage(15.0f, true);
}

void PrisonerVoice1(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "15_prisoner_beg.snt", "Player", 0, false);
}


void MonsterSpawn2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", true);

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

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_2", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_3", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_4", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_5", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_6", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_7", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_8", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_9", 0, "");

AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_10", 0, "");
}

void MonsterFunction2()
{
for (int i = 1; i <6; i++)

{
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_"+10, 0, "");
}
}

void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", for (int i = 1; i <11; i++)
{
int x = i;
if (i == 1)
{
x = 2;
}
if (i = 10)
{
x = 4;
}
if (i != 1 || i != 10)
{
x = 0;
}
AddEnemyPatrolNode("servant_brute_1", "PathNodeArea_"+i, x, "");
}
}

void MonsterEnd(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_brute_1", false);
}

Please, help me with this and solve it. I would really appreciate it.
(This post was last modified: 12-24-2011, 10:47 PM by Peku.)
12-24-2011, 09:36 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#2
RE: Script Problem!!

Your MonsterFunction function was not properly closed.

Tutorials: From Noob to Pro
12-24-2011, 09:47 PM
Website Find
Peku Offline
Junior Member

Posts: 6
Threads: 1
Joined: Dec 2011
Reputation: 0
#3
RE: Script Problem!!

I managed to solve that problem but got a new one.

"main (128, 6) : INFO : Compiling void MonsterFunction(string&in, string&in, int)
main (130, 37) : ERR : Expected expression value
main (130, 63) : ERR : Expected ';' "

I put the new script in the first post
12-24-2011, 10:03 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#4
RE: Enemy Path help!!

You didn't properly close SetEntityActive.

Tutorials: From Noob to Pro
12-24-2011, 11:09 PM
Website Find
Peku Offline
Junior Member

Posts: 6
Threads: 1
Joined: Dec 2011
Reputation: 0
#5
RE: Enemy Path help!!

I tried but it's still not working.. Can you please fix it?
I know that i'm a pain in the ass but I really want to make it work..
(This post was last modified: 12-24-2011, 11:15 PM by Peku.)
12-24-2011, 11:14 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#6
RE: Enemy Path help!!

Try this:
PHP Code: (Select All)
void OnStart()
{
    
GiveItemFromFile("lantern""lantern.ent");
    
    for(
int i=0;i<5;i++)
        
GiveItemFromFile("tinderbox_"+i"tinderbox.ent");

    
AddEntityCollideCallback("Player""ScriptArea_1""MonsterVoice1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_4""MonsterSpawn1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_5""MonsterSpawnOff1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_2""CloseDoor"true1);
    
AddEntityCollideCallback("Player""ScriptArea_6""OpenDoor"true1);
    
AddEntityCollideCallback("Player""ScriptArea_7""MonsterSpawn2"true1);
    
AddEntityCollideCallback("Player""ScriptArea_8""PrisonerVoice1"true1);
    
AddUseItemCallback("""Cell_Key1""door_1""KeyOnDoor"true);
    
AddEntityCollideCallback("Player""ScriptArea_9""MonsterFunction"true1);
    
AddEntityCollideCallback("Player""MonsterEnd""MonsterEnd"true1);
    
AddEntityCollideCallback("servant_brute_1""PNScriptArea""MonsterFunction2"false1);
}

void TimerDoneLookAt(string &in asTimer)
{
    
StopPlayerLookAt();
}

void KeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("door_1"falsetrue);
    
PlaySoundAtEntity("""unlock_door.snt""door_1"0.0ftrue);
}

void CloseDoor(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("door_1"truetrue);
    
SetSwingDoorLocked("door_1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
PlaySoundAtEntity("""close_door.snt""Player"0false);
    
GiveSanityDamage(15.0ftrue);
}

void MonsterVoice1(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("""enabled.snt""torch_static01_3"0false);
}

void MonsterSpawn1(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"true);
}

void MonsterSpawnOff1(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"false);
}

void OpenDoor(string &in asParentstring &in asChildint alState)
{
    
AddPropImpulse("iron_maiden_1"50150"World"); //red is x axis, blue is z axis, green is y axis.
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
GiveSanityDamage(15.0ftrue);
}

void PrisonerVoice1(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("""15_prisoner_beg.snt""Player"0false);
}


void MonsterSpawn2(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"true);
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_10"0"");
}

void MonsterFunction2()
{
    for (
int i 1<6i++)
    {
        
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_"+100"");
    }
}

void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1");

    for (
int i 1<11i++)
    {
        
int x i;
        
        if (
== 1)
        {
            
2;
        }
        
        if (
10)
        {
            
4;
        }
        
        if (
!= || != 10)
        {
            
0;
        }
        
        
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_"+ix"");
    }
}

void MonsterEnd(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"false);


Tutorials: From Noob to Pro
12-24-2011, 11:20 PM
Website Find
Peku Offline
Junior Member

Posts: 6
Threads: 1
Joined: Dec 2011
Reputation: 0
#7
RE: Enemy Path help!!

Again, a new error.

"FATAL ERROR: Could not load script file 'custom_stories/My Story/maps/map01.hps'!
main (96, 5) : ERR : No matching signatures to 'SetEntityActive(string@&)'
main (107, 13) : ERR : Expression must be of boolean type"
(This post was last modified: 12-24-2011, 11:31 PM by Peku.)
12-24-2011, 11:30 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#8
RE: Enemy Path help!!

I'm going to assume you want the monster to activate.

PHP Code: (Select All)
void OnStart()
{
    
GiveItemFromFile("lantern""lantern.ent");
    
    for(
int i=0;i<5;i++)
        
GiveItemFromFile("tinderbox_"+i"tinderbox.ent");

    
AddEntityCollideCallback("Player""ScriptArea_1""MonsterVoice1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_4""MonsterSpawn1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_5""MonsterSpawnOff1"true1);
    
AddEntityCollideCallback("Player""ScriptArea_2""CloseDoor"true1);
    
AddEntityCollideCallback("Player""ScriptArea_6""OpenDoor"true1);
    
AddEntityCollideCallback("Player""ScriptArea_7""MonsterSpawn2"true1);
    
AddEntityCollideCallback("Player""ScriptArea_8""PrisonerVoice1"true1);
    
AddUseItemCallback("""Cell_Key1""door_1""KeyOnDoor"true);
    
AddEntityCollideCallback("Player""ScriptArea_9""MonsterFunction"true1);
    
AddEntityCollideCallback("Player""MonsterEnd""MonsterEnd"true1);
    
AddEntityCollideCallback("servant_brute_1""PNScriptArea""MonsterFunction2"false1);
}

void TimerDoneLookAt(string &in asTimer)
{
    
StopPlayerLookAt();
}

void KeyOnDoor(string &in asItemstring &in asEntity)
{
    
SetSwingDoorLocked("door_1"falsetrue);
    
PlaySoundAtEntity("""unlock_door.snt""door_1"0.0ftrue);
}

void CloseDoor(string &in asParentstring &in asChildint alState)
{
    
SetSwingDoorClosed("door_1"truetrue);
    
SetSwingDoorLocked("door_1"truetrue);
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
PlaySoundAtEntity("""close_door.snt""Player"0false);
    
GiveSanityDamage(15.0ftrue);
}

void MonsterVoice1(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("""enabled.snt""torch_static01_3"0false);
}

void MonsterSpawn1(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"true);
}

void MonsterSpawnOff1(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_grunt_1"false);
}

void OpenDoor(string &in asParentstring &in asChildint alState)
{
    
AddPropImpulse("iron_maiden_1"50150"World"); //red is x axis, blue is z axis, green is y axis.
    
PlaySoundAtEntity("""react_breath_slow.snt""Player"0false);
    
PlaySoundAtEntity("""react_scare.snt""Player"0false);
    
GiveSanityDamage(15.0ftrue);
}

void PrisonerVoice1(string &in asParentstring &in asChildint alState)
{
    
PlaySoundAtEntity("""15_prisoner_beg.snt""Player"0false);
}


void MonsterSpawn2(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"true);
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_1"2"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_2"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_3"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_4"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_5"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_6"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_7"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_8"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_9"0"");
    
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_10"0"");
}

void MonsterFunction2()
{
    for (
int i 1<6i++)
    {
        
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_"+100"");
    }
}

void MonsterFunction(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"true);

    for (
int i 1<11i++)
    {
        
int x i;
        
        if (
== 1)
        {
            
2;
        }
        
        if (
== 10)
        {
            
4;
        }
        
        if (
!= || != 10)
        {
            
0;
        }
        
        
AddEnemyPatrolNode("servant_brute_1""PathNodeArea_"+ix"");
    }
}

void MonsterEnd(string &in asParentstring &in asChildint alState)
{
    
SetEntityActive("servant_brute_1"false);


Tutorials: From Noob to Pro
(This post was last modified: 12-24-2011, 11:39 PM by Your Computer.)
12-24-2011, 11:38 PM
Website Find
Peku Offline
Junior Member

Posts: 6
Threads: 1
Joined: Dec 2011
Reputation: 0
#9
RE: Enemy Path help!!

Fatal error and now it says only

"FATAL ERROR: Could not load script file 'custom_stories/My Story/maps/map01.hps'!
main (107, 13) : ERR : Expression must be of boolean type"
(This post was last modified: 12-24-2011, 11:43 PM by Peku.)
12-24-2011, 11:42 PM
Find
Your Computer Offline
SCAN ME!

Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation: 235
#10
RE: Enemy Path help!!

My previous post is edited.

Tutorials: From Noob to Pro
12-24-2011, 11:45 PM
Website Find




Users browsing this thread: 4 Guest(s)