SUPPORT ACCOUNT CLANS
Welcome, Unregistered.
 

Thread: Events Triggering when being Attacked

Results 1 to 6 of 6
  1. #1
    Offline
    Account Icon
    Join Date
    Jul 2009
    Location
    Sweden
    Posts
    208

    Events Triggering when being Attacked

    So, I played around a bit to test how evasion and redirection (Zephyr's Wind Shield) affect the different triggers related to being attacked. I added an item with the following code:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <item
    	name="Item_Attacktest"
    
    	icon="icon.tga"
    	
    	cost="100"
    
    	actiontype="passive"
    >
    <onattackedstart>
    	<areaofeffect
    		radius="1000"
    		targetselection="all"
    		targetscheme="enemy_nonboss_units"
    		effecttype=""
    	>
    		<damage effecttype="Splash" amount="100" />
    	</areaofeffect>				
    	<popup name="bonus_damage" a="1" />
    </onattackedstart>
    
    <onattackedpreimpact>		
    	<areaofeffect
    		radius="1000"
    		targetselection="all"
    		targetscheme="enemy_nonboss_units"
    		effecttype=""
    	>
    		<damage effecttype="Splash" amount="200" />
    	</areaofeffect>				
    	<popup name="bonus_damage" a="2" />
    </onattackedpreimpact>
    
    <onattackimpact>		
    	<areaofeffect
    		radius="1000"
    		targetselection="all"
    		targetscheme="enemy_nonboss_units"
    		effecttype=""
    	>
    		<damage effecttype="Splash" amount="400" />
    	</areaofeffect>				
    	<popup name="bonus_damage" a="4" />
    </onattackimpact>
    
    <ondamaged>		
    	<areaofeffect
    		radius="1000"
    		targetselection="all"
    		targetscheme="enemy_nonboss_units"
    		effecttype=""
    	>
    		<damage effecttype="Splash" amount="800" />
    	</areaofeffect>				
    	<popup name="bonus_damage" a="8" />
    </ondamaged>
    </item>
    The onattackedstart, onattackedpreimpact and ondamaged part worked when attacked normally, but the onattackimpact did not. Is it the wrong event or am I doing something else wrong?

    For reference, when evasion or redirection triggers, ondamaged does of course not trigger.
    13^3

    In my posts, cursive grey text indicates very detailed or less relevant information, while blue text highlights important points or conclusions.

  2. #2
    Offline
    S2 Staff Member S2 Games Staff
    Join Date
    Sep 2008
    Posts
    248
    onattack* events are applied to you own attacks at the time of the attack.

    onattacked* is for responding to other units' attacks.

    onattacking* is for responding to your own unit's attacks (this occurs are a slightly different time than onattack*)

    Code:
    onattackstart
    onattack
    onattackpreimpact
    onattackpredamage
    onattackdamageevent
    onattackimpact
    onattackimpactinvalid
    onattackend
    
    onattackedstart
    onattackedpreimpact
    onattackedpredamage
    onattackeddamageevent
    onattackedpostimpact
    
    onattackingstart
    onattackingpreimpact
    onattackingpredamage
    onattackingdamageevent
    onattackingpostimpact
    Also, some other things that may help you:

    Code:
    <print text="Look, I'm text." />
    <printvalue value="source_maxhealth" />
    <printdebuginfo />
    Documentation of all possible events, dynamic values, etc will come in the future.
    Last edited by S2Ikkyo; 10-13-2009 at 05:59 AM.

  3. #3
    Offline
    Account Icon
    Join Date
    Jul 2009
    Location
    Sweden
    Posts
    208
    Thanks, both for the list and the promise of documentation; both of them will help a lot.
    13^3

    In my posts, cursive grey text indicates very detailed or less relevant information, while blue text highlights important points or conclusions.

  4. #4
    Offline
    Account Icon
    Join Date
    Jul 2009
    Location
    a quiet place
    Posts
    1,121
    Ikkyo could we get a Guides and Lists section soon since the stickies are getting crowded.
    Former Master of the Night
    E.S. Posthumus__________________________________________________ __________________________________________________ ___________Nihilsomno, glory forever

  5. #5
    Offline
    S2 Staff Member S2 Games Staff
    Join Date
    Sep 2008
    Posts
    248
    I think a stickied Guides and Lists post would be better.

  6. #6
    Offline
    S2 Staff Member S2 Games Staff
    Join Date
    Jul 2009
    Posts
    33,794
    Moved to Guides & Lists for reference.

    Yes I know the thread is old

    S2 Games: Dedicated employees serving dedicated gamers. Continuous development. Never-ending improvement.
    -----------------------------


    Tech Support and Customer Support: https://www.heroesofnewerth.com/support/


    Look for my highlighted text (important information) and grey text (interesting but not required information).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •