P44RTHURN4X
Junior Member
Posts: 35
Threads: 16
Joined: Apr 2012
Reputation:
0
|
Again an Error Message -.-
Hey all,
I'm... Ah don't worry. Ehm, there is an errmessage:
FATAL ERROR: blablabla...
main (134,11) : ERR : Expected data type
Yes, I know my mistake but I want to know, what the right syntax type for this is:
[line 32]
SetLanternLitCallback("l04");
[line 134 - 143]
void l04(true)
{
SetEnemyDisableTrigger("serv", true);
AddEnemyPatrolNode("serv", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_5", 0, "");
AddEntityCollideCallback("serv", "show_1", "lo010");
}
in the frictional games wiki is this:
void SetLanternLitCallback(string& asCallback);
Sets the function to call when the player uses his lantern.
Callback syntax: MyFunc(bool abLit)
What is bool abLit? true or false? Please tell me!
GReeZe' P44
|
|
05-28-2012, 10:18 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Again an Error Message -.-
You need to do research on the difference between parameters and arguments.
|
|
05-28-2012, 10:30 AM |
|
FlawlessHappiness
Posting Freak
Posts: 3,980
Threads: 145
Joined: Mar 2012
Reputation:
171
|
RE: Again an Error Message -.-
What is it exactly you want to do?
If you want the monster to spawn IF the lantern is lit i would use a "get" script.
And yes bool is usually true and false
Quote:main (134,11) : ERR : Expected data type
[line 32]
SetLanternLitCallback("l04");
[line 134 - 143]
void l04(true) < this is 'MyFunc'. I guess it should be: void l04(bool abLit). Or am i wrong?
{
SetEnemyDisableTrigger("serv", true);
AddEnemyPatrolNode("serv", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_5", 0, "");
AddEntityCollideCallback("serv", "show_1", "lo010");
}
Trying is the first step to success.
|
|
05-28-2012, 11:04 AM |
|
jens
Frictional Games
Posts: 4,093
Threads: 199
Joined: Apr 2006
Reputation:
202
|
RE: Again an Error Message -.-
Make
void l04(true)
{
SetEnemyDisableTrigger("serv", true);
AddEnemyPatrolNode("serv", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_5", 0, "");
AddEntityCollideCallback("serv", "show_1", "lo010");
}
into
void l04(bool abLit)
{
SetEnemyDisableTrigger("serv", true);
AddEnemyPatrolNode("serv", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_5", 0, "");
AddEntityCollideCallback("serv", "show_1", "lo010");
}
abLit is a parameter, meaning it is a bool with the value of either true or false. When you turn the lantern on it will be true and when you turn it off it will be false. So you can then use this parameter to do different things, as you know if the lantern is on or off from it.
So if you want to trigger the enemy patrol only when turning the lantern on you would do something like:
void l04(true)
{
if(!abLit) return; //If abLit is false, do not continue. So only when abLit is true will it do the lines below this line.
SetEnemyDisableTrigger("serv", true);
AddEnemyPatrolNode("serv", "PathNodeArea_1", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_2", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_3", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_4", 0, "");
AddEnemyPatrolNode("serv", "PathNodeArea_5", 0, "");
AddEntityCollideCallback("serv", "show_1", "lo010");
}
(This post was last modified: 05-28-2012, 11:16 AM by jens.)
|
|
05-28-2012, 11:13 AM |
|
Your Computer
SCAN ME!
Posts: 3,456
Threads: 32
Joined: Jul 2011
Reputation:
235
|
RE: Again an Error Message -.-
His next errors will (should) be no matching signatures to SetEnemyDisableTrigger(string, bool) and AddEntityCollideCallback(string, string, string).
(This post was last modified: 05-28-2012, 01:27 PM by Your Computer.)
|
|
05-28-2012, 01:25 PM |
|
|