Hi all.
first of all, I have just started making my first mission and I am enjoying the experience due to the amazing levels of support and content available here! Hopefully one day I will know enough about Editing & Scripting ARMA titles to continue this cycle.. - but I digress! (I thought as my first post, it ought to contain something a little sentimental :P)
The main goal of the mission I have been working on, is to destroy 3 OPFOR buildings, (named barracks, UAV, SupplyPoint) and I thought It would be useful to provide a hint that updates the player as to how many of the buildings he has destroyed. Ideally, I would like it to say "You have destroyed x/3 buildings" where x is the amount of buildings destroyed.
Initially (and this is where my lack of experience in SQF shows) my idea was to declare a variable in the init file called "DestructionCount" so my init.sqf now looked like this:
execVM "briefing.sqf";
DestructionCount=0
and then in game make a new trigger with the following
Condition:
!alive barracks
OnAct:
DestructionCount = DestructionCount + 1; hint format["%1",DestructionCount];
this did not work, as the output displayed as "any" where I expected it would be "1" (and even then I am not sure about how I would work actual text into this hint)
so I started researching it, and from what I can tell I need to use a Function. But because I am not very good at coding in general, I struggle to get my head around how I would do this. so my hope was, that by posting my problem, someone who knew what they were talking about, would be able to explain the best way of getting this to work, in as simple a way that is possible.
Thanks in advance!