Author Topic: wishing to destroy the monster when they enter the trigger  (Read 424 times)

Legacy_GrandaddyBonegrinder

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0


               Greetings Ye who hold the knowlwdge!

I am wishing to destroy the monster when they enter the trigger... but only some get destroyed... the rest walk through as if no trigger there... the tags are correct...  plez tell me what I am missing ':blush:'

////////////////////////////////////////////////////////////////////////////////
//Script: dz_s_desyhates
//goes on OnEnter
//
// Created By: GB
// Created On: 4/3/12
////////////////////////////////////////////////////////////////////////////////
void main()
{


        object oTarget = GetEnteringObject();
        if (oTarget == GetObjectByTag("dz_c_bloodrip"))
                    {

            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE), oTarget);
            DelayCommand(1.0, DestroyObject(oTarget));
                     }

        if (oTarget == GetObjectByTag("dz_c_hatemonger"))
                {
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE), oTarget);
            DelayCommand(1.0, DestroyObject(oTarget));
                 }

         if (oTarget == GetObjectByTag("dz_c_hatewings"))
                {
            ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE,FALSE), oTarget);
            DelayCommand(1.0, DestroyObject(oTarget));
                }



}


thanks...



at your service,
'<img'>
               
               

               


                     Modifié par GrandaddyBonegrinder, 17 mai 2012 - 03:08 .
                     
                  


            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
wishing to destroy the monster when they enter the trigger
« Reply #1 on: May 17, 2012, 04:17:31 pm »


               Instead of GetObjectByTag, you'll want to just use GetTag.


void main()
{
object oEnteree = GetEnteringObject();
string sTag = GetTag(oEnteree);

if (sTag == "dz_c_bloodrip" || sTag == "dz_c_hatemonger" || sTag == "dz_c_hatewings")
   {
   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_DIVINE_STRIKE_FIRE), oEnteree);
   DelayCommand(1.0, DestroyObject(oEnteree));
   }
}


               
               

               
            

Legacy_Krevett

  • Full Member
  • ***
  • Posts: 203
  • Karma: +0/-0
wishing to destroy the monster when they enter the trigger
« Reply #2 on: May 17, 2012, 04:18:43 pm »


               Perhaps your if statement should look like if (GetTag(oTarget) == ''dz_c_bloodrip'') etc....
To avoid the script getting the tag for each 'if' statement you can add a line string sTag = GetTag(oTarget);

Edit: owned by the great dragon 
:happy:
               
               

               


                     Modifié par Krevett, 17 mai 2012 - 03:20 .
                     
                  


            

Legacy_GrandaddyBonegrinder

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
wishing to destroy the monster when they enter the trigger
« Reply #3 on: May 17, 2012, 09:29:53 pm »


               thanks... I'll give it a go '' )
               
               

               
            

Legacy_GrandaddyBonegrinder

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
wishing to destroy the monster when they enter the trigger
« Reply #4 on: May 17, 2012, 09:58:48 pm »


               works perfectly!! tks!

BTW - I love your transparent GUI and Colorized icons AD '<img'>

really helps during PvP