Ok, so I have managed to save my weapons into inventory. However, putting them back into the game seems to be a bit trickier... for starters I cannot get iStringVal to return any sort of number. In my case,the variable keeps it's default value, whatever it might be. Here is some truncated code for the sake of brevity...
There is something in the string to int conversion that I am not seeing, but I have been pounding my brains for a couple of hours trying to figure it out
Edit-It doesn't matter where I put the conversion block either.... I have tried in the initialisation section, outside of it... just about everywhere with no results.
Code: [Select]
if ( gameLoaded ==1) {
iGlobalStringGet(sniperPicked,2);
iGlobalStringGet(m4Picked,3);
iGlobalStringGet(shotgunPicked,4);
iGlobalStringGet(glockPicked,5);
iGlobalStringGet(magPicked,6);
iGlobalStringGet(uziPicked,7);
sniperPicked1-iStringVal(sniperPicked);
m4Picked1-iStringVal(m4Picked);
shotgunPicked1-iStringVal(shotgunPicked);
glockPicked1-iStringVal(glockPicked);
magPicked1-iStringVal(magPicked);
uziPicked1-iStringVal(uziPicked);
for (int chosenWeapon = m4Picked1; chosenWeapon < numWeapons; chosenWeapon++) {
VAL_1 = chosenWeapon;
weaponsCatched[chosenWeapon] =true;
VAL_2 = 1;
gameLoaded = 0;
OUT_331=gameLoaded;
break;} }//no more weapons at the time
I can confirm that I am getting the correct data with iGlobalStringGet, as it prints out properly with a text print object...There is something in the string to int conversion that I am not seeing, but I have been pounding my brains for a couple of hours trying to figure it out
Edit-It doesn't matter where I put the conversion block either.... I have tried in the initialisation section, outside of it... just about everywhere with no results.