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


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Restoring broken item
Damascus Offline
Senior Member

Posts: 646
Threads: 118
Joined: Mar 2012
Reputation: 29
#8
RE: Restoring broken item

Okay, I was stupid. The part of the script that was creating the new item wasn't resetting the timer. Now that I've fixed that, the item respawns endlessly. BUT, I have a new problem. When I break the first item within BlowPillarArea, the BlowPillar timer activates. However, with the new items that are produced, they do not trigger the timer, even if they are within BlowPillarArea. Instead, they simply respawn again.

This is especially odd because I know the new items all must have the same name, otherwise the script that is respawning them wouldn't work either!

PHP Code: (Select All)
void OnStart()
{
    
AddEntityCollideCallback("potash_1""BlowPillarArea""PillarVar"false0);
}

void PillarVar(string &in asParentstring &in asChildint alState)
{
    if (
alState == 1)
    {
        
SetLocalVarInt("Pillar"1);
    }
    else if (
alState == -1)
    {
        
SetLocalVarInt("Pillar"0);
    }
}

void CheckGold(string &in asTimer)
{
    if (
GetPropHealth("potash_1") < 1)
    {
        if (
GetLocalVarInt("Pillar") == 1)
        {
            
AddTimer(""1.0f"BlowPillar");
            
SetEntityActive("SignArea_1"false);
        }
        else
        {
            
CreateEntityAtArea("potash_1""crystal_rock_02.ent""FulmGoldArea"false);
            
AddTimer("check"0.1f"CheckGold");
        }
    }
    else
    {
        
AddTimer("check"0.1f"CheckGold");
    }


(This post was last modified: 08-05-2013, 06:30 AM by Damascus.)
08-05-2013, 06:02 AM
Find


Messages In This Thread
Restoring broken item - by Damascus - 08-04-2013, 04:05 AM
RE: Restoring broken item - by 7heDubz - 08-04-2013, 05:13 AM
RE: Restoring broken item - by Daemian - 08-04-2013, 05:20 AM
RE: Restoring broken item - by Damascus - 08-04-2013, 05:48 AM
RE: Restoring broken item - by Your Computer - 08-04-2013, 09:48 AM
RE: Restoring broken item - by Statyk - 08-05-2013, 03:19 AM
RE: Restoring broken item - by Damascus - 08-05-2013, 06:02 AM
RE: Restoring broken item - by Daemian - 08-05-2013, 05:57 AM
RE: Restoring broken item - by Adrianis - 08-05-2013, 12:25 PM
RE: Restoring broken item - by Damascus - 08-05-2013, 10:43 PM
RE: Restoring broken item - by Adrianis - 08-06-2013, 10:53 AM
RE: Restoring broken item - by Damascus - 08-07-2013, 01:40 AM
RE: Restoring broken item - by Damascus - 08-07-2013, 04:30 AM
RE: Restoring broken item - by Adrianis - 08-07-2013, 09:40 AM
RE: Restoring broken item - by Damascus - 08-07-2013, 08:51 PM
RE: Restoring broken item - by Adrianis - 08-07-2013, 10:27 PM
RE: Restoring broken item - by Damascus - 08-08-2013, 12:24 AM
RE: Restoring broken item - by Adrianis - 08-08-2013, 11:11 AM
RE: Restoring broken item - by Damascus - 08-08-2013, 09:26 PM



Users browsing this thread: 8 Guest(s)