Is it possible to do this, and if so, how?
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.
Is it possible to do this, and if so, how?
i was wondering if it is possible to place a unit on the map from the recall list without actually recalling them, or to recall them to a specific spot on the map? thanks in advance.
- mnewton1
- Posts: 777
- Joined: November 12th, 2008, 4:31 am
- Location: On my pretty teal horsey.
- Contact:
Re: Is it possible to do this, and if so, how?
I am not sure about recalling a unit in specific place on the map. But the way you recall a unit so it starts next to your leader is you just put this in your scenario and modify the id.
Code: Select all
[event]
name=prestart
[recall]
id=the units id I want to recall
[/recall]
[/event]
Creator of Ageless Era
Check out Frogatto & Friends, it's made by the same people who created The Battle for Wesnoth!
Check out Frogatto & Friends, it's made by the same people who created The Battle for Wesnoth!
-
- Posts: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
Re: Is it possible to do this, and if so, how?
According to the wiki, you just give recall the x and y coordinates.
Code: Select all
[event]
name=prestart
[recall]
id=the units id I want to recall
x,y= coordinates to place the unit
[/recall]
[/event]
Mac OS X 10.5.7
Wesnoth 1.6.2
Wesnoth 1.6.2
Re: Is it possible to do this, and if so, how?
yeah i know that but i need to get a unit from the recall list to be placed on the map during the prestart without using the recall tag because i do not have the leader starting on a keep.
-
- Posts: 127
- Joined: November 11th, 2005, 9:06 am
- Location: California
Re: Is it possible to do this, and if so, how?
The recall tag will grab units from the recall list regardless of where the leader is...
Mac OS X 10.5.7
Wesnoth 1.6.2
Wesnoth 1.6.2
Re: Is it possible to do this, and if so, how?
oh. didn't realize that. thanks.
Re: Is it possible to do this, and if so, how?
Best solution, If I understand what you want correctly, is to store the unit in a variable and then unstore it next scenario.
Re: Is it possible to do this, and if so, how?
It unstores them where you stored them--unless you unstore them at the end of the scenario, so that recalling them drops them off like a normal recall.Gambit wrote:Best solution, If I understand what you want correctly, is to store the unit in a variable and then unstore it next scenario.
If you want to unstore him in the middle of things--without him showing up on the recall unit list, then you do something else.
Using the teleport tag worked for me. Homeboy was embedded in rock at 2,2 and this got him to 42,2.
Scenario in the past--
Code: Select all
[store_unit]
variable=homz_store
kill=yes
[filter]
id=Homz
[/filter]
[/store_unit]
Scenario where you want him--
Code: Select all
[unstore_unit]
variable=homz_store
[/unstore_unit]
{CLEAR_VARIABLE homz_store}
[recall]
id=Homz
[/recall]
[teleport]
[filter]
id=Homz
[/filter]
x=42
y=2
[/teleport]
Re: Is it possible to do this, and if so, how?
Yes and no. It unstores them where the x and y fields of the variables tell it to unstore them. By default, x and y have the original values. But nothing prevents you to modify x and y before unstoring the variables. In fact, you don't even have to modify x and y, you can just pass the new values to [unstore_unit], they will overwrite the stored fields.TofuOgre wrote:It unstores them where you stored them
Re: Is it possible to do this, and if so, how?
Do not use color to identify your code, just use the provided code tags. It is much easier for others to read your code this way.TofuOgre wrote:Scenario in the past--
Code:
Scenario where you want him--
Mainline Maintainer: AOI, DM, NR, TB and THoT.
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
UMC Maintainer: Forward They Cried, A Few Logs, A Few More Logs, Start of the War, and Battle Against Time
Re: Is it possible to do this, and if so, how?
Apologies. I assumed what Silene said went without saying.TofuOgre wrote: It unstores them where you stored them--unless you unstore them at the end of the scenario, so that recalling them drops them off like a normal recall.
[set_variable] is your friend
Re: Is it possible to do this, and if so, how?
Thanks everyone. i think i understand how both work now.
coded Rebellion During the Dark Age
Currently working on:
Era of the Future
Currently working on:
Era of the Future