Events : unit at the right place, the right moment
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.
Events : unit at the right place, the right moment
EDIT : PROBLEM SOLVE.
Hi !
First excuse me for the mistakes, but im french and I dont speak english very well.
I really appreciate this game, that's while im working on my own campaign, but i have encounter a problem.
The side 1 have one unit, for example at x=1 y=1, and I want that when these unit go to an aera, it activate an event BUT only after the turn 5. This area could be for example the "square" define by the four point : (5,5), (5, 10), (10, 10) and (10, 5).
I try something like that (and variant of course !)
However i try to made it, but without succes. How can I do it ?
If you have any idea, please tell my : I would appreciate all explanation
Hi !
First excuse me for the mistakes, but im french and I dont speak english very well.
I really appreciate this game, that's while im working on my own campaign, but i have encounter a problem.
The side 1 have one unit, for example at x=1 y=1, and I want that when these unit go to an aera, it activate an event BUT only after the turn 5. This area could be for example the "square" define by the four point : (5,5), (5, 10), (10, 10) and (10, 5).
I try something like that (and variant of course !)
Code: Select all
[event]
name=moveto
[filter]
side=1
turn > 5 #here ">" is not an acceptable operator, but I cant imagine use something like "turn = 6 or turn = 7... turn = last turn"
x=5, 6, 7, 8, 9, 10
y=5, 6, 7, 8, 9, 10
[/filter]
[message]
id=person
message= _ "Hello, world !"
[/message]
[/event]
If you have any idea, please tell my : I would appreciate all explanation

Last edited by Cluric on October 6th, 2012, 9:19 pm, edited 1 time in total.
Re: Events : unit at the right place, the right moment
You can do that by creating nested events:
So, in turn 5 the moveto event will be registered.
Code: Select all
[event]
name=turn 5
[event]
name=moveto
[filter]
side=1
[/filter]
[message]
id=person
message= _ "Hello, world !"
[/message]
[/event]
[/event]
UMC Story Images — Story images for your campaign!
Re: Events : unit at the right place, the right moment
You want to use this:
x=5-10
y=5-10
Not this:
x=5,6,7,8,9,10
y=5,6,7,8,9,10
The first one is a square, the second one is a diagonal line from 5,5 to 10,10.
http://wiki.wesnoth.org/StandardLocatio ... nate_Usage
x=5-10
y=5-10
Not this:
x=5,6,7,8,9,10
y=5,6,7,8,9,10
The first one is a square, the second one is a diagonal line from 5,5 to 10,10.
http://wiki.wesnoth.org/StandardLocatio ... nate_Usage
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
Re: Events : unit at the right place, the right moment
Thanks for the quik answer, but it's not exactly what I wanted (sorry, I probably wasn't clear)
Your code only works at the turn 5. But, I'll prefer an event in the 5th turn... and after. Must I made one imbricated event like
Well otherwise, have you some idea about a "square" zone ?
EDIT : Im just seeing your answer Sapient, thanks, it works and I'm glad because I dont read enouth WML specification ! The half of my problem is solve in 10 min only. I like this forum
Your code only works at the turn 5. But, I'll prefer an event in the 5th turn... and after. Must I made one imbricated event like
Code: Select all
[event]
name=turn X
[event]
name=moveto
.....
[/event]
[/event]
[event]
name= turn X+1
etc...
[/event]
EDIT : Im just seeing your answer Sapient, thanks, it works and I'm glad because I dont read enouth WML specification ! The half of my problem is solve in 10 min only. I like this forum

Re: Events : unit at the right place, the right moment
No, the moveto event will be registered on the 5th turn; and from then on it will fire whenever the first unit from side 1 steps on it. If you want to have the event fire each time a unit steps on it, you need to putCluric wrote:Your code only works at the turn 5.
first_time_only=no
in the inner event.UMC Story Images — Story images for your campaign!
Re: Events : unit at the right place, the right moment
Excuse me you're right !
I was thinking I understand perfectly how the system of [event]works, but I wasn't the case. Now I understand better the things.
After testing, I confirm, It work.
Thanks, problem solve !
I was thinking I understand perfectly how the system of [event]works, but I wasn't the case. Now I understand better the things.
After testing, I confirm, It work.
Thanks, problem solve !