The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Woah... This shouldn't be happening..
Zypherzemus Offline
Member

Posts: 94
Threads: 7
Joined: Jul 2011
Reputation: 0
#1
Exclamation  Woah... This shouldn't be happening..

Okay.. so... It's kinda hard to explain. But..
I have a Collide callback set up to where when you run into it, 2 level doors disappear and monsters are spawned then swarm out of the "rooms" thing is, they aren't rooms, all that's behind the level doors is a a floor, So.. when I walk into the collide area, the monsters do spawn and the doors do disappear.. but both floors are gone.. as if there were no floors there to begin with. Help?

I'm also having a small key problem that goes along with this one, I have an if statement set.
void OnEnter()
{
"if (HasItem("key_1") == true)
{
AddEntityCollideCallback(blah, blah,blah)
}
}
thing is.. I'd have to leave the level then come back in (with the key) in order for the CollideCallback to activate, but the key is on the same map as the Collide area.

Here's teh. Script
/////////////////////////////
// Run first time starting map
void OnStart()
{
    AddEntityCollideCallback("Player", "ScriptArea_1", "LightArea", true, 1);
    AddEntityCollideCallback("Player", "ScriptArea_2", "LightArea_2", true, 1);
    SetLocalVarInt("IsDoorunLocked", 0);
        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("Unlock", "labkey_1", "labdoor", "UseKeyOnDoor_6", true);
    SetLevelDoorLockedText("labdoor", "Message", "lablocked");
    SetLevelDoorLockedText("girlsdormdoor", "Message", "girlsdormlocked");
    SetEntityPlayerInteractCallback("lloydsoffice", "InteractLloydsOffice", 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);
        }
    if (HasItem("labkey_1") == true)
        {
            AddEntityCollideCallback("Player", "MonsterAttack", "MonsterAttackArea", true, 1);
            AddEntityCollideCallback("Player", "ScriptArea_4", "LightArea_3", true, 1);
            AddEntityCollideCallback("Player", "ScriptArea_5", "LightArea_4", true, 1);
            AddEntityCollideCallback("Player", "ScriptArea_6", "LightArea_5", true, 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)
{
    SetLocalVarInt("IsDoorunLocked", 1);
    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);
}

void StartCredits(string &in asEntity)
{
if(GetLocalVarInt("IsDoorunLocked") == 1)
{
FadeOut(2.0f);
StartCredits("01_Vicarious.ogg", false, "Ending", "MainCredits", 1);
}
}


void MonsterAttackArea(string &in asParent, string &in asChild, int alState)
{
AddTimer("", 0.0f, "StartAttack");
}


void StartAttack(string &in asTimer)
{
PlaySoundAtEntity("boom", "break_wood_metal.snt", "boysdormdoor", 0.0f, false);
PlaySoundAtEntity("boom2", "break_wood_metal.snt", "girlsdormdoor", 0.0f, false);
SetEntityActive("boysdormdoor", false);
SetEntityActive("girlsdormdoor", false);
SetEntityActive("servant_brute_1", true);
SetEntityActive("servant_brute_2", true);
SetEntityActive("servant_brute_3", true);
SetEntityActive("servant_grunt_1", true);
SetEntityActive("servant_grunt_2", true);
SetEntityActive("servant_grunt_3", true);
SetEntityActive("enemy_suitor_malo_1", true);
}


void LightArea_3(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candlestick_wall_16", false, true);
SetLampLit("candlestick_wall_15", false, true);
SetLampLit("candlestick_wall_14", false, true);
SetLampLit("candlestick_wall_1", false, true);
SetLampLit("candlestick_wall_2", false, true);
SetLampLit("candlestick_wall_3", false, true);
}


void LightArea_4(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candlestick_wall_13", false, true);
SetLampLit("candlestick_wall_12", false, true);
SetLampLit("candlestick_wall_11", false, true);
SetLampLit("candlestick_wall_10", false, true);
SetLampLit("candlestick_wall_4", false, true);
SetLampLit("candlestick_wall_5", false, true);
SetLampLit("candlestick_wall_6", false, true);
SetLampLit("candlestick_wall_7", false, true);
AddTimer("", 0.0f, "SlamDoor1");
}


void LightArea_5(string &in asParent, string &in asChild, int alState)
{
SetLampLit("candlestick_wall_8", false, true);
SetLampLit("candlestick_wall_9", false, true);
SetLampLit("candlestick_wall_20", false, true);
SetLampLit("candlestick_wall_21", false, true);
SetLampLit("candlestick_wall_22", false, true);
SetLampLit("candlestick_wall_19", false, true);
SetLampLit("candlestick_wall_18", false, true);
SetLampLit("candlestick_wall_17", false, true);
AddTimer("", 0.0f, "SlamDoor2");
}


void SlamDoor1(string &in asTimer)
{
SetSwingDoorClosed("mansion_7", true, false);
}


void SlamDoor2(string &in asTimer)
{
SetSwingDoorClosed("mansion_4", true, false);
}

////////////////////////////
// Run when leaving map
void OnLeave()
{
    StopMusic(1.0f, 1);
    SetGlobalVarInt("music", 0);
}

P.S. Still having trouble with getting the demo to end, Help would really be appreciated.
(This post was last modified: 07-22-2011, 03:27 AM by Zypherzemus.)
07-22-2011, 03:26 AM
Find


Messages In This Thread
Woah... This shouldn't be happening.. - by Zypherzemus - 07-22-2011, 03:26 AM



Users browsing this thread: 1 Guest(s)