Some WML help please

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
perseo
Posts: 324
Joined: January 8th, 2011, 4:09 am

Some WML help please

Post by perseo »

Then, me again asking for help to the WML great sages. This time I have some tasks that I don't know how to code. The first one is this: I have an unit that when it dies the units (friends or enemies) in the abyacent hexagons must die. How I must do it? In the unit .cfg file.
The second one: How I must that a unit that can't die because you lose the scenario, after turn 10 can die then. I must change the event of defeat or what?
Third one: How I code something which have to happen 1 turn after you reach a place?

Thanks for your time and help.
"I was pulling a barrow, when I saw a stalking horse
what a beautiful day!- he said- for visiting a red herring
and getting hoarse."
Working on this campaign: The septentrional tower
monochromatic
Posts: 1549
Joined: June 18th, 2009, 1:45 am

Re: Some WML help please

Post by monochromatic »

1.

Code: Select all

[event]
    name=die
    [filter]
        type=PUT UNIT TYPE HERE
    [/filter]

    [kill]
        [filter_location]
            x,y=$x1,$y1
            radius=1
        [/filter_location]
    [/kill]
[/event]
2.

Code: Select all

[event]
    name=turn 10
    {VARIABLE after_10 yes}
[/event]
[event]
    name=die
    [filter]
        PUT FILTER HERE
    [/filter]

    [if]
        [variable]
            name=after_10
            boolean_equals=yes
       [/variable]
       [then]
           ....
       [/then]
       [else]
           ....
           [endlevel]
               result=defeat
           [/endlevel]
       [/else]
    [/if]
[/event]
User avatar
Kapoue_II
Posts: 203
Joined: October 11th, 2010, 9:41 am

Re: Some WML help please

Post by Kapoue_II »

3.

Code: Select all

[event]
 name=moveto
 [filter]
  PUT LOCATION HERE
 [/filter]
 [set_variable]
  name=tt
  value=1
 [/set_variable]
[/event]

[event]
 name=WHERE IN THE TURN YOU WANT IT TO HAPPEN
 [if]
  [variable]
   name=tt
   equals=1
  [/variable]
  [then]
   .........
  [/then]
 [/if]
[/event]
 
User avatar
StDrake
Posts: 996
Joined: July 21st, 2009, 6:50 am

Re: Some WML help please

Post by StDrake »

or..
3.

Code: Select all

[event]
name=moveto
[filter]
#who can trigger it
[/filter]
#put location here
  [event]
  name=turn refresh
  #specify for whom it is to happen
  side=
  #what happens goes here
  [/event]
[/event]
Like cats? I've made a whole faction of them to kick ass with!
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
User avatar
perseo
Posts: 324
Joined: January 8th, 2011, 4:09 am

Re: Some WML help please

Post by perseo »

But i don't understand. Kapue I don't know the turn in wich it will happen. I only know that It will one turn after you reach the place.
St Drake, If the event is a terrain change it must be something like that?:

Code: Select all

[event]
name=moveto
  [filter]
     unit_type=explosive-caravan
     x=18
     y=32
  [/filter]  
  [event]
  name=turn refresh
  [terrain]
       x=17-19
       y=31-33
       terrain=Ds
  [/terrain]
  [/event]
[/event]
"I was pulling a barrow, when I saw a stalking horse
what a beautiful day!- he said- for visiting a red herring
and getting hoarse."
Working on this campaign: The septentrional tower
User avatar
Kapoue_II
Posts: 203
Joined: October 11th, 2010, 9:41 am

Re: Some WML help please

Post by Kapoue_II »

perseo wrote:But i don't understand. Kapue I don't know the turn in wich it will happen. I only know that It will one turn after you reach the place.
:doh: You are confused about this line?

Code: Select all

[event]
name=WHERE IN THE TURN YOU WANT IT TO HAPPEN
[if]
....
I am not asking WHICH turn I am asking WHERE in the turn. If you wanted it at the start of the turn, you would put;
name=new_turn

Or if you wanted it at the end of the the turn then it would be
name=end_turn
Rowanthepreacher
Posts: 126
Joined: March 3rd, 2011, 7:14 pm

Re: Some WML help please

Post by Rowanthepreacher »

Hey, just a quick question, because the first answer sparked my interest.

If you set up a win condition unit (the one you have to kill) that would kill everything (radius=50 or something), but you have heroes that aren't allowed to die, how would you make the game kill the unit, wipe everyone out, but give you the win before it realised that you had lost your heroes?
User avatar
StDrake
Posts: 996
Joined: July 21st, 2009, 6:50 am

Re: Some WML help please

Post by StDrake »

@Rowan - use fire_event=no in the kill tag

I don't have experience with using the terrain tag, but it looks like it should work..perhaps just 'new turn' is indeed a better choice than 'turn refresh', I used the latter cause I'm used to eras and expected to see a side= to specify on whos turn it would fire
Like cats? I've made a whole faction of them to kick ass with!
Don't like cats? I've made a whole faction of them to kick their asses! So everyone's happy :)
Felinian faction is part of the Beyond Southern Hells era
kitties need sprites! art topic here
User avatar
perseo
Posts: 324
Joined: January 8th, 2011, 4:09 am

Re: Some WML help please

Post by perseo »

@ Kapue: Srry I didn't read it well... :oops:

@ St Drake:Thank you very much. The answer to Rowan was useful for me too.

Then other one thing: If I want a unit who has the AI special: guardian to move between two points like patrolling. I must code all the movements or there's a shortcut for doing it. (The scenario has 32 turns and there are more than one unit doing that so coding all the movements is a hell). I was thinking in a macro who says that in pair turns move to point "A" and in unpair turns move tu point "B". But I don't know how to do it.

Thanks for your help (as always).
"I was pulling a barrow, when I saw a stalking horse
what a beautiful day!- he said- for visiting a red herring
and getting hoarse."
Working on this campaign: The septentrional tower
Rowanthepreacher
Posts: 126
Joined: March 3rd, 2011, 7:14 pm

Re: Some WML help please

Post by Rowanthepreacher »

StDrake wrote:@Rowan - use fire_event=no in the kill tag

I don't have experience with using the terrain tag, but it looks like it should work..perhaps just 'new turn' is indeed a better choice than 'turn refresh', I used the latter cause I'm used to eras and expected to see a side= to specify on whos turn it would fire
Wouldn't that just stop the event from going off, so no-one would die?
User avatar
Kapoue_II
Posts: 203
Joined: October 11th, 2010, 9:41 am

Re: Some WML help please

Post by Kapoue_II »

Rowanthepreacher wrote:
StDrake wrote:@Rowan - use fire_event=no in the kill tag

I don't have experience with using the terrain tag, but it looks like it should work..perhaps just 'new turn' is indeed a better choice than 'turn refresh', I used the latter cause I'm used to eras and expected to see a side= to specify on whos turn it would fire
Wouldn't that just stop the event from going off, so no-one would die?
No. fire_event=no prevents external death events (those triggered by the event in question) from being fired, but the killing happens as per usual.
Rowanthepreacher
Posts: 126
Joined: March 3rd, 2011, 7:14 pm

Re: Some WML help please

Post by Rowanthepreacher »

Ohhhhh. Cool. Cheers, guys.
Post Reply