Help : Total recall ?

The place to post your WML questions and answers.

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.
Post Reply
taz
Posts: 80
Joined: October 10th, 2005, 7:17 am
Location: Somewhere in France

Help : Total recall ?

Post by taz »

Partial or total recall ?

1/ The disallow_recall=yes key prevents to player from recalling units from the previous scenario.

But, is it possible to prevent the player from recalling a specific type of units ?

For example if the player can recall Spearmen,Horseman and Bowman is there a way to prevent her/him from recalling spearmen ?

2/ Another question : Is it possible to erase the recall list ?
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Are you familiar with how [store_unit] works? If not, read it up on the wiki. Basically, to stop them from recalling a specific type of unit, store all of those units with kill=yes. Then, when the scenario is over, unstore them so they can use the units the next scenario.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

You can do it with [store_unit]. [store_unit] will store units on the recall list as well as units on the battlefield.

You can use [filter] to target a specific type.

You must use kill=yes to prevent the player from accessing the unit (the units can be [unstore_unit]'ed later).

If you do this at the beginning of the scenario, you should not need to distinguish between units on the field vs on the recall list, but I think x,y=0,0 in the filter will only get units on the recall list.
Hope springs eternal.
Wesnoth acronym guide.
taz
Posts: 80
Joined: October 10th, 2005, 7:17 am
Location: Somewhere in France

Post by taz »

Thanks your replies/help :)
Will try that.

Lets say you don't want to have the player's Horsemen recalled during a specific battle (they are on recon duty elsewhere).

Here is my intended scrip for partial recall of units :

In the scenario where you don't want Horsemen :

[event]
name=start
[store_unit]
[filter]
type=Horseman
side=1
[/filter]
variable=storedhorsemen
kill=yes
[/store_unit]
[/event]

And in the following scenario where you want the Horsemen back :

[event]
name=start
[unstore_unit]
variable=storedhorsemen
[/unstore_unit]
[/event]

Am I correct ? Thanks in advance for your help.
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

No, I don't think it will. When you unstore them, you will have to do a {FOREACH} loop. I don't remember how to do that, but it's probably on the wiki somewhere. I'll look it up when I get back from school if no one has told you yet.
For I am Turin Turambar - Master of Doom, by doom mastered. On permanent Wesbreak. Will not respond to private messages. Sorry!
And I hate stupid people.
The World of Orbivm
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

{FOREACH storedhorseman i}
[unstore_unit]
variable=storedhorseman[$i]
[/unstore_unit]
{NEXT i}
Hope springs eternal.
Wesnoth acronym guide.
taz
Posts: 80
Joined: October 10th, 2005, 7:17 am
Location: Somewhere in France

Post by taz »

scott wrote:{FOREACH storedhorseman i}
[unstore_unit]
variable=storedhorseman[$i]
[/unstore_unit]
{NEXT i}
Thanks for your quick reply both of you. :)

I could never have figured out myself the right script to do that.

Will try and experiment with the FOREACH stuff.

Many thanks again for your support.
Post Reply