PS - did that "format..." thing work? Or do I have to kill myself?
Nope...
Just says "Error Unknown Operator"...
So, are you planning to use rope, gun or what…
Okay... Here goes:
So if sol1 picks up weap3, globalVariable_1 = sol1.
But if sol1 drops weap3, globalVariable_1 = sol1 still.
Yes... BUT if the weapon dropped by the sol1 is picked by another dude, like sol6, then sol1 would get nilled and sol6 would become the globVar_1...
I'm starting to doubt that's this is not even possible to do...
No I was just curious to know what you wanted to do as there are wealth of possible approaches, is it for one guy, 100 hundred guys e.t.c
Well, it could be for 100 guys as well...
So, it is for more that 1 dude...
I made a list of what the sript(s) should do (if this clarifies anything...)
1. Check what weapons the soldiers are carrying and cross reference them with the weapon array. Should check only secondaryWeapon since other checks not needed.
2. If a match is found assign the soldier carrying the first match as globalVariable_1, a soldier carrying the second match as globalVariable_2, and so on...
3. If the globalVariable_1 drops/puts down the weapon he still stays as globalVariable_1.
BUT if the weapon he dropped/put down is picked up by another soldier that soldier now becomes the globalVariable_1...
Or the globalVariable_1 dies and someone else picks up the weapon from him that someone would get assigned as globalVariable_1...
So in a sense the weapon matched in the weapon array should sort of be 'toetagged' with the globalVariable_#... (Or maybe the weapon should be assigned as a global variable as well...
)
I know this must be somewhat confusing and I just can't explain it any better...
All I know is that I have a clear 'vision' in my head what this script should do...
Here's the code I have now, did this a while while back and it's fully functional. Don't care about the global variables, they are defined elsewhere and this is only one part of currently five part script...
Only drawback this has is that you can use it only for one specific weapon and one dude...
(Well actually two as they carry the weapon in two parts...)
_nr = 0
_pArr = units group player - [player]
_intAmmo = HTR_depWepAmmo
?(HTR_weaponCarrierSet == 1) && (HTR_tripodCarrierSet == 1): exit
#loopCheck
~.05
_unit = _pArr select _nr
?(alive _unit) && (_unit hasWeapon HTR_wpnToDeploy): HTR_weaponCarrier = _unit; HTR_weaponCarrierSet = 1
?(alive _unit) && (_unit hasWeapon HTR_trpToCarry): HTR_tripodCarrier = _unit; HTR_tripodCarrierSet = 1
?(_nr == (count _pArr)): exit
_nr = _nr + 1
?(HTR_weaponCarrierSet == 1) && (HTR_tripodCarrierSet == 1): goto "ammoRoutine"
goto "loopCheck"
So this checks the players groups AI who might be carrying a specific weapon and tripod and assigns them as global variables...
Why I want that weapon array for is that it would be predefined so the mission maker would not have to define it by him/herself... With this current code the mission maker needs to define the weapon in the init.sqs specificly...
Why I need the globalVariable_# thingy is that I'd like this script to be useable for more than one weapon per group without the weapon to be predefined... Now this script limits the players group to carry only one portable weapon system which needs to be predefined...
I hope this helps u to get a glimpse of what I'm getting at...