Framework

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
aaronfeld
Posts: 52
Joined: June 9th, 2010, 7:30 pm

Framework

Post by aaronfeld »

I was wondering if some one could give me like a list, well an order really of things to do when making a campain. First I'm into story making yet this is my first time making anything with WML so...My _main CFG file is pretty much done so then I see the Utils and I'm not sure which one I need cuz there different each in each campain I look at and I'm not sure what some of them do. I'm still learning all together so just keep that in mind so when you go off on how this varibal effects this unit at this x,y point and stuff like that.

Thanks

User avatar
Luroch_Delkar
Posts: 44
Joined: August 11th, 2010, 11:15 pm
Location: Some people are in homes, some are in cars, I am in-sane.

Re: Framework

Post by Luroch_Delkar »

After your _main.cfg you should make a scenarios folder. In it you should make your first scenario file.

There are so many tags that do so many different things that I could not list them all. Nor should I since they can all be found, with a bit of searching, on the wesnoth Create page. http://wiki.wesnoth.org/ReferenceWML is a good place to look for most tags but the first page you should look at is http://wiki.wesnoth.org/BuildingScenariosSimple.

The latter will give you the framework that you are looking for.

As to Utilities, I do not think you need them unless you plan on making macros.
When you want to do the same or similar thing many times making a macro can save you from writing a large amount of code more than once.

e.g to make a macro you would write:

Code: Select all

#define I_PLACE_CHEST X Y
[item]
x={X}
y={Y}
image=items/chest-plain-closed.png
[/item]
[event]name=moveto
[filter]
x={X}
y={Y}
[/filter]
[removeitem]
x={X}
y={Y}
image=items/chest-plain-closed.png
[/removeitem]
[item]
x={X}
y={Y}
image=items/chest-plain-open.png
[/item]
[redraw][/redraw]
[/event]
#enddef
Then if you wanted to place a chest at say 31,52 instead of writing all of that code again you could type:

Code: Select all

{I_PLACE_CHEST 31 52}
You can place as many chests as you want by changing X Y to the x,y coordinates of the hex you want to place it on.
When first learning though you should try to code without macros, just until you have a better understanding of WML.

p.s If in your scenario file you make the reference {~add-ons/your_folder/utils} then you still need to have a utils folder in your campaign folder even if you aren't using or writing any macros.

p.s.s That page is still a good reference but is slightly out of date as the ~add-ons folder has replaced the @campaigns folder.
e.g instead of map_data={@campaigns/your_folder/maps/your_map} you would use map_data={~add-ons/your_folder/maps/your_map}
"The Enforcer knows only one way to preserve peace. So mind your neighbors else it will descend upon you." Sword of the Stars Forever
HAPPINESS=Moderation, Variety, and Love
Current Projects: Jailbreak (RPG)(3/4 completed) , Dungeonmaster Era

User avatar
Pentarctagon
Forum Administrator
Posts: 4324
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Framework

Post by Pentarctagon »

could you please just make 1 thread for all your questions? this is your 6th thread on this page alone :roll:
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code

User avatar
Iris
Site Administrator
Posts: 6646
Joined: November 14th, 2006, 5:54 pm
Location: Chile
Contact:

Re: Framework

Post by Iris »

What Pentarctagon said. Since you seem to require help with every step instead of particular issues, you might prefer to create a specific thread to request help with your add-on's development as you need it.
Author of the unofficial UtBS sequels Invasion from the Unknown and After the Storm.

aaronfeld
Posts: 52
Joined: June 9th, 2010, 7:30 pm

Re: Framework

Post by aaronfeld »

Ya, should I just edit the same post over and over then. Other fourms I use (for something else) that never works but if you guys say I should do it then that's what I'll do. Luroch_Delkar very helpful thanks. Also WML is the first script I've ever learned or started to learn and even look at so I'm like, I think I know what that does, I wonder what that does, and I have no idea what that does. I'm also making a text doc of all the anwsers that you guys have been giving cuz it seems that the wiki is not that descriptive in some areas but is still helpful.

Thanks

Post Reply