Skip to content

Destroy Placeable Animation?

ZephiriusZephirius Member Posts: 411
edited March 2022 in Builders - Scripting
How do you get a placeable to "explode", when a spell is cast at it?
void main()
{

    object oPC = GetEnteringObject();
    if (!GetIsPC(oPC)) return;

    int nOnce = GetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF));
    if (nOnce == TRUE)
    {
        return;
    }
    SetLocalInt(OBJECT_SELF, GetTag(OBJECT_SELF), TRUE);

    object oCaster;
    object oDoor;
    object oCandleabra;
    object oBed;
    
    oCaster = GetObjectByTag("LIGHTNING_001");
    oDoor = GetObjectByTag("ALTAR_DOOR");
    oCandleabra = GetObjectByTag("CANDLEABRA");
    oBed = GetObjectByTag("BED");

   

    AssignCommand(oCaster, ActionCastSpellAtObject(SPELL_CHAIN_LIGHTNING, oBed,
    METAMAGIC_ANY, TRUE, 0, PROJECTILE_PATH_TYPE_DEFAULT, TRUE));

    DoPlaceableObjectAction(oCandleabra, PLACEABLE_ACTION_BASH);
    DelayCommand(1.5, DoPlaceableObjectAction(oBed, PLACEABLE_ACTION_BASH));

    DelayCommand(2.0, AssignCommand(oDoor, ActionPlayAnimation(ANIMATION_DOOR_DESTROY)));

}

I tried a search with no luck. I didn't see anything useful with the lexicon either baring the code above...
The only thing that works with this script is the spell (chain lightning). No exploding placeables???

Comments

  • TarotRedhandTarotRedhand Member Posts: 1,481
    Have a look at my Fun Doors package. There are exploding doors in there and the script that does that can equally go in the OnDamaged script slot of a placeable.

    TR
  • ZephiriusZephirius Member Posts: 411
    Oh, why thanks you very much. Going to check it out now!
  • TarotRedhandTarotRedhand Member Posts: 1,481
    If you have any problems with it just let me know.

    TR
  • ZephiriusZephirius Member Posts: 411
    These are awesome, if not a bit sadistic! >:) Lol
  • TarotRedhandTarotRedhand Member Posts: 1,481
    Nah, just a bit of "Electro-Shock" therapy for those addicted to "If it moves hit it and if it doesn't move, hit until it does"... o:)

    BTW, Have you got the scripting FAQs (Frequently Asked Questions, with answers) yet?

    TR
  • ZephiriusZephirius Member Posts: 411
    I hadn't. I've downloaded them and am going to check them out. Thanks for the "Electro" code and the link.
  • ZephiriusZephirius Member Posts: 411
    Okay. That didn't take long. One glance at all of the .pdf's told me all I need to know. These are a must have for all levels of experience! Thanks again! B)
  • MelkiorMelkior Member Posts: 179
    Nah, just a bit of "Electro-Shock" therapy for those addicted to "If it moves hit it and if it doesn't move, hit until it does"... o:)

    BTW, Have you got the scripting FAQs (Frequently Asked Questions, with answers) yet?

    TR

    I used to DM a module which had a few decorative (and immortal) chickens near the starting point. The first thing many new players would do is go and attack the chickens. It was great fun to DM-invisibly set a few epic sonic traps around the chickens. :smiley::dizzy:
Sign In or Register to comment.