Dialog - Message issues

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
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Dialog - Message issues

Post by Graziani »

Hello guys,

I have simple code issue with dialogs.

A simple but to me important thing i would like to do is to improve the way the dialogs are occuring in my campaign "A Goblin Adventure".

A lot of times in my campaign, Goblins are arguing with each others, mocking their comrades etc... I need to code something that allow different goblins to speak and not the same unit everytime. Because in the campaign, everytime, the goblin is arguing with himself. I know gobs are stupid but...

To be clear, here are some examples :

Code: Select all

[event]
name=moveto
first_time_only=yes
[filter]
side=1
x=20-28
y=49-52
            [not]
                type=Giant Spider
            [/not]
[/filter]

        [message]
[filter]
side=1
x=13-21
y=31-57
            [not]
                type=Giant Spider
            [/not]
[/filter]
            message=_"They said wolves were going elsewhere! It's not good direction!"
        [/message]

        [message]
             speaker=unit
            message=_"No, it's this way!"
        [/message]

        [message]
[filter]
side=1
x=13-21
y=31-57
            [not]
                type=Giant Spider
            [/not]
[/filter]
                    side=1
            message=_"We told you it's not!"
        [/message]

        [message]
             speaker=unit
            message=_"Ah... Then you are probably right."
        [/message]


[/event]


For this previous example, how can i avoid the possibility that "unit" will not speak in the side1 role ?:

A simple [filter] and [not] id=unit ?


It can maybe work for this example but here it cannot do the job I think :

Code: Select all


[event]

name=start

#dialogue starts

         [message]
            speaker=Kark
            message= _ "The forest! This place is so dirty! All this grass!"
        [/message]

        [message]
            speaker=Forx
            message= _ "It's full of trees, i prefer caves's mushrooms."
        [/message]

        [message]
            side=1
[not]
id=Kark
[/not]
[not]
id=Forx
[/not]
[not]
type=Giant Spider
[/not]
            message= _ "Are you kidding me? Some of them are really disgusting and poisonous!"
        [/message]

        [message]
            side=1
[not]
id=Kark
[/not]
[not]
id=Forx
[/not]
[not]
type=Giant Spider
[/not]
            message= _ "Hahaha! Do you prefer to run around the forest? Pouah! You are worst than an elve you!"
        [/message]

          [message]
            speaker=Kark
            message= _ "Eh oh! Gobs! We focus and we find our wolves!"
        [/message]

          [message]
            side=1
[not]
id=Kark
[/not]
[not]
id=Forx
[/not]
[not]
type=Giant Spider
[/not]
            message= _ "Kark is right! Let's find them!"
        [/message]

        [message]
            speaker=Forx
            message= _ "I hope humans didn't kill them..."
        [/message]
        
    


In my mind, the 3 characters "side1" are different goblins. But everytime, the same unit answer, and in some situations it's of course very strange. Do you have an idea to correct this ?

Thanks in advance!
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Dialog - Message issues

Post by Pentarctagon »

One option would be to use [store_unit] using the same filter, and then randomly choose a unit from the ones stored as the speaker.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
Graziani
Posts: 179
Joined: December 20th, 2010, 1:04 am
Location: France

Re: Dialog - Message issues

Post by Graziani »

Thanks, gonna try this !
Creator and maintainer of "A goblin adventure" (available) and "From Rocks and Blood"(available) --- Working on a new campaign "Facing Death"
User avatar
Helmet
Posts: 641
Joined: December 19th, 2006, 5:28 pm
Location: Florida, USA

Re: Dialog - Message issues

Post by Helmet »

Graziani wrote: December 16th, 2020, 11:57 am Thanks, gonna try this !
When you got it figured out, please post the code. It's possible that the same goblin could be randomly selected to speak a message several times in a row. I'm wondering how you'll account for that.

I wish there were a few more keys to make using message easier. Such as...

Code: Select all

[message]
	random_unit=Floob,Blarpi,Lumpy,Keith
	message="Do we go east or west?"
[/message]
[message]
	random_unit=Floob,Blarpi,Lumpy,Keith
	message="North."
	have_the_same_unit_speak_twice_in_a_row=no # 		this would be default
[/message]
It would also be nice if you could make a list of units, as if they were standing in a line, and the speaker was simply the next unit in line.

Code: Select all

[message]
	line=Floob,Blarpi,Floob,Blarpi,Floob,Blarpi
	next_in_line="Is east that way?"
	next_in_line="No, that's west."
	next_in_line="But I thought the sun rose in the east."
	next_in_line="You're looking at the moon."
[/message]
Author of:
DIY Campaign, Confederacy of Swamp Creatures: Big Battle 1, Confederacy of Swamp Creatures: Big Battle 2, Frogfolk Delivery Service, The Pool of Ek.
Post Reply