show_objectives consufion

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
Spannerbag
Posts: 86
Joined: December 18th, 2016, 6:14 pm

show_objectives consufion

Post by Spannerbag »

Hi,

I'm puzzled as to why show_objectives isn't working as I'd expect.

I have a scenario with multiple sides, side 1 is player, side 2 is initially null and the other sides are ai controlled.

My issue is that show_objectives doesn't seem to update side 1 objectives.


Here are the relevant code snippets:

Initial side setup:
side 1: controller=human
side 2: controller=null

Objectives setup:

Code: Select all

  [event]
    name=start
    [objectives]
      side=1,2
      [objective]...

Later in the scenario side 2 is populated with units and is transferred to player control.
(I use side 1 turn end turn x because at this point side 2 controller=null, so side turn 2 events do not fire)

Code: Select all

  [event]
    name=side 1 turn {ON_DIFFICULTY 7 8 9} end
...
recall units
...
    [modify_side]
      side=2
      controller=human
      gold=130
      income=2
      hidden=no
    [/modify_side]
...
    [show_objectives]
    [/show_objectives]
  [/event]
This all works fine for side 2 but side 1 does not refresh?

I tried adding a second [show_objectives] for side 1 the turn after the changes to side 2 are applied:

Code: Select all

# Refresh side 1 objectives turn after side 2 controller change
  [event]
    name=side 1 turn {ON_DIFFICULTY 8 9 10}
    [show_objectives]
      side=1
    [/show_objectives]
  [/event]

No change.
Before I start spending a lot of time trying to bottom this out I have to ask: have I done something stupid?

Often, when I post something I realise the error shortly after so here's hoping that happens here!

Any advice greatly appreciated,
cheers!
-- Spannerbag
UMC Campaign: After EI
I suspect the universe is simpler than we think and stranger than we can know.
User avatar
Lord-Knightmare
Discord Moderator
Posts: 1543
Joined: May 24th, 2010, 5:26 pm
Location: Somewhere in the depths of Irdya, gathering my army to eventually destroy the known world.
Contact:

Re: show_objectives consufion

Post by Lord-Knightmare »

[show_objectives] works when the starting objectives was changed due to some event/condition.
Your initial objectives needs to have this added otherwise, [show_objectives] will do nothing.
User avatar
Spannerbag
Posts: 86
Joined: December 18th, 2016, 6:14 pm

Re: show_objectives consufion

Post by Spannerbag »

Hi,
thanks for the reply, much appreciated.
Lord-Knightmare wrote: May 3rd, 2021, 3:55 pm [show_objectives] works when the starting objectives was changed due to some event/condition.
Your initial objectives needs to have this added otherwise, [show_objectives] will do nothing.
So, if I understand you, I need to add [show_objectives] sometime after setting up [objectives] for the first time?

Also, as often happens when I post a query I stumbled across a solution (see next post) :)

Thanks again,
cheers!
-- Spannerbag
UMC Campaign: After EI
I suspect the universe is simpler than we think and stranger than we can know.
User avatar
Spannerbag
Posts: 86
Joined: December 18th, 2016, 6:14 pm

show_objectives consufion *** resolved ***

Post by Spannerbag »

Hi all,
no need to reply to my query as I managed to get it working.
Though I thought I'd tried this before, I just stripped out all the side=... clauses (including [objectives]) and it worked.
Happy days :D

Cheers!
-- Spannerbag
UMC Campaign: After EI
I suspect the universe is simpler than we think and stranger than we can know.
Post Reply