Unit Marco?

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
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Unit Marco?

Post by DEATH_is_undead »

I remember it done before, but how, I forgot. I remember at the end of the {}'s, the x,y was shown with a space instead of a coma. I looked through the Wiki, but couldn't find anything concerning it, though the day before i did. 2 hours looking back, I realized it must have been taken out. Someone please help me with this, it'd make my maps a lot easier...



Thanks,
DEATH (The_Unforgiven)
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Re: Unit Marco?

Post by zookeeper »

What?
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Unit Marco?

Post by DEATH_is_undead »

.... I saw it before, {UNIT ID X Y} or something... I'm not sure.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
AI
Developer
Posts: 2394
Joined: January 31st, 2008, 8:38 pm

Re: Unit Marco?

Post by AI »

http://www.wesnoth.org/macro-reference.xhtml

That's all the macro documentation there is.

Macro parameters are space-separated.
In ordinary WML, stuff works like this:

Code: Select all

x=1
y=2
but you can shorten that to:

Code: Select all

x,y=1,2
that's not specific to x and y keys though, you can just as well do this:

Code: Select all

[unit]
type,description,user_description,x=Spearman,guywiththespear,_"weird name",1
hitpoints,y,side=28,2,1
[/unit]
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Unit Marco?

Post by DEATH_is_undead »

Not what i meant, but close. It was, as i described, in {}'s... I believe it was F8_Binds that did it.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
AI
Developer
Posts: 2394
Joined: January 31st, 2008, 8:38 pm

Re: Unit Marco?

Post by AI »

That macro has endured massive changes during 1.3, currently, the macros you want to use are:
GENERIC_UNIT SIDE TYPE X Y
NOTRAIT_UNIT SIDE TYPE X Y
LOYAL_UNIT SIDE TYPE X Y ID_STRING NAME_STRING

they pretty much do what their name says, call them like this:

Code: Select all

{GENERIC_UNIT 1 Spearman 23 19}
{LOYAL_UNIT 2 (Royal Guard) 3 38 lisarguard2 (_"Li'sar's Guard")}
Parentheses are used to make the contents be seen as a single parameter rather than multiple.
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Unit Marco?

Post by DEATH_is_undead »

Yes, thank you, now that i remember it more, i believe it was 1.2.4 that he showed me the map...
EDIT:

Code: Select all

 {LOYAL_UNIT 2 (ID OF UNIT) X Y (_"Monster")}
Whats the '2' after ,LOYAL_UNIT for?
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
CIB
Code Contributor
Posts: 625
Joined: November 24th, 2006, 11:26 pm

Re: Unit Marco?

Post by CIB »

Obviously the side.
User avatar
DEATH_is_undead
Posts: 960
Joined: March 4th, 2007, 3:00 pm
Location: Northern United States

Re: Unit Marco?

Post by DEATH_is_undead »

Didn't think of that. Thanks.
3P MP Scenario - Great Dwarves Escape
The best way to learn is to follow. In order to learn WML, you have to follow other's work, and check their codes.
Post Reply