Bending ZoC Rules
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.
Bending ZoC Rules
I'd like to slightly bend the zone of control rules for a multiplayer scenario of mine. That is, if unit A kills unit B, I don't want unit A to be restricted by unit B's ZoC.
Can I do that in WML? How?
I know how I can set the number of moves left in a "die" event. However, so far I haven't figured out how to determine the number of moves the unit would have left if there was no ZoC. I tried storing the unit in the moveto-event and record unit.moves to a variable, but unit.moves is already 0 because the ZoC rule has already been taken into account.
Can I do that in WML? How?
I know how I can set the number of moves left in a "die" event. However, so far I haven't figured out how to determine the number of moves the unit would have left if there was no ZoC. I tried storing the unit in the moveto-event and record unit.moves to a variable, but unit.moves is already 0 because the ZoC rule has already been taken into account.
- Cloud
- Art Contributor
- Posts: 502
- Joined: December 17th, 2008, 7:43 pm
- Location: The land of pixels
- Contact:
Re: Bending ZoC Rules
See movement_used. Shouldn't be hard to code a small change to that tag for A, for when A fights B. I think that's your best bet.
Softly/SoftlySplinter on IRC. Will be lurking around more these days
Mainline Animations|The Væringjar
Art for these mead-sodden, bearded mushroom-junkies by Girgistian!
Mainline Animations|The Væringjar
Art for these mead-sodden, bearded mushroom-junkies by Girgistian!
Re: Bending ZoC Rules
No, I think you can't. Not in a good way anyway.meriton wrote:Can I do that in WML?
The best simulation I can think of would be giving A skirmisher when next to B (but not any other unit with ZoC) and then having a moveto event for when A moves next to B in which you store the amount of moves A has left and set them to 0 and then have a die event for B in which you restore A's stored moves.
Re: Bending ZoC Rules
Wouldn't this allow A to walk right past B without fighting? That might be a bit too powerful.
I guess I'll have to think of another rule then, thanks for your ideas.
I guess I'll have to think of another rule then, thanks for your ideas.
-
- Posts: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
Re: Bending ZoC Rules
I have. No new insight comes to mind.
I understand "giving A skirmisher when next to B" as giving A a skirmishing ability with a filter saying that there is at most one enemy unit with level > 0 in adjacent hexes. My thought is that this filter expression will match regardless of whether A is attacking B, and hence allow A to violate B's ZoC even it it doesn't attack.
The moveto event, if I recall correctly, only fires for the destination hex, not every hex travelled over, and hence can not interrupt a move either.
If I err, please tell me where.
I understand "giving A skirmisher when next to B" as giving A a skirmishing ability with a filter saying that there is at most one enemy unit with level > 0 in adjacent hexes. My thought is that this filter expression will match regardless of whether A is attacking B, and hence allow A to violate B's ZoC even it it doesn't attack.
The moveto event, if I recall correctly, only fires for the destination hex, not every hex travelled over, and hence can not interrupt a move either.
If I err, please tell me where.
- Simons Mith
- Posts: 821
- Joined: January 27th, 2005, 10:46 pm
- Location: Twickenham
- Contact:
Re: Bending ZoC Rules
When the unit attacks, record how many movement points it has at that point. If it kills its opponent, and there is not another opponent within one hex, give them back to it.
If that's what you want, I believe it could be coded. I've often given units thier movement back in debug mode when mucking about. If you have something else in mind, I have not understood what you meant to say.
If that's what you want, I believe it could be coded. I've often given units thier movement back in debug mode when mucking about. If you have something else in mind, I have not understood what you meant to say.
Re: Bending ZoC Rules
The moveto-event fires before the attack event, doesn't it?
meriton wrote:I tried storing the unit in the moveto-event and record unit.moves to a variable, but unit.moves is already 0 because the ZoC rule has already been taken into account.
-
- Posts: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
Re: Bending ZoC Rules
Woops, sorry. I guess I misunderstood what you meant
Mac OS X 10.5.7
Wesnoth 1.6.2
Wesnoth 1.6.2
Re: Bending ZoC Rules
Yeah, that's true. So I'd say it's simply impossible to do currently.meriton wrote:Wouldn't this allow A to walk right past B without fighting?