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


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DONE - script not working pls help
Author Message
boghinovel Offline
Junior Member

Posts: 10
Joined: Sep 2013
Reputation: 0
Post: #1
Question DONE - script not working pls help

ok guys i know i'm doing something bad but i don't know wath
i made a custom map just for test pls help me Confused
the name of spawns are those:

spawn_enemy_1
enemy_1
path_node_1

and this is my file with other stuf in it that works fine

void OnStart()
    {
        GiveItemFromFile("lantern", "lantern.ent");SetPlayerLampOil(100.0f);

        for(int i = 0;i < 30;i++)

        GiveItemFromFile("tinderbox", "tinderbox.ent");

        AddUseItemCallback("", "key1", "door1", "KeyOnDoor", true);
        AddUseItemCallback("", "key2", "door2", "KeyOnDoor", true);

        AddEntityCollideCallback("Player", "spawn_enemy_1", "enemy_1", true, 1);
        AddEntityCollideCallback("enemy_1","stop","CollideStop",true,1);

        FadeOut(0.0f);

        AddTimer("internal.timer.id", 5.0f, "MyFunc");
    }



void KeyOnDoor(string &in asItem, string &in asEntity)
    {
        SetSwingDoorLocked("door1", false, true);
        SetSwingDoorLocked("door2", false, true);

        PlaySoundAtEntity("", "unlock_door.snt", "door1", 0.0f, true);
        PlaySoundAtEntity("", "unlock_door.snt", "door2", 0.0f, true);
    }



void monster(string &in asParent, string &in asChild, int alState)
    {
        SetEntityActive("enemy_1",true);
        AddEnemyPatrolNode("enemy_1","path_node_1",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_2",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_3",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_4",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_5",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_6",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_7",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_8",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_9",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_10",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_11",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_12",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_13",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_14",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_15",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_16",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_17",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_18",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_19",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_20",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_21",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_22",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_23",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_24",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_25",0,"");
    }



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



void MyFunc(string &in timerID)
    {
        FadeIn(5.0f);
    }









void OnEnter()
{
}

void OnLeave()
{
}
(This post was last modified: 09-15-2013 03:31 PM by boghinovel.)
09-15-2013 01:47 PM
Find all posts by this user Quote this message in a reply
Neelke Offline
Senior Member

Posts: 666
Joined: Apr 2013
Reputation: 26
Post: #2
RE: script not working pls help

I'm pretty sure you can't put SetPlayerLampOil there. Move it under the GiveItemFromFile script. Like this:

GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

Also you don't really need the setplayerlampoil. It is already full when you start the game.

If that is not the problem, try to put the GiveItemFromFile with tinderboxes like this instead:

for(int i = 0;i < 30;i++) GiveItemFromFile("tinderbox", "tinderbox.ent");

Everything else seems to be just fine. If these are not the issues, I have no idea.
(This post was last modified: 09-15-2013 01:55 PM by Neelke.)
09-15-2013 01:54 PM
Find all posts by this user Quote this message in a reply
boghinovel Offline
Junior Member

Posts: 10
Joined: Sep 2013
Reputation: 0
Post: #3
RE: script not working pls help

(09-15-2013 01:54 PM)Neelke Wrote:  I'm pretty sure you can't put SetPlayerLampOil there. Move it under the GiveItemFromFile script. Like this:

GiveItemFromFile("lantern", "lantern.ent");
SetPlayerLampOil(100.0f);

Also you don't really need the setplayerlampoil. It is already full when you start the game.

If that is not the problem, try to put the GiveItemFromFile with tinderboxes like this instead:

for(int i = 0;i < 30;i++) GiveItemFromFile("tinderbox", "tinderbox.ent");

Everything else seems to be just fine. If these are not the issues, I have no idea.

ok so i have done wath you sayd but the monster is not spawning when i go to area script
when in game to spawn_enemy_1 area script, nothing hapens
it supose to spawn enemy_1 wich is a grunt deactivated and supose to folow the path_node_1,2,3 . . .
so wath is bad here coz i don't get it Huh

void OnStart()
    {
        GiveItemFromFile("lantern", "lantern.ent");
        SetPlayerLampOil(100.0f);

        for(int i = 0;i < 30;i++) GiveItemFromFile("tinderbox", "tinderbox.ent");

        AddUseItemCallback("", "key1", "door1", "KeyOnDoor", true);
        AddUseItemCallback("", "key2", "door2", "KeyOnDoor", true);

        AddEntityCollideCallback("Player", "spawn_enemy_1", "enemy_1", true, 1);
        AddEntityCollideCallback("enemy_1","stop","CollideStop",true,1);

        FadeOut(0.0f);

        AddTimer("internal.timer.id", 5.0f, "MyFunc");
    }



void KeyOnDoor(string &in asItem, string &in asEntity)
    {
        SetSwingDoorLocked("door1", false, true);
        SetSwingDoorLocked("door2", false, true);

        PlaySoundAtEntity("", "unlock_door.snt", "door1", 0.0f, true);
        PlaySoundAtEntity("", "unlock_door.snt", "door2", 0.0f, true);
    }



void monster(string &in asParent, string &in asChild, int alState)
    {
        SetEntityActive("enemy_1",true);
        AddEnemyPatrolNode("enemy_1","path_node_1",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_2",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_3",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_4",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_5",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_6",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_7",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_8",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_9",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_10",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_11",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_12",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_13",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_14",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_15",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_16",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_17",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_18",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_19",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_20",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_21",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_22",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_23",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_24",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_25",0,"");
    }



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



void MyFunc(string &in timerID)
    {
        FadeIn(5.0f);
    }









void OnEnter()
{
}

void OnLeave()
{
}
09-15-2013 02:13 PM
Find all posts by this user Quote this message in a reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,712
Joined: Dec 2012
Reputation: 119
Post: #4
RE: script not working pls help

PHP Code: (Select All)
AddEntityCollideCallback("Player""spawn_enemy_1""enemy_1"true1); 
Your parameter on calling the enemy.

PHP Code: (Select All)
void monster(string &in asParentstring &in asChildint alState)
{
 
SetEntityActive("enemy_1",true);
AddEnemyPatrolNode("enemy_1","path_node_1",0,"");
AddEnemyPatrolNode("enemy_1","path_node_2",0,"");
AddEnemyPatrolNode("enemy_1","path_node_3",0,"");
AddEnemyPatrolNode("enemy_1","path_node_4",0,"");
AddEnemyPatrolNode("enemy_1","path_node_5",0,"");
AddEnemyPatrolNode("enemy_1","path_node_6",0,"");
AddEnemyPatrolNode("enemy_1","path_node_7",0,"");
AddEnemyPatrolNode("enemy_1","path_node_8",0,"");
AddEnemyPatrolNode("enemy_1","path_node_9",0,"");
AddEnemyPatrolNode("enemy_1","path_node_10",0,"");
AddEnemyPatrolNode("enemy_1","path_node_11",0,"");
AddEnemyPatrolNode("enemy_1","path_node_12",0,"");
AddEnemyPatrolNode("enemy_1","path_node_13",0,"");
AddEnemyPatrolNode("enemy_1","path_node_14",0,"");
AddEnemyPatrolNode("enemy_1","path_node_15",0,""); AddEnemyPatrolNode("enemy_1","path_node_16",0,"");
AddEnemyPatrolNode("enemy_1","path_node_17",0,"");
AddEnemyPatrolNode("enemy_1","path_node_18",0,"");
AddEnemyPatrolNode("enemy_1","path_node_19",0,"");
AddEnemyPatrolNode("enemy_1","path_node_20",0,"");
AddEnemyPatrolNode("enemy_1","path_node_21",0,"");
AddEnemyPatrolNode("enemy_1","path_node_22",0,"");
AddEnemyPatrolNode("enemy_1","path_node_23",0,"");
AddEnemyPatrolNode("enemy_1","path_node_24",0,"");
AddEnemyPatrolNode("enemy_1","path_node_25",0,"");


See a difference? No, well here's your mistake. The function's name in the function and parameter is different. The function has Monster but the parameter has enemy_1.

Make it the same.

"Veni, vidi, vici."
"I came, I saw, I conquered."
(This post was last modified: 09-15-2013 02:23 PM by PutraenusAlivius.)
09-15-2013 02:20 PM
Find all posts by this user Quote this message in a reply
boghinovel Offline
Junior Member

Posts: 10
Joined: Sep 2013
Reputation: 0
Post: #5
RE: script not working pls help

ok here it is i have tested and damn is not working, the monster is not spawning ufffAngry[/size]
void OnStart()
    {
        GiveItemFromFile("lantern", "lantern.ent");
        SetPlayerLampOil(100.0f);

        for(int i = 0;i < 30;i++) GiveItemFromFile("tinderbox", "tinderbox.ent");

        AddUseItemCallback("", "key1", "door1", "KeyOnDoor", true);
        AddUseItemCallback("", "key2", "door2", "KeyOnDoor", true);

        AddEntityCollideCallback("Player", "spawn_enemy_1", "active_enemy", true, 1);
        AddEntityCollideCallback("enemy_1","stop","CollideStop",true,1);

        FadeOut(0.0f);

        AddTimer("internal.timer.id", 5.0f, "MyFunc");
    }



void KeyOnDoor(string &in asItem, string &in asEntity)
    {
        SetSwingDoorLocked("door1", false, true);
        SetSwingDoorLocked("door2", false, true);

        PlaySoundAtEntity("", "unlock_door.snt", "door1", 0.0f, true);
        PlaySoundAtEntity("", "unlock_door.snt", "door2", 0.0f, true);
    }



void active_enemy(string &in asParent, string &in asChild, int alState)
    {
        SetEntityActive("enemy_1",true);
        AddEnemyPatrolNode("enemy_1","path_node_1",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_2",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_3",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_4",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_5",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_6",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_7",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_8",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_9",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_10",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_11",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_12",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_13",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_14",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_15",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_16",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_17",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_18",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_19",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_20",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_21",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_22",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_23",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_24",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_25",0,"");
    }



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



void MyFunc(string &in timerID)
    {
        FadeIn(5.0f);
    }









void OnEnter()
{
}

void OnLeave()
{
}
(This post was last modified: 09-15-2013 02:34 PM by boghinovel.)
09-15-2013 02:33 PM
Find all posts by this user Quote this message in a reply
PutraenusAlivius Offline
Posting Freak

Posts: 4,712
Joined: Dec 2012
Reputation: 119
Post: #6
RE: script not working pls help

(09-15-2013 02:33 PM)boghinovel Wrote:  ok here it is i have tested and damn is not working, the monster is not spawning ufffAngry[/size]
void OnStart()
    {
        GiveItemFromFile("lantern", "lantern.ent");
        SetPlayerLampOil(100.0f);

        for(int i = 0;i < 30;i++) GiveItemFromFile("tinderbox", "tinderbox.ent");

        AddUseItemCallback("", "key1", "door1", "KeyOnDoor", true);
        AddUseItemCallback("", "key2", "door2", "KeyOnDoor", true);

        AddEntityCollideCallback("Player", "spawn_enemy_1", "active_enemy", true, 1);
        AddEntityCollideCallback("enemy_1","stop","CollideStop",true,1);

        FadeOut(0.0f);

        AddTimer("internal.timer.id", 5.0f, "MyFunc");
    }



void KeyOnDoor(string &in asItem, string &in asEntity)
    {
        SetSwingDoorLocked("door1", false, true);
        SetSwingDoorLocked("door2", false, true);

        PlaySoundAtEntity("", "unlock_door.snt", "door1", 0.0f, true);
        PlaySoundAtEntity("", "unlock_door.snt", "door2", 0.0f, true);
    }



void active_enemy(string &in asParent, string &in asChild, int alState)
    {
        SetEntityActive("enemy_1",true);
        AddEnemyPatrolNode("enemy_1","path_node_1",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_2",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_3",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_4",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_5",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_6",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_7",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_8",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_9",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_10",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_11",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_12",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_13",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_14",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_15",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_16",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_17",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_18",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_19",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_20",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_21",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_22",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_23",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_24",0,"");
        AddEnemyPatrolNode("enemy_1","path_node_25",0,"");
    }



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



void MyFunc(string &in timerID)
    {
        FadeIn(5.0f);
    }









void OnEnter()
{
}

void OnLeave()
{
}

You probably named something wrong/didn't save in the Level Editor.

Or, the monster DOES spawn, but doesn't follow the pathnodes.

"Veni, vidi, vici."
"I came, I saw, I conquered."
09-15-2013 03:13 PM
Find all posts by this user Quote this message in a reply
boghinovel Offline
Junior Member

Posts: 10
Joined: Sep 2013
Reputation: 0
Post: #7
RE: script not working pls help

ok so it was this
enemy_1 = ennemy_1
damn mistake
thanx for helping me guys
09-15-2013 03:22 PM
Find all posts by this user Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)