Little question about WML

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
User avatar
Casual User
Posts: 475
Joined: March 11th, 2005, 5:05 pm

Little question about WML

Post by Casual User »

Good afternoon!

Would it be possible to code in WML an event so that an unit reaching the border of the map is removed from the battlefield but placed in the recall list on the next scenario? If so, how?

I guess I could use [store_unit] in a variable and [unstore_unit] it just before the end of the scenario, but it would make things rather complicated.

What I am trying to do is to make it so that to win a scenario, you must move yourself and at least six other units to the border of the map. Using what I said above would be very difficult because the units in question aren't fixed.

Thanks in advance.
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

Yeah, it don't know definetly if it will work, but you'll need to change the variable each time, so 7 copies of it otherwise it might overright it.

Code: Select all

[event]
        moveto=0,0 
#or wherever you want it to...
        [store_unit]
        [filter]
		description=unit
#or the name of your leader 
        [/filter]
        variable=survivor_1
        kill=yes
        [/store_unit]
[/event]
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

What you need to do is, in the start event, set variable counter=1. Then, have an event, with first_time_only=no, for whenever a unit on your side moves to the edge of the map. Store the unit that moved in the variable edgemover[$counter], then increase $counter by 1. After that, if $counter equals 7,8, or whatever is supposed to end the scenario, do an endlevel. Have a victory event that contains an unstoring-unit "for" loop.

If you need help writing that code, or if what I said didn't make sense, i can write a WML-snippet to show you how to do it.
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
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

turin wrote:What you need to do is, in the start event, set variable counter=1. Then, have an event, with first_time_only=no, for whenever a unit on your side moves to the edge of the map. Store the unit that moved in the variable edgemover[$counter], then increase $counter by 1. After that, if $counter equals 7,8, or whatever is supposed to end the scenario, do an endlevel. Have a victory event that contains an unstoring-unit "for" loop.

If you need help writing that code, or if what I said didn't make sense, i can write a WML-snippet to show you how to do it.
Listen to the guy with 3 campaigns under his belt, compared to the 1 with half one.
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
Taurus
Inactive Developer
Posts: 674
Joined: May 4th, 2005, 8:16 pm
Location: Canada

Post by Taurus »

Disto wrote:
Listen to the guy with 3 campaigns under his belt, compared to the 1 with half one.
Two campaigns Disto? I thought you only did "A seed of Evil." Don't tell me you are one of the "official" programmers too?
Creater of the campaign, "Northern Rebirth"

Compleater of the campaign, "Son of the Black Eye"
Disto
Posts: 2039
Joined: November 1st, 2004, 7:40 pm
Location: Cambridge, UK

Post by Disto »

Taurus wrote:
Disto wrote:
Listen to the guy with 3 campaigns under his belt, compared to the 1 with half one.
Two campaigns Disto? I thought you only did "A seed of Evil." Don't tell me you are one of the "official" programmers too?
No....i'm the second guy i'm talking about. The one with a half a campaign, Turin's done 3.... And i'm not a "official" programmer. Where did that come from???
Creator of A Seed of Evil
Creator of the Marauders
Food or Wesnoth? I'll have Wesnoth
Taurus
Inactive Developer
Posts: 674
Joined: May 4th, 2005, 8:16 pm
Location: Canada

Post by Taurus »

Disto wrote:
No....i'm the second guy i'm talking about. The one with a half a campaign, Turin's done 3.... And i'm not a "official" programmer. Where did that come from???
Oh oops, :oops: I thought you said, "one and one half" campaigns, and since I only saw one on the campaign server, I thought you might have done one of the official ones. And hey, talking about official campaigns, how do they become official, is it just that the developers see them and think they are cool and bingo, they're part of the package?
Creater of the campaign, "Northern Rebirth"

Compleater of the campaign, "Son of the Black Eye"
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

Taurus wrote:
Disto wrote:
No....i'm the second guy i'm talking about. The one with a half a campaign, Turin's done 3.... And i'm not a "official" programmer. Where did that come from???
Oh oops, :oops: I thought you said, "one and one half" campaigns, and since I only saw one on the campaign server, I thought you might have done one of the official ones. And hey, talking about official campaigns, how do they become official, is it just that the developers see them and think they are cool and bingo, they're part of the package?
Well, sort of... another requirement is that they were selected before about November 2004. It was kind of a first-come-first-serve deal...
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
Taurus
Inactive Developer
Posts: 674
Joined: May 4th, 2005, 8:16 pm
Location: Canada

Post by Taurus »

turin wrote: Well, sort of... another requirement is that they were selected before about November 2004. It was kind of a first-come-first-serve deal...
So are the planning on adding any new campaigns or is it just going to be those 4? Or is it one of those questions when nobody knows the answer?
Creater of the campaign, "Northern Rebirth"

Compleater of the campaign, "Son of the Black Eye"
torangan
Retired Developer
Posts: 1365
Joined: March 27th, 2004, 12:25 am
Location: Germany

Post by torangan »

It is planned to add new campaigns after 1.0 probably even into 1.0.x provided that they're complete and supported. Adding new ones before 1.0 would have made the job of translators quite a bit more difficult then it already is. So getting much translations for a campaign through WesCamp may also help it to become official. At the very least, translations show that some people like the campaign enough to spent the time translating it.
Post Reply