attempt to filter attack for an event with no attack data

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
Gwledig
Posts: 569
Joined: March 30th, 2009, 5:10 pm
Location: UK

attempt to filter attack for an event with no attack data

Post by Gwledig »

Hi I have an error in game logs which is
attempt to filter attack for an event with no attack data
I seem to have been able to isolate it by removing stuff step by step, to an event which occurs every turn to remove 'projectiles' off the map or remove them after they have 'attacked' an enemy unit, these are units recruited which look like bullets/arrows/missiles in my Chaoz mod, the idea is that the recruited 'projectile' if unused, is removed on turn refresh -

I think it looks like one of the basic parts of the below, i.e the kill on turn refresh, the issue doesn't seem to happen on other parts of the macro -

just wondering if anyone can see anything which might be causing the error above please?

Code: Select all

#define CHAOZ_KILL_PROJECTILE
#kills projectiles on turn refresh - i.e. unused projectiles
[event]
name=turn refresh
first_time_only=no	
[kill]
role=projectile
animate=no
fire_event=yes
[/kill]
[/event]

#kills individual projectile after it has attacked
[event]
name=attack_end
first_time_only=no
[kill]
role=projectile
side=$side_number
x=$unit.x  
y=$unit.y 
animate=no
fire_event=yes
[/kill]
[/event]

#store villages on side turn for restoring in the event of capture by a projectile
[event]
name="side turn"
first_time_only=no
[store_villages]
variable=allvillages
[/store_villages]
[/event]

#restores villages on capture by a projectile
[event]
name="capture"
first_time_only=no
[filter]
role=projectile
[filter_location]
find_in=allvillages
[/filter_location]
[/filter]
{FOREACH allvillages i}
[if]
[variable]
name=allvillages[$i].x
equals=$x1
[/variable]
[variable]
name=allvillages[$i].y
equals=$y1
[/variable]
[then]
[capture_village]
x,y=$x1,$y1
side=$allvillages[$i].owner_side
[/capture_village]
[/then]
[/if]
{NEXT i}
[/event]


#kills fireball on turn refresh - i.e. unused fireball
[event]
name=turn refresh
first_time_only=no	
[kill]
role=fireball
animate=no
fire_event=yes
[/kill]
[/event]

#kills fireball after it has done normal attack then apply area attack
[event]
name=attack_end
[filter]
role=fireball
side=$side_number
x=$unit.x  
y=$unit.y 
[/filter]
first_time_only=no
[harm_unit] 
[filter]
# We do not hurt our own units
#[not]
#side=$unit.side
#[/not]
[filter_location]
[and]
x,y=$x1,$y1
radius=1
# exclude terrain to be affected by fireball
#[filter_radius]
#terrain=!,X*,X*^*,*^X*
#[/filter_radius]
[/and]
[/filter_location]
[/filter]
amount=50
[/harm_unit] 
[kill]
role=fireball
side=$side_number
x=$unit.x  
y=$unit.y 
animate=no
fire_event=yes
[/kill]
[/event]
#enddef

#restores villages on capture by a fireball
[event]
name="capture"
first_time_only=no
[filter]
role=fireball
[filter_location]
find_in=allvillages
[/filter_location]
[/filter]
{FOREACH allvillages i}
[if]
[variable]
name=allvillages[$i].x
equals=$x1
[/variable]
[variable]
name=allvillages[$i].y
equals=$y1
[/variable]
[then]
[capture_village]
x,y=$x1,$y1
side=$allvillages[$i].owner_side
[/capture_village]
[/then]
[/if]
{NEXT i}
[/event]
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: attempt to filter attack for an event with no attack data

Post by Ravana »

I guess [kill] with fire_event could fire combat event which expects attack data.
User avatar
Gwledig
Posts: 569
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: attempt to filter attack for an event with no attack data

Post by Gwledig »

Is there anything really generic I could add in there to make it a real attack or something, bear in mind I'm only trying to clear a unit off the map, perhaps there is another way to do it, I wonder if it's because this ia fog clearer type unit...
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
User avatar
octalot
General Code Maintainer
Posts: 786
Joined: July 17th, 2010, 7:40 pm
Location: Austria

Re: attempt to filter attack for an event with no attack data

Post by octalot »

The error is being triggered in EVENT_WEAPON_SPECIAL_PICKPOCKET, and can be avoided by adding another filter to that event:

Code: Select all

[filter_second]
    [not]
        x,y=$x1,$y1
    [/not]
[/filter_second]
Found it by checking for which events are using a [filter_second_attack].

The [kill] tag has optional subtags [secondary_unit] and [secondary_attack]. If [secondary_unit] isn't present, the variable second_unit in each of the die and last breath events is always the same as the variable unit (the dying unit).
User avatar
Gwledig
Posts: 569
Joined: March 30th, 2009, 5:10 pm
Location: UK

Re: attempt to filter attack for an event with no attack data

Post by Gwledig »

Thanks I'll give it a go....
Maintainer of Conquest (Original Gameplay), Conquest+, Conquest+ Space/Ranged, Chaoz Battle of the Wizards, Lazersquad (squad game), WesCraft (building MP game)
Post Reply