[Help]Moveto events and attacking?
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.
-
- Posts: 38
- Joined: June 17th, 2011, 1:26 am
[Help]Moveto events and attacking?
Hi all,
I am being plauged by a very annoying bug caused by a single fact: When a unit is selected, an overlay appears on screen, darkening any areas the unit can't reach. When the unit is ordered to attack an enemy, the overlay stays on-screen while the unit moves, and only disappears when the attack starts.
The problem occurs when a unit attempts to attack an enemy, and triggers a moveto event when moving into position. The overlay stays put until the moveto event ends! Is there any way around this? I've tried using an 'advance' event, but the wiki doesn't seem to have any useful information on how it works. I used this filter:
I've also used an attack end event placed before the moveto event in the code, but the moveto event triggers first anyway.
I am being plauged by a very annoying bug caused by a single fact: When a unit is selected, an overlay appears on screen, darkening any areas the unit can't reach. When the unit is ordered to attack an enemy, the overlay stays on-screen while the unit moves, and only disappears when the attack starts.
The problem occurs when a unit attempts to attack an enemy, and triggers a moveto event when moving into position. The overlay stays put until the moveto event ends! Is there any way around this? I've tried using an 'advance' event, but the wiki doesn't seem to have any useful information on how it works. I used this filter:
Code: Select all
[filter]
side=1
x=21-23,22
y=8-9,7
[/filter]
[filter_second]
side=2
[/filter_second]
Currently working on various ideas using 1.9.8.9
Re: [Help]Moveto events and attacking?
You can use an object to set both unit's attack number to 0, causing that there will be no fight at all. But that way, the attack will never happen, but you'll have the event without the overlay.
-
- Posts: 38
- Joined: June 17th, 2011, 1:26 am
Re: [Help]Moveto events and attacking?
I haven't been able to find any information on the wiki about a unit's attack number; I just tried using a [modify_unit] tag to change set its 'attacks' number to 0 (and back again after the event), but that didn't work.
(And for the record, the unit being attack runs away halfway though the event, so preventing a fight isn't a problem).
(And for the record, the unit being attack runs away halfway though the event, so preventing a fight isn't a problem).
Currently working on various ideas using 1.9.8.9
Re: [Help]Moveto events and attacking?
Try
attacks_left=
instead of attacks=
.-
- Posts: 38
- Joined: June 17th, 2011, 1:26 am
Re: [Help]Moveto events and attacking?
No, that didn't work either. . .
Currently working on various ideas using 1.9.8.9
- artisticdude
- Moderator Emeritus
- Posts: 2424
- Joined: December 15th, 2009, 12:37 pm
- Location: Somewhere in the middle of everything
Re: [Help]Moveto events and attacking?
So you're saying you did this and it didn't set the filtered units' attacks to 0?
Regardless of whether it changed the locations of the shaded hexes, the unit should still have 0 attacks left.
Code: Select all
[modify_unit]
[filter]
#your filter conditions here
[/filter]
attacks_left=0
[/modify_unit]
"I'm never wrong. One time I thought I was wrong, but I was mistaken."
Re: [Help]Moveto events and attacking?
I wonder if this should be considered a bug? The overlay is removed before moving if there is no attack, so there is an inconsistency.quantumfleet wrote:When a unit is selected, an overlay appears on screen, darkening any areas the unit can't reach. When the unit is ordered to attack an enemy, the overlay stays on-screen while the unit moves, and only disappears when the attack starts.
Edit: Will be fixed in 1.10.3.