Display variables dynamically in objectives
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.
Display variables dynamically in objectives
Hello,
I have the following objective which initially displays what I want, "(0/10)":
However when I update the variable the text remains the same. I already checked the variable with the inspect command, it changed.
Here is my event with which I update the variable:
I would appreciate any idea how can I update my objective after the event was fired.
I have the following objective which initially displays what I want, "(0/10)":
Code: Select all
[objective]
description="Destroy every naga village ($destroyed_village/10)."
condition=win
[/objective]
Here is my event with which I update the variable:
Code: Select all
[event]
name=capture
first_time_only=no
[filter]
side=1
[/filter]
[sound]
name=torch.ogg
[/sound]
{VARIABLE_OP random_string value "scenery/rubble.png"}
{RANDOM $random_string}
{PLACE_IMAGE $random $x1 $y1}
{CLEAR_VARIABLE random,random_string}
{MODIFY_TERRAIN Ss $x1 $y1}
[set_variable]
name=destroyed_village
add=1
[/set_variable]
[redraw]
side=1
[/redraw]
[/event]
Re: Display variables dynamically in objectives
There's an example of how to do this in the scenario "Test of the Clans". (I think you just need to change
$destroyed_village
to $|destroyed_village
.)Re: Display variables dynamically in objectives
Thanks a lot for the quick reply. It solved my problem.