how to change a side of an attacked unit
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.
- Aldarisvet
- Translator
- Posts: 836
- Joined: February 23rd, 2015, 2:39 pm
- Location: Moscow, Russia
Re: how to change a side of an attacked unit
Thank you! Got it.
The event was start )))
To animate the process of taking the plague staff I just manually move unit to the tile with the image where the plague staff is positioned, then transform the unit and then remove the image of the plague staff.
Now I will create move_to event.
But how I will manage these events, hmm. Event inside event?
facebook.com/wesnothian/ - everyday something new about Wesnoth
My campaign:A Whim of Fate, also see it's prequel Zombies:Introduction
Art thread:Mostly frankenstains
My campaign:A Whim of Fate, also see it's prequel Zombies:Introduction
Art thread:Mostly frankenstains
Re: how to change a side of an attacked unit
Once again, you can't do that. The unit variable is a variable that gets automatically created once WML is inside a unit-related event. Then, this variable corresponds to the primary unit for that event... unit2 corresponds to the secondary unit.How I should specify in [variable] the id of the unit I am adressing?
If you want to do it from outside such an event, you first must store the unit in question.
OR - This solution does away with the unit variable and is convienent:
Code: Select all
[if]
[have_unit]
id=velendar3
level=3
[/have_unit]
[then]
#transform it
[/then]
[else]
#transform to something else
[/else]
[/if]
https://wiki.wesnoth.org/Eventwml#Prede ... th_Filters
Store unit:
https://wiki.wesnoth.org/InternalAction ... re_unit.5D
Have unit:
https://wiki.wesnoth.org/ConditionalAct ... ition_Tags
EDIT:
Not sure what you mean. You cannot put an [event] tag inside another one. They all must be defined separately, inside a scenario tag or a modification tag.But how I will manage these events, hmm. Event inside event?
If you want to call an event from inside another one, do
https://wiki.wesnoth.org/InternalAction ... e_event.5D
- Aldarisvet
- Translator
- Posts: 836
- Joined: February 23rd, 2015, 2:39 pm
- Location: Moscow, Russia
Re: how to change a side of an attacked unit
Thank you much, [have_unit] is a simple decision that worked out!
Here are some screens, just to show your help results!
facebook.com/wesnothian/ - everyday something new about Wesnoth
My campaign:A Whim of Fate, also see it's prequel Zombies:Introduction
Art thread:Mostly frankenstains
My campaign:A Whim of Fate, also see it's prequel Zombies:Introduction
Art thread:Mostly frankenstains
- James_The_Invisible
- Posts: 534
- Joined: October 28th, 2012, 1:58 pm
- Location: Somewhere in the Northlands, fighting dark forces
- Contact:
Re: how to change a side of an attacked unit
That is not true. See EventWML#Nested_Event_Example.
My content: For Power series
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Ports: Danse Macabre Story of the Wose
Guides: How to translate your UMC
Re: how to change a side of an attacked unit
Great, I'm glad it worked!Aldarisvet wrote: ↑May 28th, 2018, 7:27 pmThank you much, [have_unit] is a simple decision that worked out!
Here are some screens, just to show your help results!
1.png
2.png
True, I wasn't aware of that.James_The_Invisible wrote: ↑May 28th, 2018, 7:28 pmThat is not true. See EventWML#Nested_Event_Example.