OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: norbe on 19 Sep 2005, 00:55:41

Title: variable addition
Post by: norbe on 19 Sep 2005, 00:55:41
Hello to you all,

Just a quick question, i'm making a map in which im going to count the amount of tanks destroyed, and once the total number reaches a certain amount (probably four, i havn't decided that yet) it triggers a script. I know that the best way to use this would be to use an integer variable, but im unsure of the correct syntax to use when adding to the variable.

I tried

TanksKilled = TanksKilled + 1

but it didn't seem to work, i also tried

TanksKilled + 1 = TanksKilled

but that didn't work either.

Help would be greatly appreciated.

Norbe

Title: Re:variable addition
Post by: UNN on 19 Sep 2005, 01:14:48
Hi,

In your missions init.sqs, make sure you have:

Code: [Select]
TansKilled=0
If you don't, OFP won't know TanksKilled is supposed to be a number.
Title: Re:variable addition
Post by: norbe on 19 Sep 2005, 01:24:32
Brilliant, put it in the init.sqs and it works, huzzah.

thanks for your help UNN.

Norbe.