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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting fatal errors?
Rapsis Offline
Member

Posts: 69
Threads: 6
Joined: Oct 2012
Reputation: 0
#1
Scripting fatal errors?

Alright, another day another problem, I added a couple of new lines, they seem to be causing some kind of a problem:


void OnStart()
{
FadeOut(0);
FadeIn(10);
AddEntityCollideCallback("Player", "Studydooropen", "CollideRoomTwo", true, 0);
SetEntityCallbackFunc(lantern_1, removelight);
AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
SetSwingDoorLocked("mansion_2", true, true);
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("bedroomkey_1");
}

void removelight(string &in asEntity, string &in type)
{
SetLightVisible(PointLight_1, false);
}

void OnLeave()
{

}

I wanted to make the lantern emit light until the player picks it up, then the light is supposed to disappear. I get this error:
main (6,24) : ERR : lantern_1 is not declared
main (29,18) : ERR : PointLight_1 is not declared

Any help?

Thanks, Rapsis
10-14-2012, 11:23 AM
Find
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#2
RE: Scripting fatal errors?

You are missing the quotation marks needed to make the parameters a string. I.e:

SetEntityCallbackFunc("lantern_1", "removelight");
SetLightVisible("PointLight_1", false);
(This post was last modified: 10-14-2012, 11:29 AM by Apjjm.)
10-14-2012, 11:26 AM
Find
Rapsis Offline
Member

Posts: 69
Threads: 6
Joined: Oct 2012
Reputation: 0
#3
RE: Scripting fatal errors?

Ooooh, thanks, silly me ;D

Argh, now I get:
(6,24) No matching signatures to 'SetEntityCallbackFunc(string@&, removelight)

(10-14-2012, 11:28 AM)Rapsis Wrote: Ooooh, thanks, silly me ;D

Argh, now I get:
(6,24) No matching signatures to 'SetEntityCallbackFunc(string@&, removelight)
Help? I can't work until this is fixed...
(This post was last modified: 10-14-2012, 11:47 AM by Rapsis.)
10-14-2012, 11:28 AM
Find
Rapsis Offline
Member

Posts: 69
Threads: 6
Joined: Oct 2012
Reputation: 0
#4
RE: Scripting fatal errors?

(10-14-2012, 11:28 AM)Rapsis Wrote: Ooooh, thanks, silly me ;D

Argh, now I get:
(6,24) No matching signatures to 'SetEntityCallbackFunc(string@&, removelight)

(10-14-2012, 11:28 AM)Rapsis Wrote: Ooooh, thanks, silly me ;D

Argh, now I get:
(6,24) No matching signatures to 'SetEntityCallbackFunc(string@&, removelight)
Help? I can't work until this is fixed...
Alright, I just removed the script, it's not essential, now I made another script where a vase falls of a counter with AddPropForce, but instead of falling off, it simply disappears. Any help?
10-14-2012, 12:33 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#5
RE: Scripting fatal errors?

It disappears? 0_0 Maybe you've added too much force. Mess around with the values and maybe you get something.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-14-2012, 01:14 PM
Find
Rapsis Offline
Member

Posts: 69
Threads: 6
Joined: Oct 2012
Reputation: 0
#6
RE: Scripting fatal errors?

(10-14-2012, 01:14 PM)The chaser Wrote: It disappears? 0_0 Maybe you've added too much force. Mess around with the values and maybe you get something.
It either doesn't move at all or disappears. Thought it was a bug so I removed it, too. Now I made ANOTHER thing, this time it's a statue that the player looks at automaticly:



void OnStart()
{
FadeOut(0);
FadeIn(10);
AddEntityCollideCallback("Player", "Studydooropen", "CollideRoomTwo", true, 0);
AddUseItemCallback("", "bedroomkey_1", "mansion_1", "UsedKeyOnDoor", true);
AddEntityCollideCallback("Player", "Statuescare", "Statuescare", true, 0);
}

void CollideRoomTwo(string &in asParent, string &in asChild, int alState)
{
SetSwingDoorClosed("mansion_2", true, true);
SetSwingDoorLocked("mansion_2", true, true);
SetEntityActive("servant_grunt_1", true);
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("servant_grunt_1", "PathNodeArea_3", 0, "");
}

void UsedKeyOnDoor(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked("mansion_1", false, true);
PlaySoundAtEntity("", "unlock_door", "mansion_1", 0, false);
RemoveItem("bedroomkey_1");
}

void Statuescare(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Statue_1", 75, 100, "");
}



void OnLeave()
{

}

The thing is, it doesn't work. No error or anything, it just doesn't work, he doesn't look at it.
10-14-2012, 01:39 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#7
RE: Scripting fatal errors?

Is Statue_1 a script area? If not, maybe that's the issue. Areas have a center, models don't.

Also, don't abandon every thing because it doesn't work, that's unhealthy for knowledge. And we are here to help, it doesn't matter if you do too much things.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
10-14-2012, 02:57 PM
Find
Rapsis Offline
Member

Posts: 69
Threads: 6
Joined: Oct 2012
Reputation: 0
#8
RE: Scripting fatal errors?

(10-14-2012, 02:57 PM)The chaser Wrote: Is Statue_1 a script area? If not, maybe that's the issue. Areas have a center, models don't.

Also, don't abandon every thing because it doesn't work, that's unhealthy for knowledge. And we are here to help, it doesn't matter if you do too much things.
Oh, yeah, that fixed it, thanks! I have no idea how to make him stop looking at him though :/
10-14-2012, 04:24 PM
Find
Tomato Cat Offline
Senior Member

Posts: 287
Threads: 2
Joined: Sep 2012
Reputation: 20
#9
RE: Scripting fatal errors?

Use StopPlayerLookAt();

Have a timer call it, though. :0

RAISE YOUR DONGERS ヽ༼ຈل͜ຈ༽ノ
(This post was last modified: 10-14-2012, 04:30 PM by Tomato Cat.)
10-14-2012, 04:30 PM
Find
Rapsis Offline
Member

Posts: 69
Threads: 6
Joined: Oct 2012
Reputation: 0
#10
RE: Scripting fatal errors?

Can anyone do this script for me? I tried


void Statuescare(string &in asParent, string &in asChild, int alState)
{
StartPlayerLookAt("Statue_1", 75, 100, "");
AddTimer("Scaretimer_1", 3, "StopPlayerLookAt");
}

But it doesn't work. Not surprised.
(This post was last modified: 10-14-2012, 04:36 PM by Rapsis.)
10-14-2012, 04:36 PM
Find




Users browsing this thread: 3 Guest(s)