era search for villages on map

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
TheMastermind
Posts: 15
Joined: December 30th, 2008, 9:20 pm
Location: Israel

era search for villages on map

Post by TheMastermind »

i want to have a era that will search for villages on the map, store thier locations and mess with them.
how does this code supposed to look? >.<

English is not my main language, sorry XD
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: era search for villages on map

Post by zookeeper »

Remove your signature immediately and maybe then we'll talk.
TheMastermind
Posts: 15
Joined: December 30th, 2008, 9:20 pm
Location: Israel

Re: era search for villages on map

Post by TheMastermind »

mm.. ok.. waiting for you to feel like tallking to me 0.o

English is not my main language, sorry XD
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: era search for villages on map

Post by zookeeper »

That's better.

Code: Select all

[event]
    name=whichever event type you want

    [store_locations]
        terrain=*^V*

        variable=all_village_locations
    [/store_locations]
[/event]
That stores all villages on the map into that variable. But of course if you don't know how to make an era, you'll need to figure that out first.
TheMastermind
Posts: 15
Joined: December 30th, 2008, 9:20 pm
Location: Israel

Re: era search for villages on map

Post by TheMastermind »

ok, i thought it would be easier but i guess i was wrong XD
i'm used to C#, and c# is much more comftibale compered to the WML.
it's realy realy hard to find avilable commands and stuff to do and it's very confusing.

i want to do an era where the villages on the map are assinged units that the players that controls them can ricrut, the idea sounds pretty easy to implent, but the coding is very confusing to me >.<

i am not going to ask anyone to do this for me, but is there any way i can learn to better use the WML and get comftibale with it? by that i mean to having a nice way to know all of the varibales (how do you know which eventes you have and their names? the terrain=*^V* thing? for as much as i can see this thing is pretty much based about guessing whatever there is a command for stuff and it's name or asking in the forum for every thing you need). and getting comftibale with all the correct ways to write stuff.

maybe this should have something like the Visual Studio to aid WML coders XD

English is not my main language, sorry XD
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: era search for villages on map

Post by zookeeper »

TheMastermind wrote:ok, i thought it would be easier but i guess i was wrong XD
i'm used to C#, and c# is much more comftibale compered to the WML.
it's realy realy hard to find avilable commands and stuff to do and it's very confusing.

i want to do an era where the villages on the map are assinged units that the players that controls them can ricrut, the idea sounds pretty easy to implent, but the coding is very confusing to me >.<

i am not going to ask anyone to do this for me, but is there any way i can learn to better use the WML and get comftibale with it? by that i mean to having a nice way to know all of the varibales (how do you know which eventes you have and their names? the terrain=*^V* thing?
http://www.wesnoth.org/wiki/ReferenceWML contains, at least in theory, all that you'll need.

If you don't understand how some tag is used or where it's used since the wiki doesn't have much examples, grep for them in existing campaigns to find what's usually a large enough number of practical examples. Also they contain almost all kinds of general actions you might want to do, such as "doing something when a unit moves to a specific spot" or "make side 2 start the scenario with ownership of nearby villages". If you find yourself looking at a macro call which you don't know, likewise you can grep for that in the core/macros/ dir (or the campaign's own dir) to find the definition, which usually has an example.
TheMastermind wrote:for as much as i can see this thing is pretty much based about guessing whatever there is a command for stuff and it's name or asking in the forum for every thing you need). and getting comftibale with all the correct ways to write stuff.
Nonono. Never guess. The usual problem with newbies is that they try to guess stuff instead of learning where to dig around in the WML reference for that information.
Post Reply