Best practices using WML events

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
Viliam
Translator
Posts: 1341
Joined: January 30th, 2004, 11:07 am
Location: Bratislava, Slovakia
Contact:

Best practices using WML events

Post by Viliam »

I tried to re-organize the EventWML wiki page, and add many examples (approximately one for each event type). I looked in official scenarios to find the "best practices" on using events. And I found that different campaigns/authors do some things differently.

So I want to ask whether these different ways are just matter of taste, or is there some advantage in doing it one way as opposed to another?

Putting new units on the map:
"EI", "SotBE" -- in PRESTART event
"TDH" -- in START event
"HTTT" -- in SIDE tag

Recalling units:
"SotBE", "TDH" -- in PRESTART event
"EI", "HTTT" -- in START event
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

I´m not sure right now, but I think units placed in the start event can be seen appearing on the map while prestart and side units already are there.
First read, then think. Read again, think again. And then post!
User avatar
turin
Lord of the East
Posts: 11662
Joined: January 11th, 2004, 7:17 pm
Location: Texas
Contact:

Post by turin »

The three different ways of putting new units on the map are just a matter of personal preference (although doing it in the [side] tag does save one line - you don't have to specify the unit's side).


When recalling units, putting it in prestart will make them start out on the map, putting it in start will make them fade in, like when you recruit a unit.
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
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Turin, but there is a key fade_in= in the single unit WML. Does it fade in anyway or only if this is set to yes?
First read, then think. Read again, think again. And then post!
bruno
Inactive Developer
Posts: 293
Joined: June 26th, 2005, 8:39 pm
Contact:

Post by bruno »

You should probably use [side] when possible. You may need to use prestart events if you are doing something dynamic based on the recall list. You would only use start events if you wanted the player to see the units appear.
joshudson
Posts: 501
Joined: January 17th, 2006, 8:04 pm
Contact:

Post by joshudson »

toms wrote:Turin, but there is a key fade_in= in the single unit WML. Does it fade in anyway or only if this is set to yes?
If you are using this in the prestart event, no. The prestart events take place before the map is drawn.
CHKDSK has repaired bad sectors in CHKDSK.EXE
Post Reply