removing a unit from the recall list

The place to post your WML questions and answers.

Moderators: Forum Moderators, Developers

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.
Post Reply
troodon
Posts: 218
Joined: July 22nd, 2006, 8:55 pm

removing a unit from the recall list

Post by troodon »

How do I remove a unit from the recall list using WML? When I use store/unstore unit for my leader, I can recall myself.

Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

Are you saying there are multiple of the same unit? You shouldn't need to remove the second unit from the recall list, just debug your code to find out why he is being duplicated...
BTW, you can remove a unit from the recall list with a normal [kill] tag.

troodon
Posts: 218
Joined: July 22nd, 2006, 8:55 pm

Post by troodon »

what sort of things would make the unit be duplicated with store/unstore unit?

Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

- 'find_vacant=yes' in [unstore_unit]
- changing the location of the unit while stored
- storing one scenario, and unstoring the next
hmm... the second is most likely. You can either use 'kill=yes' in [store_unit], or use [teleport] instead...

troodon
Posts: 218
Joined: July 22nd, 2006, 8:55 pm

thanks, and more help?

Post by troodon »

Thanks, kill=yes worked. You mentioned storing a unit in one scenario and unstoring it in another scenario. How do you do that? I tried to do that, but it didn't work. Could it have anything to do with me unstoring the unit in a scenario in which my leader wasn't there?

Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Re: thanks, and more help?

Post by Dacyn »

troodon wrote:Could it have anything to do with me unstoring the unit in a scenario in which my leader wasn't there?
Was there a defeat message? If the leader is not present in a scenario you automatically lose...

troodon
Posts: 218
Joined: July 22nd, 2006, 8:55 pm

Post by troodon »

Dacyn wrote
Was there a defeat message? If the leader is not present in a scenario you automatically lose..
No, there was no defeat message. There was a leader with the same team name as my leader. The unit was supposed to fight for the new leader in this scenario, since the main leader wasn't there. The scenario works fine except that I can't get that unit into the scenario, and if I use [unit], some one might find that their level 3 unit has turned back into a level 2 unit...

Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

Maybe you are unstoring it at a location which does not exist on the new map... try setting the coordinates to where you want the unit to appear before unstoring it.
Other than that, I can't think of why the unit wouldn't appear...

User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

Indeed. If you unstore a unit to invalid coordinates, it gets unstored to the recall list instead.

troodon
Posts: 218
Joined: July 22nd, 2006, 8:55 pm

coordinates

Post by troodon »

I did:
[store_unit]
[filter]
description=unitname
[/filter]
variable=unitname_store
kill=yes
[/store_unit]


two scenarios later, I used [unstore_unit]. I don't remember how I indicated the variable to unstore, but I entered the coordinates like this:x,y=14,15. The next line was [/unstore_unit]

It didn't work. I read the wiki, but it didn't explain the format in terms I can understand.

Dacyn
Posts: 1855
Joined: May 1st, 2004, 9:34 am
Location: Texas

Post by Dacyn »

Try this:

Code: Select all

[set_variable]
name=unitname_store.x
value=14
[/set_variable]
[set_variable]
name=unitname_store.y
value=15
[/set_variable]
[unstore_unit]
variable=unitname_store
[/unstore_unit]

Post Reply