Frictional Games Forum (read-only)
What's wrong with this script? - 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: What's wrong with this script? (/thread-13624.html)



What's wrong with this script? - Shadowfied - 02-27-2012

Sorry guys, I just can't find out why this script won't work.

Spoiler below!
PHP Code:
void BlueRodFunc (string &in asItemstring &in asEntity)
{
    
RemoveItem(asItem);
    
SetEntityActive("BlueStatic"true);
    
AddGlobalVarInt("rodmachine"1);
    
GetGlobalVarInt("rodmachine");
    {
    if(
GetGlobalVarInt("rodmachine") == 0)
    
//..
    
}
    if(
GetGlobalVarInt("rodmachine") == 1)
    {
    
//..
    
}
    if(
GetGlobalVarInt("rodmachine") == 2)
    {
    
//..
    
}
    if(
GetGlobalVarInt("rodmachine") == 3)
    {
    
SetMessage("Messages""DoneRodsQuestM"0);
    
CompleteQuest("rodq""RodsQuest"); 
    }



Any ideas?



RE: What's wrong with this script? - palistov - 02-27-2012

GetGlobalVarInt("rodmachine");
{
if(GetGlobalVarInt("rodmachine") == 0)
//..
}

Switch the if line and the opening brace. Also GetGlobalVarInt("rodmachine"); does nothing by itself. No reason to have it there.


RE: What's wrong with this script? - Shadowfied - 02-27-2012

(02-27-2012, 10:50 AM)palistov Wrote: GetGlobalVarInt("rodmachine");
{
if(GetGlobalVarInt("rodmachine") == 0)
//..
}

Switch the if line and the opening brace. Also GetGlobalVarInt("rodmachine"); does nothing by itself. No reason to have it there.
Thanks man!