My little macro for merman cages :P

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
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

My little macro for merman cages :P

Post by toms »

Here:

Code: Select all

#define MERMAN_CAGE DESC_ONE DESC_TWO DESC_THR TYP_ONE TYPE_TWO TYPE_THR X Y SIDE

{PLACE_IMAGE misc/cage.png ({X}) ({Y})}
{PLACE_IMAGE merman.png ({X}) ({Y})}

[event]
name=moveto
 [/filter]
 side={SIDE}
 x,y={X},{Y}
 [/filter]

 [removeitem] [/removeitem]

 [unit]
 type={TYPE_ONE}
 description={DESC_ONE}
 x,y={X},{Y}
 [/unit]
 [unit]
 type={TYPE_TWO}
 description={DESC_TWO}
 x,y={X},{Y}
 [/unit]
 [unit]
 type={TYPE_THR}
 description={DESC_THR}
 x,y={X},{Y}
 [/unit]
[/event]
#enddef
:P
First read, then think. Read again, think again. And then post!
User avatar
Noyga
Inactive Developer
Posts: 1790
Joined: September 26th, 2005, 5:56 pm
Location: France

Post by Noyga »

You should add a filter inside your [removeitem] [/removeitem] because this will remove every objects (not just the cage).
If you use twice your macro, it will remove the two cages when you walk over a cage...
User avatar
Elvish_Pillager
Posts: 8137
Joined: May 28th, 2004, 10:21 am
Location: Everywhere you think, nowhere you can possibly imagine.
Contact:

Post by Elvish_Pillager »

Noyga wrote:You should add a filter inside your [removeitem] [/removeitem] because this will remove every objects (not just the cage).
If you use twice your macro, it will remove the two cages when you walk over a cage...
A filter? You can't filter a [removeitem]...
It's all fun and games until someone loses a lawsuit. Oh, and by the way, sending me private messages won't work. :/ If you must contact me, there's an e-mail address listed on the website in my profile.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

[removeitem] requires x and y keys.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

Noyga wrote:You should add a filter inside your [removeitem] [/removeitem] because this will remove every objects (not just the cage).
If you use twice your macro, it will remove the two cages when you walk over a cage...
You mean it can be used twice at the same loc?
If yes, a variation wich generates one or two would be useful because you can combine to a large merman-cage event.
First read, then think. Read again, think again. And then post!
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

[removeitem] removes all objects at the x,y location.

If you want a multi-object event, you can place the new objects after the old objects are removed. You should also place a new moveto event inside the old moveto event, and the new event will be created when the old one is triggered.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

You mean just stacking the events together or make macros for getting the mermen and combining them to the right number?

It was mainly joking, but it may find use.
First read, then think. Read again, think again. And then post!
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

toms wrote:You mean just stacking the events together or make macros for getting the mermen and combining them to the right number?

It was mainly joking, but it may find use.
Stacking. However, we may not be talking about the same thing.
Hope springs eternal.
Wesnoth acronym guide.
toms
Posts: 1717
Joined: November 6th, 2005, 2:15 pm

Post by toms »

I think on

Code: Select all

[event]
(action)
 [event]
 (action)
 [/event]
[/event]
and this confuses me. or do you mean it should be only a merman generator macro without the moveto event and then more of them can be in an event?
First read, then think. Read again, think again. And then post!
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Man, I have no clue what you're talking about. While your macro does have an advantage in that it allows you to hardcode x,y values once, it has the disadvantage of hard-coding the number of mermen that come out of the cage and only allowing mermen to be in cages as opposed to other caged types of units. As a result, I personally would do it just the way we do it in Bay of Pearls. I only wanted to point out the incorrect syntax of [removeitem].
Hope springs eternal.
Wesnoth acronym guide.
Post Reply