[recall] when the unit might be dead
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.
[recall] when the unit might be dead
Using the
I want to remove a unit (id=Boolzak) from the map. I can't use
In a later scenario, I want a loyal unit (id=Grizz) to appear on the map via
Or should I simply create the new
I need to ensure that I don't end up with Grizz and a new unit at the same time. Should I try to recall Grizz, and then check with
recall
tag is simple enough, but there are a few recall-related situations that are not so simple.I want to remove a unit (id=Boolzak) from the map. I can't use
kill
, as it removes him from recall list, and I want him on the recall list. Is this how you would do it? Is there a better way? Code: Select all
[store_unit] # use [store_unit] to remove Boolzak from the map
[filter]
id=Boolzak
[/filter]
variable=Boolzak_store
kill=yes
[/store_unit]
[put_to_recall_list] # put Boolzak on the recall list
id=Boolzak
heal=yes
[/put_to_recall_list]
recall
. He may or may not be on the recall list, however, because he might have been killed in the previous scenario. If he's dead, I would like to create another loyal unit and put him on the recall list, and recall him in Grizz's place. Or should I simply create the new
unit
right on the map? Is that what you would do?I need to ensure that I don't end up with Grizz and a new unit at the same time. Should I try to recall Grizz, and then check with
have_unit
to see if he's on the map? And if he isn't, create a new unit
in that location?Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Lord-Knightmare
- Discord Moderator
- Posts: 2361
- Joined: May 24th, 2010, 5:26 pm
- Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
- Contact:
Re: [recall] when the unit might be dead
Just this is fine:I want to remove a unit (id=Boolzak) from the map. I can't use kill, as it removes him from recall list, and I want him on the recall list. Is this how you would do it? Is there a better way?
Code: Select all
[put_to_recall_list] #put Boolzak on the recall list
id=Boolzak
heal=yes
[/put_to_recall_list]
In a later scenario, I want a loyal unit (id=Grizz) to appear on the map via recall. He may or may not be on the recall list, however, because he might have been killed in the previous scenario. If he's dead, I would like to create another loyal unit and put him on the recall list, and recall him in Grizz's place.
Code: Select all
[event]
id=Helmet_Recall_Unit_Grizz
name="new turn"
[if]
[have_unit]
id="Grizz"
search_recall_list=yes
[/have_unit]
[then]
[recall]
id="Grizz"
x,y=23, 5
[/recall]
[/then]
[else]
{LOYAL_UNIT 1 "Cave Bear" recall recall}
[+unit]
id="Grizz_replacement"
# add traits and new abilities with a modifications tag
[/unit]
[recall]
id="Grizz_replacement"
[/recall]
[/else]
[/if]
[/event]
Better to just useOr should I simply create the new unit right on the map? Is that what you would do?
{LOYAL_UNIT 1 "Cave Bear" 23 5}
theI need to ensure that I don't end up with Grizz and a new unit at the same time. Should I try to recall Grizz, and then check with have_unit to see if he's on the map? And if he isn't, create a new unit in that location?
search_recall_list=yes
does the checking for you. If he is not in the recall list, you get the replacement loyal unit instead.Creator of "War of Legends"
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Creator of the Isle of Mists survival scenario.
Maintainer of Forward They Cried
User:Knyghtmare | My Medium
Re: [recall] when the unit might be dead
Awesome! I suspected there was a better way. Thank you, Lord-Knightmare.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [recall] when the unit might be dead
My only amendment to that code is that
id="Grizz_replacement"
should probably just be id="Grizz"
. Otherwise, it'll be really inconvenient to reference that unit from later events.Re: [recall] when the unit might be dead
What I did was make the replacement unit of Grizz his sister, Grizzil. If Grizz is dead, she steps up to take his place in the next scenario. It works well, story-wise.Celtic_Minstrel wrote: ↑December 20th, 2020, 8:53 pm My only amendment to that code is thatid="Grizz_replacement"
should probably just beid="Grizz"
. Otherwise, it'll be really inconvenient to reference that unit from later events.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [recall] when the unit might be dead
I see. Then it might make sense to assign the same role to Grizz and his sister, at least if you want them to potentially say the same lines.
Re: [recall] when the unit might be dead
I need to learn how to useCeltic_Minstrel wrote: ↑December 25th, 2020, 4:14 am I see. Then it might make sense to assign the same role to Grizz and his sister, at least if you want them to potentially say the same lines.
role
. I bet it would make dialogue much easier.This is what I did when I wasn't sure who would be talking, Grizz or Grizzil...
Code: Select all
[message]
x,y=19,2 # << Grizz or Grizzil
message="Prince Ziffid, I heard that our military forks were originally designed by humans..."
[/message]
x,y
, and it worked.Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: [recall] when the unit might be dead
You just use [role] to assign one to a unit, and then you can use
role=
in [message]. Roles are probably best used to make a non-major character say something, and make it a bit randomized about who this non-major character will be.That's correct, [message] accepts Standard Unit Filter, so all of its keys are recognized. The most commonly usedI took a wild guess that I could filter a message based onx,y
, and it worked.
speaker
key is actually just an alias that also accepts special values like 'narrator'. But for example speaker=unit
is equivalent to id=$unit.id
in a [message].Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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
- Celtic_Minstrel
- Developer
- Posts: 2214
- Joined: August 3rd, 2012, 11:26 pm
- Location: Canada
- Contact:
Re: [recall] when the unit might be dead
Yeah, you can filter by location, but that only works when you know exactly where they are.
By the way, your example also has another problem - it's impossible to correctly translate it to some languages (for example Japanese). If you want to fix that, you need to use `male_message` and `female_message`. (If you don't care about translations, then you can leave it how it is.)
By the way, your example also has another problem - it's impossible to correctly translate it to some languages (for example Japanese). If you want to fix that, you need to use `male_message` and `female_message`. (If you don't care about translations, then you can leave it how it is.)
Re: [recall] when the unit might be dead
Thanks for the reminder.Celtic_Minstrel wrote: ↑December 25th, 2020, 10:30 pm By the way, your example also has another problem - it's impossible to correctly translate it to some languages (for example Japanese). If you want to fix that, you need to use `male_message` and `female_message`. (If you don't care about translations, then you can leave it how it is.)
I temporarily halted making anything translatable after a bug appeared in my code. I had made a translatable
team_name
, and that caused an enemy faction to appear as an ally. It didn't occur to me for a long time to suspect that the translation code was the culprit, so that problem took me a while to resolve.In the event that more translation-related bug exists, I temporarily halted translating anything until all my code ran properly. Thankfully, I'm finally at that point.
Say, that might be a nice addition to WML: eliminating the bug where a translatable
team_name
mysteriously breaks your game.Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Re: [recall] when the unit might be dead
This is not a bug. Making any id-type value translatable will cause all kinds of issues, since that lets translations overwrite stuff that is handled by the game. The things that should be translatable are the aesthetic stuff, text that is shown to the player but is meaningless to the engine.
team_name
is like an id for the "alliance", so that one is meaningful to the engine, therefore it mustn't be translatable. The key you mean is user_team_name
, this is the shown text. This is the one that should be translatable.Main UMC campaigns: The Ravagers - now for 1.16, with new bugs!
Old UMC works: 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
Old UMC works: 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
Re: [recall] when the unit might be dead
I didn't know it was an id. Now it makes sense.
I wish it had been called something different, like
Thanks for explaining.
I wish it had been called something different, like
team_id
, though. Or if a person did mistakenly try to translate it, they would get an error message telling them not translate it.Thanks for explaining.
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.