Help needed with event WML

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
assassin
Posts: 71
Joined: August 20th, 2007, 2:54 pm
Location: USA

Help needed with event WML

Post by assassin »

Well I am trying to make some dialogue pop up when a unit moves to a certain spot on my 2p survival map!

Here is the wml I have for it but nothing happens when I play it! why?

[event]
name=defiance
moveto x=7
y=8
[message]
speaker=unit
message= _ "Soldier: Stay foul invader you shall come no further!"
[/message]
[message]
speaker=second_unit
message= _ "enemy: Hahahaha foolish creature even if you kill me it is only a matter of time before you die and your land is my kings!"
[/message]
[/event]

Now what is it that I did wrong!?!?!?

Made the topic title more appropriate --Baufo
Last edited by assassin on September 3rd, 2007, 7:53 pm, edited 1 time in total.
Interested in a LORD OF THE RINGS YAHOO GROUP THEN CHECK OUT http://groups.yahoo.com/group/The_Ring_of_Doom/
My MP name is aldarion!
User avatar
Baufo
Inactive Developer
Posts: 1115
Joined: January 29th, 2006, 4:53 pm
Location: Vienna, Austria

Post by Baufo »

There is no event named defiance - I guess you want to write a moveto event. Have a look at http://www.wesnoth.org/wiki/EventWML to learn more about events.
I was working on the proof of one of my poems all the morning, and took out a comma. In the afternoon I put it back again. -- Oscar Wilde
User avatar
zookeeper
WML Wizard
Posts: 9742
Joined: September 11th, 2004, 10:40 pm
Location: Finland

Post by zookeeper »

How about you first look at any working moveto event ever written before inventing stuff up?
assassin
Posts: 71
Joined: August 20th, 2007, 2:54 pm
Location: USA

Post by assassin »

OH! oops I thought that the event name could be any thing you wanted it to be! lol! ok I went to wiki but I did not see much to help that is probly because I am tierred! any way what would be really nice is for some one to post the wml as it should be for what I am trying to do!
Interested in a LORD OF THE RINGS YAHOO GROUP THEN CHECK OUT http://groups.yahoo.com/group/The_Ring_of_Doom/
My MP name is aldarion!
MDG
Posts: 378
Joined: June 7th, 2007, 11:18 am
Location: UK

Post by MDG »

Try the following but replace the unit in unit_description=unit with the actual unit type you want to filter on e.g. orc_grunt or saurian_augur or kalenz, etc...

Code: Select all

[event]
name=moveto
[filter]
x=7
y=8
unit_description=unit
[/filter]
[message]
speaker=unit
message= _ "Soldier: Stay foul invader you shall come no further!"
[/message]
[message]
speaker=second_unit
message= _ "enemy: Hahahaha foolish creature even if you kill me it is only a matter of time before you die and your land is my kings!"
[/message]
[/event]
assassin
Posts: 71
Joined: August 20th, 2007, 2:54 pm
Location: USA

Post by assassin »

ok thx I will try it
Interested in a LORD OF THE RINGS YAHOO GROUP THEN CHECK OUT http://groups.yahoo.com/group/The_Ring_of_Doom/
My MP name is aldarion!
assassin
Posts: 71
Joined: August 20th, 2007, 2:54 pm
Location: USA

Post by assassin »

ok I did put your stuff in it worked but the second guy does not talk why?
and how do I get it so that any one who moves to 7,8 activates it?
Interested in a LORD OF THE RINGS YAHOO GROUP THEN CHECK OUT http://groups.yahoo.com/group/The_Ring_of_Doom/
My MP name is aldarion!
MDG
Posts: 378
Joined: June 7th, 2007, 11:18 am
Location: UK

Post by MDG »

To get it to trigger for anyone take the unit_description=unit line out of the filter.

Not sure why the second unit isn't speaking. Try changing the two around to check if they work in reverse order (if so, it's probably an issue with the 'speaker=' for the second speaker, i.e. you've used the wrong identifier in some way).
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Post by ILikeProgramming »

I don't there is a second unit for a moveto event.
Moving concerns one unit only.
Derekkk
Posts: 64
Joined: April 25th, 2007, 5:43 pm

Post by Derekkk »

Add
first_time_only=no
and then it should work for the second and third, etc. guys as well.
gabe
Posts: 180
Joined: December 15th, 2006, 1:15 am
Location: an island in the pacific

Post by gabe »

here is some code. was writing then realized i had no idea what was going on. is the player moving to the spot or the ai? kind of matters when writing wml. here is what i got. the sides, role name and location of the not filters may need to move or change value depending on the logic of what you are doing.

Code: Select all


[event]
name=moveto
first_time_only=no
	[filter]
		side=1
		x=7
		y=8
	[/filter]
	[role]
		role=soldier
		type= #types that the guard might be
		[not]
			side=1
			#include all sides that shouldn't be talking, the same way 
		[/not]
	[/role]
	[message]
		role=soldier
		speaker=unit
		message= _ "Soldier: Stay foul invader you shall come no further!"
	[/message]
	[message]
		speaker=unit
		message= _ "enemy: Hahahaha foolish creature even if you kill me it is only a matter of time before you die and your land is my kings!"
	[/message]
[/event]

if it doesn't make sense then check the wml reference on the wiki.[/url]
happy timezone traveler
assassin
Posts: 71
Joined: August 20th, 2007, 2:54 pm
Location: USA

Post by assassin »

Ok thx Gabe it looks good but...
Ok this is to go into my 2p survival side 2 and 3 are humans and side 1 is the computer spawns the comps guy moves to 7,8 then one of your guys says the "stay foul invader you shall come no further" then the comp guy says the "even if you kill me it is only a matter of time before you die and your land is my kings"

So the second guy to talk is the guy to activate do the move to!
(and he is side 1)!

Thx for all the help!!!

P.S. and after this move to event the bridge on 7,8 turns into water! I do not know how to do this!! If it is not possible thats fine the main thing I want is the dialogue!

P.P.S. I do not understand that "#include all sides that shouldn't be talking, the same way"!! and where is says "#put all types that the guard might be" I think I understand that but is the # thing there and I put a , between the names right?
Interested in a LORD OF THE RINGS YAHOO GROUP THEN CHECK OUT http://groups.yahoo.com/group/The_Ring_of_Doom/
My MP name is aldarion!
qk
Inactive Developer
Posts: 57
Joined: September 4th, 2006, 5:47 pm
Location: Prague, CZ
Contact:

Post by qk »

assassin wrote: P.S. and after this move to event the bridge on 7,8 turns into water! I do not know how to do this!! If it is not possible thats fine the main thing I want is the dialogue!
look at terrain action at wiki http://www.wesnoth.org/wiki/DirectActionsWML
this is what you want.
playtom
Posts: 103
Joined: July 21st, 2007, 10:58 pm
Contact:

Post by playtom »

"#include all sides that shouldn't be talking, the same way"
just put any sides you don't want to talk in case they are your enemy of the solider. for the "#put all types that the guard might be" just put in what type of unit you want to be that role when the event triggers.

finnally you don't put # in the codes. it's just used for someone else to look at the codes and describe it.
evolved around the confined environment, emotions, knowledge and events mixed into my life, mere mortal am i, trying to climb higher up the ladder, time passes, just then i realized, death will part me eventually. - playtom's philosophy
assassin
Posts: 71
Joined: August 20th, 2007, 2:54 pm
Location: USA

Post by assassin »

Thx I have it working!
And here is the link to it should you want to try it out!http://www.wesnoth.org/forum/viewtopic.php?t=17527

How do I upload it to the add-ons server?
Interested in a LORD OF THE RINGS YAHOO GROUP THEN CHECK OUT http://groups.yahoo.com/group/The_Ring_of_Doom/
My MP name is aldarion!
Post Reply