Frictional Games Forum (read-only)
[SCRIPT] Why won't this script work? - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: [SCRIPT] Why won't this script work? (/thread-13201.html)



Why won't this script work? - Shadowfied - 02-09-2012

Sorry for posting so many topics, but I am so frustrated right now. I've gone through this script 5000 times and I just can't find what's wrong.

Spoiler below!
PHP Code:
void LadderShit (string &in asEntity)
{
    
GetLocalVarInt("ladderbank");
    {
    if(
GetLocalVarInt("ladderbank") == 0)
    }
    if(
GetLocalVarInt("ladderbank") == 1)
    {
        
SetPropStaticPhysics("ladder"false);
    }



Having that one in my script file gives me random errors, and if I remove it the map works fine. You might find something wrong with it, but I have another script that is I-F*CKING-DENTICAL TO THAT ONE but it still works, which is this one:

Spoiler below!
PHP Code:
void InteractFirstDoor (string &in asEntity)
{
    
GetLocalVarInt("doorinteractbank");
    {
    if(
GetLocalVarInt("doorinteractbank") == 0)
    
SetMessage("Messages""ReadFirst"0);
    }
    if(
GetLocalVarInt("doorinteractbank") == 1)
    {
    
    }



How come the bottom one works and the top one doesn't? I've tried EVERYTHING..

I am so frustrated..



RE: Why won't this script work? - flamez3 - 02-09-2012

What error comes up.


RE: Why won't this script work? - Shadowfied - 02-09-2012

(02-09-2012, 03:52 PM)flamez3 Wrote: What error comes up.
They're mostly random stuff and mostly about other scripts which aren't actually wrong cause they work perfectly fine when I remove this script.

Right now it's just "Unexpected end of file", which it actually isn't, cause again, as soon as I remove it, the map works fine.



RE: Why won't this script work? - flamez3 - 02-09-2012

I reckon I needa see the whole script before I can tell you what's wrong.


RE: Why won't this script work? - Shadowfied - 02-09-2012

Here's another error.

[Image: p7Keal.jpg]

Also, what does it mean "conversion from double to float"?



RE: Why won't this script work? - Your Computer - 02-09-2012

The bottom one works because the curly brackets legally follow the syntax.

(02-09-2012, 03:55 PM)Shadowfied Wrote: Here's another error.

Also, what does it mean "conversion from double to float"?

Sounds like you forgot to close something (e.g. a string).

It means you didn't put an f at the end of the number. (Note, script warnings do not crash the game.)