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
#4
RE: Restoring broken item

@WIWWM: Yeah, it is crucial the story that it breaks, but only under certain circumstances.

(08-04-2013, 05:20 AM)Amn Wrote: Hey DAmascus ;p
I think you're gonna have to create the entity again along with its callbacks.
It worked fine for me.

I used CreateEntityAtArea to respawn it, and it worked... twice. After I broke the item for the third time, it stopped coming back. I repeated the experiment several times, but every time, the CreateEntityAtArea only triggered twice. I'll include my code here:

PHP Code: (Select All)
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);
        }
    }
    else
    {
        
AddTimer("check"0.1f"CheckGold");
    }


Basically, this timer is constantly checking the health of the item. Once it breaks, if it's inside the proper area, a custom script is triggered. If it's not, a new item should respawn at FulmGoldArea.

(This post was last modified: 08-04-2013, 05:55 AM by Damascus.)
08-04-2013, 05:48 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: 5 Guest(s)