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
Explosion Script Problem
phatdoggi Offline
Junior Member

Posts: 17
Threads: 4
Joined: Jun 2013
Reputation: 0
#1
Explosion Script Problem

I have searched and experimented high and low, but this script got the better of me. I have an epoxy container (entity:"ready") and I want to throw a rock at it to make a nice explosion to clear some debris. The only problem is the collision callback. I have 3 rocks to use, and I added a collision callback to the container for each of them, but the game still won't run the callback. All that happens is the container fizzles silently and disappears. Any help is appreciated.

void interactDoor(string &in asEntity)
{
    SetPropHealth("scareDoor", 10.0f);
    CreateParticleSystemAtEntity("ps1", "ps_break_wood.ps", "areaDoorDust", true);
    GiveSanityDamage(15.0f, true);
    PlaySoundAtEntity("", "react_breath.snt", "Player", 0, false);
    PlayMusic("amb_extra02.ogg", true, 0.3f, 1, 1, true);
    
    AddEntityCollideCallback("ready", "rock1", "collideBoom", true, 1);
    AddEntityCollideCallback("ready", "rock2", "collideBoom", true, 1);
    AddEntityCollideCallback("ready", "rock3", "collideBoom", true, 1);
}

void collideBoom(string &in asParent, string &in asChild, int alState)
{
    AddTimer("sound", 1, "timerBoom");
    AddTimer("1", 4, "timerBoom");
}

void timerBoom(string &in asTimer)
{
    if(asTimer == "sound"){
        PlaySoundAtEntity("", "12_epoxy_blow", "caveIn", 0, false);
        StartScreenShake(0.01, 0, 0, 2.9f);
        return;
    }
    
    SetPropHealth("caveIn", 0);
    
    StartScreenShake(0.08, 2.5f, 0, 1.0f);
    
    FadeImageTrailTo(0.5, 1);
}

"Just drink it. How bad could it be?"
Madness - http://www.moddb.com/mods/phatdoggi-madness
(This post was last modified: 07-07-2013, 02:31 AM by phatdoggi.)
07-07-2013, 12:31 AM
Find
phatdoggi Offline
Junior Member

Posts: 17
Threads: 4
Joined: Jun 2013
Reputation: 0
#2
RE: Explosion Script Problem

FIXED.

Used a OnIgnite Callback called in the MAP, not the SCRIPT.
*facepalm*

For those of you with the same problem, put your callback name in the "Callback" under the entity tab on your object you want interacted (or in this case ignited).

Thanks for the moral support, people. Tongue

"Just drink it. How bad could it be?"
Madness - http://www.moddb.com/mods/phatdoggi-madness
07-07-2013, 02:30 AM
Find
Artyom Offline
Senior Member

Posts: 370
Threads: 27
Joined: Jul 2012
Reputation: 11
#3
RE: Explosion Script Problem

(07-07-2013, 02:30 AM)phatdoggi Wrote: FIXED.

Used a OnIgnite Callback called in the MAP, not the SCRIPT.
*facepalm*

For those of you with the same problem, put your callback name in the "Callback" under the entity tab on your object you want interacted (or in this case ignited).

Thanks for the moral support, people. Tongue

Good job sorting it out Wink

- Inactive account -
07-07-2013, 02:45 AM
Find




Users browsing this thread: 3 Guest(s)