I have an integer variable that increases on unit death.
I have an event that displays a text message (using the combineing text function) saying "SCV's Killed" and the Integer, so when one unit is killed it reads
"SCV's Killed 1" then "SCV's Killed 2" and so on....
I have an Objective that, again does pretty much exactly the same thing as the text message but reads
"SCV's Killed 0/4"
This "should" increase when an SCV is killed, it uses exactly the same code as the text message except as an objective, but no matter how many SCV's i explode it never reads more than 0, while the text message displays the correct value.
There is obviously something im missing here... i just cant wrap my poor feeble mind around it... do objectives not update maybe? so its not picking up the integer changes?
You have to update objectives youself. There's a action called something like: Objective - Set Objective Text
You might have to store your objective in a variable (I've had problems when using Last Created Objective).
Objectives are nothing else than simple text messages, just like the normal UI Text Message. Just that they stick to the top-left corner and are somewhat sorted and formated without you doing anything. But you have to update them yourself.
Sorry to resurrect an older post, but this is all i could find... I am having the same problem, example of my code is...
GlobalVariable-DestroySpawners=NoObjective<Objective>Trigger-CreateBuildingsToKillObjective(Runsafterinitialization)Objective-CreateaHiddenPrimaryobjectivewithtext("Destroy the Spawners: "+((Text(DeadBuildingsNumber))+("/"+(Text(NumberOfBuildingsArea01)))))anddescription""Variable-SetDestroySpawners=(Lastcreatedobjective)Objective-MarkDestroySpawnersasActiveTrigger-BuildingDiesEventsUnit-AnyUnitdiesLocalVariablesindex=0<Integer>General-Foreachintegerindexfrom0to13withincrement1,do(Actions)ActionsGeneral-If(Conditions)thendo(Actions)elsedo(Actions)If(Triggeringunit)==(Unit1fromUnitGroupBuildingsArea01[index])ThenVariable-SetBuildingNumber[index]=1Variable-ModifyDeadBuildingsNumber:+1Objective-SetDestroySpawnerstextto("Spawners Destroyed: "+((Text(DeadBuildingsNumber))+("/"+(Text(NumberOfBuildingsArea01)))))Else
What should happen, is when you destroy a "Spawner" building, it updates the objective text to read "Spawners Destroyed: 1/4" where the "1" is the number of buildings that have been destroyed.
Currently it is not updating the objective with the "Set Text" if it contains any sort of variable, however if i change the line of code to:
Objective - Set DestroySpawners text to "This is retarded"
...it works.
is this a bug in the editor, or am i missing something fundamental here?
I have an integer variable that increases on unit death.
I have an event that displays a text message (using the combineing text function) saying "SCV's Killed" and the Integer, so when one unit is killed it reads
"SCV's Killed 1" then "SCV's Killed 2" and so on....
I have an Objective that, again does pretty much exactly the same thing as the text message but reads
"SCV's Killed 0/4"
This "should" increase when an SCV is killed, it uses exactly the same code as the text message except as an objective, but no matter how many SCV's i explode it never reads more than 0, while the text message displays the correct value.
There is obviously something im missing here... i just cant wrap my poor feeble mind around it... do objectives not update maybe? so its not picking up the integer changes?
Many thanks in advance!
You have to update objectives youself. There's a action called something like: Objective - Set Objective Text
You might have to store your objective in a variable (I've had problems when using Last Created Objective).
Objectives are nothing else than simple text messages, just like the normal UI Text Message. Just that they stick to the top-left corner and are somewhat sorted and formated without you doing anything. But you have to update them yourself.
Hmmm i thought that might be the case, i guess the objective doesnt refresh itself when the variable increases, shame but i'll live.
Thanks for the help :)
Sorry to resurrect an older post, but this is all i could find... I am having the same problem, example of my code is...
What should happen, is when you destroy a "Spawner" building, it updates the objective text to read "Spawners Destroyed: 1/4" where the "1" is the number of buildings that have been destroyed.
Currently it is not updating the objective with the "Set Text" if it contains any sort of variable, however if i change the line of code to:
Objective - Set DestroySpawners text to "This is retarded"
...it works.
is this a bug in the editor, or am i missing something fundamental here?
@Incr3dibad: Go
nevermind, it fixed itself when i reloaded the editor a few times.