[message] behaviour check

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.
User avatar
Spannerbag
Posts: 538
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [message] behaviour check *can reproduce behaviour* 1_of_3

Post by Spannerbag »

"Just another 10 minutes" I said to myself.
For once it wasn't a waste of time, I can now reproduce the behaviour.
I did this in my test campaign with standard units.

? ... Seems I can't upload all these small screen dumps in a single post so I've split it into 3...

If the [message] is issued inside a turn event then it all works fine.
However I was had a side 1 unit issuing dialogue when a side 2 unit fulfilled a moveto requirement.

Here's the test code:

Code: Select all

  [event]
    name=side 1 turn 1 refresh
    [terrain]
      x,y=4,5
      radius=3
      terrain=Fda
    [/terrain]
   {GENERIC_UNIT 1 (Wose Sapling) 5 6}
   {GENERIC_UNIT 1 (Wose Sapling) 6 3}
   {GENERIC_UNIT 1 (Elvish Avenger) 5 4}
   [message]
     x,y=5,6
     message=_"(Hidden Wose) My side turn"
   [/message]
   [message]
     x,y=6,3
     message=_"(Visible Wose) My side turn"
   [/message]
   [message]
     x,y=5,4
     message=_"(Hidden Elf) My side turn"
   [/message]
  [/event]

  [event]
    name=side 2 turn 1 refresh
   [message]
     x,y=5,6
     message=_"(Hidden Wose) Enemy side turn"
   [/message]
   [message]
     x,y=6,3
     message=_"(Visible Wose) Enemy side turn"
   [/message]
   [message]
     x,y=5,4
     message=_"(Hidden Elf) Enemy side turn"
   [/message]
  [/event]


  [event]
    name=moveto
    [filter]
      x,y=4,8
      side=2
    [/filter]
   [message]
     x,y=5,6
     message=_"(Hidden Wose) Enemy moveto"
   [/message]
   [message]
     x,y=6,3
     message=_"(Visible Wose) Enemy moveto"
   [/message]
   [message]
     x,y=5,4
     message=_"(Hidden Elf) Enemy moveto"
   [/message]
  [/event]
There is a village at 4,8 that the enemy leader always captures on turn 1.
All the messages have highlighting except for the movetos...
I thought that in the problematic scenario unhidden units were fine but here even the unhidden units do not highlight?


Anyway, some screen grabs for the code above follow.

side 1 turn 1 refresh
msg_wh1.png
msg_wv1.png
msg_eh1.png
End of part 1

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 538
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [message] behaviour check *can reproduce behaviour* 2_of_3

Post by Spannerbag »

Part 2
side 2 turn 1 refresh
msg_wh2.png
msg_wv2.png
msg_eh2.png
End of part 2

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
Spannerbag
Posts: 538
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [message] behaviour check *can reproduce behaviour* 3_of_3

Post by Spannerbag »

Part 3 (the interesting bit)
moveto
msg_whmt.png
msg_wvmt.png
msg_ehmt.png
End of part 3

Any thoughts, comments etc. greatly appreciated!

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
lhybrideur
Posts: 369
Joined: July 9th, 2019, 1:46 pm

Re: [message] behaviour check

Post by lhybrideur »

Spannerbag wrote: June 12th, 2023, 12:15 pm
Nice, thank you very much.
I will try that when I have the time.
The goal would be to have a time_over event with a dialog between the main character and the closest enemy
User avatar
Spannerbag
Posts: 538
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [message] behaviour check

Post by Spannerbag »

lhybrideur wrote: June 13th, 2023, 7:58 am Nice, thank you very much...
You're very welcome! :D

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
User avatar
beetlenaut
Developer
Posts: 2827
Joined: December 8th, 2007, 3:21 am
Location: Washington State
Contact:

Re: [message] behaviour check

Post by beetlenaut »

Spannerbag wrote: June 13th, 2023, 2:42 am Any thoughts, comments etc. greatly appreciated!
Since this behavior doesn't seem to be the expected one, this probably qualifies as a bug that can be reported. There might still be a workaround, but I won't have time to look for one for about a week.
Campaigns: Dead Water,
The Founding of Borstep,
Secrets of the Ancients,
and WML Guide
User avatar
Spannerbag
Posts: 538
Joined: December 18th, 2016, 6:14 pm
Location: Yes

Re: [message] behaviour check

Post by Spannerbag »

beetlenaut wrote: June 14th, 2023, 8:04 pm Since this behavior doesn't seem to be the expected one, this probably qualifies as a bug...
OK, done.

After quite a bit of mucking about I couldn't get the effect I wanted and removed the whole logic (several hints)... it's now an easter egg :)

Cheers!
-- Spannerbag
SP Campaigns: After EI (v1.14) Leafsea Burning (v1.17, v1.16)
I suspect the universe is simpler than we think and stranger than we can know.
Also, I fear that beyond a certain point more intelligence does not necessarily benefit a species...
Post Reply