A couple of dialog questions

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
Flameslash
Posts: 633
Joined: December 21st, 2008, 12:29 pm

A couple of dialog questions

Post by Flameslash »

Hi, I'm making an investigation/exploration-themed scenario, and was wondering how to set up the dialogue to work in a few ways.

Firstly, I want to have a unit (any) say something upon entering a certain hex, to which another unit (specific) will reply. This part, I can do easily with a moveto event set to that hex, and some [message] commands. The problem arises when the specific unit who replies is the one to enter the hex, as he ends up replying to himself.

One solution I've found to this is to have a separate event for that particular unit id entering the hex, - however, I only want one of them events to be able to fire in a single playthrough, not both.

So what I'm asking of you kind folks is - how do I either have the event play out differently depending on which unit triggers it, or disable one event after running the other?

Or, perhaps, I'm missing something obvious. I have a habit of doing that.
User avatar
Ravana
Forum Moderator
Posts: 3002
Joined: January 29th, 2012, 12:49 am
Location: Estonia
Contact:

Re: A couple of dialog questions

Post by Ravana »

Obvious solution would be to use if to assign speaker based on unit.
User avatar
Sapient
Inactive Developer
Posts: 4453
Joined: November 26th, 2005, 7:41 am
Contact:

Re: A couple of dialog questions

Post by Sapient »

to disable, you could set a boolean variable. like {VARIABLE someone_said_it “yes”}

then in both events, test if that variable not_equals=yes before showing the message.

there are many ways of doing it.
http://www.wesnoth.org/wiki/User:Sapient... "Looks like your skills saved us again. Uh, well at least, they saved Soarin's apple pie."
User avatar
Celtic_Minstrel
Developer
Posts: 2207
Joined: August 3rd, 2012, 11:26 pm
Location: Canada
Contact:

Re: A couple of dialog questions

Post by Celtic_Minstrel »

I'd say you need to use an [if] tag to check whether the unit who landed on the hex is the specific unit who replies, and give him a different message in that case, while if someone else lands there, you give the normal message and then his reply.
Author of The Black Cross of Aleron campaign and Default++ era.
Former maintainer of Steelhive.
Post Reply