[engine] Stop when attacked

Brainstorm ideas of possible additions to the game. Read this before posting!

Moderator: Forum Moderators

Forum rules
Before posting a new idea, you must read the following:
Post Reply
User avatar
beetlenaut
Developer
Posts: 2536
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: [engine] Stop when attacked

Post by beetlenaut »

Load the autosave of the turn with "Cancel orders" checked in the load dialog. That will prevent automatic movement at the beginning of the turn right after it loads.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
Tad_Carlucci
Inactive Developer
Posts: 503
Joined: April 24th, 2016, 4:18 pm

Re: [engine] Stop when attacked

Post by Tad_Carlucci »

I've not looked, but it seems to me that it is actually a good idea to offer a Settings option (default: No) to Automatically Cancel Orders When Attacked. Having to load an autosave seems to support the idea that Wesnoth depends upon reloading.
I forked real life and now I'm getting merge conflicts.
User avatar
WhiteWolf
Forum Moderator
Posts: 739
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: [engine] Stop when attacked

Post by WhiteWolf »

I'm seconding the idea of having the feature available as a settings option.

In the meantime, this can actually be done already in a half-minute-to-write mod with a simple attack end event that resets the attacked unit's gotos.
So if anyone wants this available now, feel free to download the new Cancel the Preset Unit-Course if Attacked mod from the add-ons server... :D
Author of 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
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
josteph
Developer
Posts: 741
Joined: August 19th, 2017, 6:58 pm

Re: [engine] Stop when attacked

Post by josteph »

peterbill wrote: April 26th, 2019, 3:52 am It would be really great that I could choose an option (although I don't see why I wouldn't want it to be chosen) that would forget the path and make the unit to stop if it's been attacked.
The potential problem with such an option is that it discards user data. In general, when a program is dealing with data the user may have spent time creating, that data should not be deleted except by explicit user request. Maybe in this case it'd be fine...? :hmm:
WhiteWolf wrote: May 1st, 2019, 3:41 pm feel free to download the new Cancel the Preset Unit-Course if Attacked mod from the add-ons server... :D
Kudos! :)
User avatar
WhiteWolf
Forum Moderator
Posts: 739
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: [engine] Stop when attacked

Post by WhiteWolf »

Just letting everyone know - the mod has been renamed to Advanced Order Cancelling, and now also supports issue https://github.com/wesnoth/wesnoth/issu ... -408765480 to have the ability to quickly unset a unit's orders through a right-click menu item or hotkey :)
Author of 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
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
Atreides
Posts: 200
Joined: March 30th, 2019, 10:38 pm
Location: The North Pole

Re: [engine] Stop when attacked

Post by Atreides »

Thank you so much WhiteWolf for this mod that I've been desperately needing for quite a while now. I usually play on large or gigantic (Dominus maps 200x200 some!) maps and this is a godsend.

I was wondering if it could be extended to also cancel auto move orders for units that have _not_ seen a newly discovered unit (one that stops only the first unit to spot it... the following units keep going...). I realize that might be complicated but if there is a simple way to do it... :) It's not a big deal so don't bother unless there's a simple way.
--
Any typos are the fault of my laptop keyboard!
Lonely Era (Ice Age) maintainer: https://forums.wesnoth.org/viewtopic.php?f=19&t=42630
Merry Christmas Campaign maintainer: https://forums.wesnoth.org/viewtopic.ph ... 97#p662897
User avatar
WhiteWolf
Forum Moderator
Posts: 739
Joined: September 22nd, 2009, 7:48 pm
Location: Hungary

Re: [engine] Stop when attacked

Post by WhiteWolf »

Atreides wrote: January 14th, 2021, 4:50 am cancel auto move orders for units that have _not_ seen a newly discovered unit (one that stops only the first unit to spot it... the following units keep going...).
I'm not sure I entirely understand. Wouldn't this just mean cancelling all orders unconditionally? It's been a while since I actually played so I don't remember how it works. Let me understand this:
- An enemy attacks your units and the mod cancels its orders. And the issue is that nearby units that do NOT get engaged by enemy units are not cancelled?
I guess that's a fair observation, after all you might want to reconsider movement based on the attack of an enemy, even if other units were attacked.
- Or do you mean that the unit is not attacked, but an enemy emerges from fog during their turn, and then the sighting unit and units around it should have their orders cancelled?

What do you think would be the correct radius in which to cancel orders? (That's the only way I can think of to make this happen, because at the time of sighted, the only data to filter on is the unit doing the sighting). I don't know, like a radius of 1.5*vision of sighting unit sounds reasonable? (and do a hard cut minimum of idk, 10 hexes in case a slow unit is doing the sighting but a fast unit with orders is also nearby).
Other option is to just cancel all remaining orders when an enemy is sighted, but that just sounds too extreme to me in terms of discarding user input data.
Author of 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
Standalone works: The Ravagers - now for 1.14, with new bugs!
User avatar
Atreides
Posts: 200
Joined: March 30th, 2019, 10:38 pm
Location: The North Pole

Re: [engine] Stop when attacked

Post by Atreides »

Sorry if I was confusing. I was talking about when a unit stops its movement due to seeing a enemy unit. It gets the standard continue move message. On your turn when manually moving you get a choice to hit a key to move on but at the start of your turn automovers also get this message (only without an option - it's just a message).

That auto stop only works for the unit that sees the enemy first. If you have a couple moving in a bunch the rest will keep going unless they discover another enemy.

Come to think of it it is probably fine. If you spot only one new enemy only the lead unit stops and the rest rush on to meet that single enemy... OTOH if you run into a large number of hidden enemies they would stop an equal number of your units automoves.

Yeah, never mind, hehe. I was my bad habit of thinking with my fingers...

Your mod handles the far more critical problem of automovers actually getting attacked and they keep trying to move around them. It's happened to me many times!

The cancel all automoves menu option (which I enabled and seems to be sticky, nice) is great too. Very handy for RED ALERT cases when a gigantic Sea Serpent or Flesh Golem suddenly pops up in Four Kingdoms or a Water Serpent in Twister Desert.
--
Any typos are the fault of my laptop keyboard!
Lonely Era (Ice Age) maintainer: https://forums.wesnoth.org/viewtopic.php?f=19&t=42630
Merry Christmas Campaign maintainer: https://forums.wesnoth.org/viewtopic.ph ... 97#p662897
Post Reply