Jump to content

zeddy360

Member
  • Content Count

    5
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About zeddy360

  • Rank
    Rookie
  1. actually first i've read that it wouldn't save that variable but then i tried it on a hosted LAN game with only me as player and it did save that variable which confused me. maybe the saving behavior depends on any special condition or it's different for hosted or dedicated games or something? i just wanted to be sure that i can rely on it getting properly saved in any case. IF i can't rely on that, i of corse need another way.
  2. hi, i'm currently developing a MP mission where you have to gather resources by completing objectives. currently i'm saving the amount of the already gathered resources to a missionNamespace variable (just a number). i've read that these variables are not saved when saving the game. is this true? if i save the game and then resume it, the variable still has it's saved value. i tested it alone on a hosted LAN game. maybe it's different for a hosted or dedicated internet game? anyways, if it is true, i don't want to install anything like a mysql addon or something to save this persistently. i've thought about placing a marker on the map and use one of it's coordinates to save the value persistently. merker positions should be saved in any case, right? would that be a good approach or is there a better way to save something like that persistently without using a database or something like that?
  3. for some reason i can't open a topic in this forum section and can't reply to all threads but i want to share something that took me some days to archieve and it's more or less related to this thread. please don't hit me :) i was looking for a simple save/load equipment script but only found either broken or not fully working scripts. i also tried to use the functionality of VAS but it turned out that VAS doesn't work correctly with some mods that i've got installed (it didn't load the waeapon attachments, weapon was from the bundeswehrmod, attachment was vanilla). finally i found BIS_fnc_exportInventory and decided to do it myself. i'm still new to SQF so this might be a bit ugly in some parts but it gets the job done and works in MP as well. i've put this into my init.sqf: saveEquipment = { _loadout = [player,'script',true] call BIS_fnc_exportInventory; profileNamespace setVariable ['respawnLoadout',_loadout]; saveProfileNamespace; }; loadEquipment = { _loadout = profileNamespace getVariable "respawnLoadout"; _codeArray = []; { _push = _x; if (_x select [4,24] == "// Remove existing items") then { _push = _x select [4+24]; }; if (_x select [4,17] == "// Add containers") then { _push = _x select [4+17]; }; if (_x select [4,14] == "// Add weapons") then { _push = _x select [4+14]; }; if (_x select [4,12] == "// Add items") then { _push = _x select [4+12]; }; if (_x select [4,15] == "// Set identity") then { _push = _x select [4+15]; }; _codeArray pushBack _push; } foreach (_loadout splitString ";"); _code = _codeArray joinString ";"; call compile _code; }; then i made a box and added actions to it: this addaction ["<t color='#EECC00'>Change Equipment</t>",{ ["Open",true] call BIS_fnc_arsenal; }]; this addaction ["<t color='#BEEEEF'>Save Gear for Respawn</t>",{ [] call saveEquipment; }]; finally i added a respawn event handler to the player (also in init.sqf): player addEventHandler ["Respawn", { [] call loadEquipment; }]; what it does: it generates a script that is similar to what is exported by the arsenal. this is then saved to a variable in the players profile. when he respawns it loads that script up and executes it which equips him again. the problems with this are: - "compile" doesn't preprocess the code and therefore i had to manually get rid of the comments in the script that gets returned by "BIS_fnc_exportInventory". if that functions gets changed some day so that more comments are in the returned script, it will break the loadEquipment function. - this executes code that comes from a profile that the player potentially can change manually afaik. so the player would be able to execute his own code on your server. for me this is no problem since i will play it with some friends only but one has to be aware of that risk if he want's to use this. maybe the equipment could be saved to a different namespace that can't be manually manipulated by editing files. but i'm still new to all this so i dunno how.
  4. to be honest, i never played arma on public servers with strangers so i can't say much about the community in general. i only play with some friends or alone. we usualy played the becti mission but it's a bit buggy and has other things we don't like which is why i decided to make my own mission. so i'm currently starting with SQF and have a problem i can't seem to fix. unfortunately for me it has a very strange syntax but i think i'm getting used to it.
×