Fake attack - is this possible?
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.
- Spannerbag
- Posts: 538
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Fake attack - is this possible?
Hello,
I'm sure this isn't a new idea so thought I'd ask here first.
What I would ideally like to do is to craft a
The logic would utilise (or spoof) a normal attack dialogue.
Ideally the routine would trap a normal attack initiation i.e. when a player selects one of their own units then specifies an enemy unit to attack. The resulting attack dialogue above would display the unit's normal attacks plus any fake attacks that meet whatever criteria are specified for the fake attack to be active.
Selecting the fake attack would not cause the unit to move towards the enemy unit (if not adjacent) but would instead perform whatever action(s) specified within the logic for that
The sort of code I'm thinking of is this:
Note that most of these keys are used to populate the fake attack dialogue and could be optional (that might even be desirable in some circumstances?).
Probably only
If
Typically I suspect the ActionWML will set one or more variables then fire one or more custom events.
I'm sure quite a few UMC creators would find this sort of thing quite useful?
Of course the actual implementation might vary a lot from the idealised case above, but hopefully this explains the spirit of my idea.
So... is this even vaguely feasible or an utter non-starter?
Any comments greatfully received!
Cheers!
-- Spannerbag
I'm sure this isn't a new idea so thought I'd ask here first.
What I would ideally like to do is to craft a
[fake_attack]
tag in lua or failing that implement something in WML.The logic would utilise (or spoof) a normal attack dialogue.
Ideally the routine would trap a normal attack initiation i.e. when a player selects one of their own units then specifies an enemy unit to attack. The resulting attack dialogue above would display the unit's normal attacks plus any fake attacks that meet whatever criteria are specified for the fake attack to be active.
Selecting the fake attack would not cause the unit to move towards the enemy unit (if not adjacent) but would instead perform whatever action(s) specified within the logic for that
[fake_attack]
.The sort of code I'm thinking of is this:
Code: Select all
[fake_attack]
fake_name=spear
fake_description=_"spear"
fake_icon=attacks/spear.png
fake_type=pierce
fake_range=melee
fake_damage=10
fake_number=3
[show_if]
... conditional WML ...
[/show_if]
[command] # Not really needed
... ActionWML ...
[/command] # Not really needed
[/fake_attack]
Probably only
fake_name=
will be mandatory so that the fake attack is uniquely identified.If
[show_if]
is too awkward to implement the entire fake_name=
could, I guess, be contained within an [if]
condition?Typically I suspect the ActionWML will set one or more variables then fire one or more custom events.
I'm sure quite a few UMC creators would find this sort of thing quite useful?
Of course the actual implementation might vary a lot from the idealised case above, but hopefully this explains the spirit of my idea.
So... is this even vaguely feasible or an utter non-starter?
Any comments greatfully received!
Cheers!
-- Spannerbag
- Spannerbag
- Posts: 538
- Joined: December 18th, 2016, 6:14 pm
- Location: Yes
Re: Fake attack - is this possible?
Hmmm... just put my toe in deep water (for me anyway - I know nothing about the source code).
Will have to do some catching up when I get a decent block of time but my impression so far is that this is at least feasible - though probably not in the form I envisaged...
Thanks for the pointer.
Cheers!
-- Spannerbag