Help needed for "name=attacker hits" event

The place to post your WML questions and answers.

Moderator: Forum Moderators

Forum rules
  • Please use [code] BBCode tags in your posts for embedding WML snippets.
  • To keep your code readable so that others can easily help you, make sure to indent it following our conventions.
Post Reply
User avatar
pipapopinguin
Posts: 35
Joined: November 3rd, 2019, 10:36 am

Help needed for "name=attacker hits" event

Post by pipapopinguin »

Code: Select all

 #define WEAPON_SPECIAL_BLASTINGBURST
[dummy]
id=blasted_burst
name= "unpredictable inferno"
[/dummy]
[/specials]
[event]
first_time_only=no
id=burst_event
name=attacker hits
[filter_attack]
    name=dragonstaff2
[/filter_attack]
[message]
message="I've been triggered"
[/message] 
[/event]
[+abilities]
#enddef 
I've tried this code just with some more direct and internal actions after [/message], however the message wont even pop-up, which i placed there to see if the event even triggers. When I inspect in debug mode, I cant even see any event with "name=attacker hits". If you are interested to see the attack code from the unit:

Code: Select all

    [attack]
        name=dragonstaff2
        description=_"ol'blasting burst"
        type=pierce
        range=ranged
        damage=1
        number=1
        icon=attacks/dragonstaff.png
		[specials]
		    {WEAPON_SPECIAL_BLASTINGBURST}
		[/specials]
    [/attack]
Author of Corpse Mod 2, Breeze-Mod,Reflections and don't click here.
User avatar
WhiteWolf
Forum Moderator
Posts: 769
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: Help needed for "name=attacker hits" event

Post by WhiteWolf »

To be honest, I find it strange that this even starts with the game. :) Opening and closing tags don't match: you close [specials], leaving it currently in an [attack], putting an event there (which won't work in an [attack] tag), and then you open a [+abilities] tag, that's getting closed by [/specials].

The correct way to do this with a macro like this would be:

Code: Select all

#define WEAPON_SPECIAL_BLASTINGBURST
        [dummy]
            id=blasted_burst
            name= "unpredictable inferno"
        [/dummy]
    [/specials]
[/attack]

your event here

[+attack]
    [+specials]
#enddef
Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: The Underness Series, consisting of 5 parts: The Desolation of Karlag, The Blind Sentinel, The Stone of the North, The Invasion Of The Western Cavalry, Fingerbone of Destiny
User avatar
pipapopinguin
Posts: 35
Joined: November 3rd, 2019, 10:36 am

Re: Help needed for "name=attacker hits" event

Post by pipapopinguin »

This helped a lot, thanks
Author of Corpse Mod 2, Breeze-Mod,Reflections and don't click here.
Post Reply