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
Meanings of Error Messages
Apjjm Offline
Is easy to say

Posts: 496
Threads: 18
Joined: Apr 2011
Reputation: 52
#5
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 Wink
(This post was last modified: 08-22-2011, 04:02 PM by Apjjm.)
08-22-2011, 03:59 PM
Find


Messages In This Thread
Meanings of Error Messages - by Obliviator27 - 08-22-2011, 03:12 PM
RE: Meanings of Error Messages - by MrBigzy - 08-22-2011, 03:33 PM
RE: Meanings of Error Messages - by Obliviator27 - 08-22-2011, 03:37 PM
RE: Meanings of Error Messages - by Kyle - 08-22-2011, 03:53 PM
RE: Meanings of Error Messages - by Apjjm - 08-22-2011, 03:59 PM
RE: Meanings of Error Messages - by Obliviator27 - 08-22-2011, 04:01 PM



Users browsing this thread: 2 Guest(s)