Apjjm
Is easy to say
Posts: 496
Threads: 18
Joined: Apr 2011
Reputation:
52
|
RE: Meanings of Error Messages
(08-22-2011, 03:12 PM)Obliviator27 Wrote: main (31, 39) ERR: Expected expression value
if (GetLocalVarInt("Var1") == 1) && (GetLocalVarInt("Var2") == 1)
This one I can't seem to get right. I'm thinking my script is simply incorrect. There were a few errors here, you had your GetLocalVarInt include the equality comparison operator on the last two ifs, and also I believe the whole if statement block must be in brackets. Fixed:
if (GetLocalVarInt("HasShirt") == 1 && GetLocalVarInt("HasGem") == 1)
{
SetSwingDoorLocked("BedroomDoor", false);
}
if (GetLocalVarInt("HasShirt") == 1 && GetLocalVarInt("HasGem") == 0)
{
SetMessage("OblivScreenText", "ShirtNoGem", 5);
}
if (GetLocalVarInt("HasShirt") == 0 && GetLocalVarInt("HasGem") == 1)
{
SetMessage("OblivScreenText", "GemNoShirt", 5);
}
Quote:main (54, 2) ERR: No Matching Signatures to "AddEntityCollideCallback"
This one throws me off. I've triple checked all of my names in the editor as well as my function names.
You have the boolean true and int 1 arguments the wrong way around - so it is looking for a function with a different signature. Fixed:
AddEntityCollideCallback("Player", "FallBody", "Corpsefall", true, 1);
Quote:main (94, 5) ERR: Timer is not declared.
main (94, 5) ERR: Expression must be of Boolean type
void Function(string &in asTimer)
{
if(timer == "timer_1")
{
//Stuff to happen
}
if (other timers continue)
I can't get this one either. I don't understand, as I've gotten a similarily scripted timer system to work before.
You don't have a variable called "timer". you have a variable called asTimer. Fixed by renaming "asTimer" to timer.
void ClosetScare(string &in timer)
{
if(timer == "closet1")
{
PlaySoundAtEntity("", "scare_slam_door.snt", "cabinet_nice_2", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "DustArea", false);
AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
StartPlayerLookAt("DustArea", 1, 1, "");
}
if(timer == "closet2")
{
PlaySoundAtEntity("", "scare_slam_door.snt", "cabinet_nice_2", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "DustArea", false);
AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
StopPlayerLookAt();
}
if(timer == "closet3")
{
PlaySoundAtEntity("", "scare_slam_door.snt", "cabinet_nice_2", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_impact.ps", "DustArea", false);
AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
}
if (timer == "closet4")
{
PlaySoundAtEntity("", "break_wood.snt", "DustArea", 0, false);
CreateParticleSystemAtEntity("", "ps_dust_break_25.ps", "DustArea", false);
SetSwingDoorLocked("cabinet_nice_2*", false, false);
AddBodyForce("cabinet_nice_2_leftdoor", 0, 0, -1, "world");
AddBodyForce("cabinet_nice_2_rightdoor", 0, 0, -1, "world");
AddEntityCollideCallback("Player", "EndLightArea", "EndLight", 1, true);
}
}
Edit: ninja'd
(This post was last modified: 08-22-2011, 04:02 PM by Apjjm.)
|
|