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
Script Help Fatal Error
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#1
Fatal Error

I'm having trouble trying to get my script to work. I know there is something wrong, I just can't find it (I'm new to
scripting. Thanks in advance!
Sorry for path node spam.
The Fatal Error says the problem is in line 5 or 2.


void OnStart()
{
AddEntityCollideCallback("Player", "PlayerCollide", "MonsterFunction", true, 1);
AddEntityCollideCallback("Player", "Music", "StartMusic", true, 1);
AddItemUseCallback("", "key_1", "lockdoor_1", "UsedKeyOnDoor", true);
}
void MonsterFunction(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 2, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_40", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_39", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_38", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_37", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_36", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_35", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_34", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_24", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_23", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_22", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_21", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_20", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_19", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_18", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_17", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_16", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_15", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_14", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_13", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_12", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_11", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_10", 4, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_9", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_8", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_7", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_6", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_5", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
}

void StartMusic(string &in asParent, string &in asChild, int alState)
{
PlayMusic ("Music1", true, 0.8, 2, 1, true);
}

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockdoor_1", 0, false);
RemoveItem("key_1");
}
11-13-2012, 08:33 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#2
RE: Fatal Error

Well you have a problem here: (Outtakes of your script)

void OnStart()
{
AddItemUseCallback("", "key_1", "lockdoor_1", "UsedKeyOnDoor", true);

}

void MyFunc(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("lockdoor_1", false, true);
PlaySoundAtEntity("", "unlock_door", "lockdoor_1", 0, false);
RemoveItem("key_1");
}



The highlighted text should be the same.

Trying is the first step to success.
11-13-2012, 08:36 PM
Find
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#3
RE: Fatal Error

Thanks for the speedy response, and your solution has worked great, but now it says that there are no matching signatures for AddItemUseCallback. Maybe you could point me in the right direction?
11-13-2012, 08:42 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#4
RE: Fatal Error

Yea.
It's called AddUseItemCallback. Not AddItemUseCallback

You switched Item and Used Wink

Trying is the first step to success.
(This post was last modified: 11-13-2012, 08:46 PM by FlawlessHappiness.)
11-13-2012, 08:46 PM
Find
RedSampson00 Offline
Junior Member

Posts: 11
Threads: 4
Joined: Nov 2012
Reputation: 0
#5
RE: Fatal Error

Thanks! Works like a charm now.

Would you know a way to make a loop for the pathnodes? Thanks.
(This post was last modified: 11-13-2012, 09:01 PM by RedSampson00.)
11-13-2012, 09:00 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#6
RE: Fatal Error

Nope sorry. Still can't figure out how. But I know that "for" makes a loop. But i don't know how to use it in a smart way.

If you want the monster to walk in a circle you could always make it go half the way, then make it collide with a script area (At the last pathnode) Which adds the other half, where it collides with a second area (At the last pathnode) which adds the first half again

Trying is the first step to success.
11-13-2012, 09:05 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Fatal Error

(11-13-2012, 09:05 PM)beecake Wrote: Nope sorry. Still can't figure out how. But I know that "for" makes a loop. But i don't know how to use it in a smart way.

If you want the monster to walk in a circle you could always make it go half the way, then make it collide with a script area (At the last pathnode) Which adds the other half, where it collides with a second area (At the last pathnode) which adds the first half again
I did that but when you didn't look the monster dissapeared.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-13-2012, 10:13 PM
Find
FlawlessHappiness Offline
Posting Freak

Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation: 171
#8
RE: Fatal Error

Yup... Just like in the real Amnesia..
I don't think there is a way, if you give the monster a path node...
Not even the Justine patch thing... or am i wrong?

Trying is the first step to success.
11-13-2012, 10:21 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#9
RE: Fatal Error

(11-13-2012, 10:21 PM)beecake Wrote: Yup... Just like in the real Amnesia..
I don't think there is a way, if you give the monster a path node...
Not even the Justine patch thing... or am i wrong?
Your Computer has a video about it and thanks to it Damascus could have a never-ending enemy.

The video: http://www.youtube.com/watch?v=xWPU6frXm...0C8#t=584s

The wiki document of loops for monsters: http://wiki.frictionalgames.com/hpl2/tut...rpathnodes

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
11-13-2012, 11:27 PM
Find




Users browsing this thread: 6 Guest(s)