how give a message just for one player ?

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
michel
Posts: 15
Joined: September 5th, 2005, 8:31 am

how give a message just for one player ?

Post by michel »

In multiplayer mode, I want to give a message just for one player, when one of his units go in a special case :
[item]
x=54
y=32
image=items/signpost.png
[/item]
[event]
name=moveto
[filter]
side=3
x=54
y=32
[/filter]
[redraw]
[/redraw]
[message]
speaker=narrator
message= _ "the village"
[/message]
[/event]

My probleme is that all the players can read the message " the village" on their screen and not only the player number 3.
How to do that ?
Thank you.

If you've got some informations on : how use an item like a potion or a ring....

Thanks
User avatar
Tomsik
Posts: 1401
Joined: February 7th, 2005, 7:04 am
Location: Poland

Post by Tomsik »

i guess you should put it on 'scenario&campaigns development' forum, i guess its not right place for this
MadMax
Posts: 1792
Joined: June 6th, 2004, 3:29 pm
Location: Weldyn, Wesnoth

Post by MadMax »

I think [message] will take a side= paramater, which you can set to $side_number.
"ILLEGITIMIS NON CARBORUNDUM"

Father of Flight to Freedom
http://www.wesnoth.org/wiki/FlightToFreedom
michel
Posts: 15
Joined: September 5th, 2005, 8:31 am

It's very interesting

Post by michel »

but I don't understand what you mean...
can you explain, please...
Thank you.
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Post by ILikeProgramming »

EDIT: won't work. Side=$side_number makes a unit on that side speak. I tested it.
Last edited by ILikeProgramming on September 10th, 2005, 5:43 pm, edited 1 time in total.
scott
Posts: 5243
Joined: May 12th, 2004, 12:35 am
Location: San Pedro, CA

Post by scott »

Hope springs eternal.
Wesnoth acronym guide.
ILikeProgramming
Posts: 837
Joined: April 14th, 2005, 4:17 am

Post by ILikeProgramming »

Did you try using a normal message tag, for the game might only show messages for the active player.
michel
Posts: 15
Joined: September 5th, 2005, 8:31 am

Post by michel »

ok, thank you , I'm going to try the $...
another question : i don't understand the code for a variable.
look at this :
a unit go to a special case
[event]
name=moveto
[filter]
side=1
x=18
y=50
[/filter]
[message]
message= _ "you are on a special case"
[/message]

and now, I want this side (side 1) have got the right to use an object.
So, I must use a variable, but How ?
I know that I must define a variable before my message and change it after . How ?
so, if you can translate this..... thanks a lot...

namevariable=open
open=no

(if unit go on case 18,50 then open=yes)
(if open=yes then unit can use object)

don't translate "unit can use object", it's ok, but can you help me on the begining, the variable and the if...then...?
thank you
Post Reply