Facebook Twitter YouTube Frictional Games | Forum | Newsletter | Dev Blog | Dev Wiki | Support | Gametee


Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to end custom story as a Demo?
Author Message
Zypherzemus Offline
Member

Posts: 94
Joined: Jul 2011
Reputation: 0
Post: #29
RE: How to end custom story as a Demo?

FATAL ERROR:
(136, 5) No matching signatures to 'GetLevelDoorLocked(string@&)
(136, 35) No conversion from bool to int available.
/////////////////////////////
// Run first time starting map
void OnStart()
{
    AddEntityCollideCallback("Player", "ScriptArea_1", "LightArea", true, 1);
    AddEntityCollideCallback("Player", "ScriptArea_2", "LightArea_2", true, 1);
        if (HasItem("girlsdormkey_1") == true)
     {
          RemoveItem("girlsdormkey_1");
          GiveItem("girlsdormkey_1", "key_tower.ent", "girlsdormkey", "", 1.0f);
     }
}

void LightArea(string &in asParent, string &in asChild, int alState)
{
    SetGlobalVarInt("music", 1);
    AddTimer("", 1.0f, "lightarea_1");
    AddTimer("", 2.0f, "lightarea_2");
    AddTimer("", 3.0f, "lightarea_3");
    AddTimer("", 4.0f, "lightarea_4");
}

void lightarea_1(string &in asTimer)
{
    SetLampLit("torch_static_green_8", true, true);
    SetLampLit("torch_static_green_1", true, true);
}

void lightarea_2(string &in asTimer)
{
    SetLampLit("torch_static_green_7", true, true);
    SetLampLit("torch_static_green_2", true, true);
}

void lightarea_3(string &in asTimer)
{
    SetLampLit("torch_static_green_6", true, true);
    SetLampLit("torch_static_green_3", true, true);
}

void lightarea_4(string &in asTimer)
{
    SetLampLit("torch_static_green_5", true, true);
    SetLampLit("torch_static_green_4", true, true);
}

void LightArea_2(string &in asParent, string &in asChild, int alState)
{
    AddTimer("", 0.5f, "lightarea_5");
    AddTimer("", 1.0f, "lightarea_6");
    AddTimer("", 1.5f, "lightarea_7");
    AddTimer("", 2.0f, "lightarea_8");
    AddTimer("", 2.5f, "lightarea_9");
    AddTimer("", 3.0f, "lightarea_10");
    AddTimer("", 3.5f, "lightarea_11");
    AddTimer("", 4.0f, "lightarea_12");
}

void lightarea_5(string &in asTimer)
{
    SetLampLit("torch_static_green_12", true, true);
    SetLampLit("torch_static_green_9", true, true);
}

void lightarea_6(string &in asTimer)
{
    SetLampLit("torch_static_green_11", true, true);
    SetLampLit("torch_static_green_13", true, true);
}

void lightarea_7(string &in asTimer)
{
    SetLampLit("torch_static_green_10", true, true);
    SetLampLit("torch_static_green_14", true, true);
}

void lightarea_8(string &in asTimer)
{
    SetLampLit("torch_static_green_15", true, true);
    SetLampLit("torch_static_green_20", true, true);
}

void lightarea_9(string &in asTimer)
{
    SetLampLit("torch_static_green_16", true, true);
    SetLampLit("torch_static_green_21", true, true);
}

void lightarea_10(string &in asTimer)
{
    SetLampLit("torch_static_green_17", true, true);
    SetLampLit("torch_static_green_22", true, true);
}

void lightarea_11(string &in asTimer)
{
    SetLampLit("torch_static_green_18", true, true);
    SetLampLit("torch_static_green_23", true, true);
}

void lightarea_12(string &in asTimer)
{
    SetLampLit("torch_static_green_19", true, true);
    SetLampLit("torch_static_green_24", true, true);
}


////////////////////////////
// Run when entering map
void OnEnter()
{
    AddUseItemCallback("", "girlsdormkey_1", "girlsdormdoor", "UsedKeyOnDoor_5", true);
    AddUseItemCallback("", "lloydskey_1", "lloydsoffice", "UsedKeyOnDoor_10", true);
    AddUseItemCallback("", "labkey_1", "labdoor", "UseKeyOnDoor_6", true);
    SetLevelDoorLockedText("labdoor", "Message", "lablocked");
    SetLevelDoorLockedText("girlsdormdoor", "Message", "girlsdormlocked");
    SetEntityPlayerInteractCallback("lloydsoffice", "InteractLloydsOffice", false);
    SetEntityPlayerInteractCallback("labdoor", "DemoCredits", false);
    if (GetGlobalVarInt("music") == 0)
        {
        PlayMusic("02_amb_safe.ogg", true, 100.0, 0.0, 1, true);
        }
    else if (GetGlobalVarInt("music") == 1)
        {
            PlayMusic("09_amb_safe.ogg", true, 100.0, 0.0, 1, true);
        }
        
        


}


void DemoCredits(string &in asEntity)
{
if (GetLevelDoorLocked("labdoor") == false)
    {
    FadeOut(2.0f);
    AddTimer("", 2.0f, "DemoCredits2");
    }
}
        
void DemoCredits2(string &in asTimer)
{
    StartCredits("01_Vicarious.ogg", false, "Ending", "MainCredits", 1);
}        
        
        
void InteractLloydsOffice(string &in asEntity)
{
    SetMessage("Message", "lloydsdoor", 0);
}


void UsedKeyOnDoor_5(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("girlsdormdoor", false);
    PlaySoundAtEntity("", "unlock_door", "girlsdormdoor", 0, false);
    RemoveItem("girlsdormkey_1");
}

void UseKeyOnDoor_6(string &in asItem, string &in asEntity)
{
    SetLevelDoorLocked("labdoor", false);
    PlaySoundAtEntity("", "unlock_door", "labdoor", 0, false);
    RemoveItem("labkey_1");
}

void UsedKeyOnDoor_10(string &in asItem, string &in asEntity)
{
    SetSwingDoorLocked("lloydsoffice", false, true);
    PlaySoundAtEntity("", "unlock_door", "lloydsoffice", 0, false);
    RemoveItem("lloydskey_1");
    SetMessage("Message", "lloydsdooropen", 0);
}


////////////////////////////
// Run when leaving map
void OnLeave()
{
    StopMusic(1.0f, 1);
    SetGlobalVarInt("music", 0);
}
(This post was last modified: 07-15-2011 12:53 AM by Zypherzemus.)
07-15-2011 12:44 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: How to end custom story as a Demo? - Zypherzemus - 07-15-2011 12:44 AM



User(s) browsing this thread: 1 Guest(s)