Jump to content

xBowBii

Member
  • Content Count

    25
  • Joined

  • Last visited

  • Medals

Everything posted by xBowBii

  1. Hey guys, This is just a snippet of code I've written some months ago, I tested it and it seemed to work perfectly but you might need to tweak some lines for it to work, I can't remember.. The code uses profileNamespace to write to a .var file some information, in this case all vehicles including its position, damaged (and non-damaged) hitpoints, fuel, cargo, ... I even used it to save placed objects (player-built, missions, ...) for my own survival mod (WIP). loadVehicles.sqf /* File: loadVehicles.sqf Author: xBowBii (aka xbwb) 08/03/15 */ _vehicles = profileNamespace getVariable ["SURV_Vehicles",nil]; { private ["_log","_vtype","_vpos","_vdir","_vdam","_veh","_vFuel","_vWeap","_vMags"]; _vType = _x select 0; _vPos = _x select 1; _vDir = _x select 2; _vDam = _x select 3; _vVar1 = _x select 4; _vFuel = _x select 5; _vWeap = _x select 6; _vMags = _x select 7; _hitp = _x select 8; //"extLOG" callExtension format["0:VehicleLogging: %1 at %2, with dmg %3. Fuel is %4, and Cargo is %5 && %6",_vType,_vPos,_vDam,_vFuel,_vWeap,_vMags]; if (_vDam == 1) exitWith {/* useless to spawn it */}; _veh = createVehicle [_vType, _vPos, [], 0, "CAN_COLLIDE"]; _veh setDir _vDir; _veh setDamage _vDam; removeAllWeapons _veh; removeAllItems _veh; _veh setVariable ["YOUR_OWN_CUSTOMVAR",_vVar1,true]; { _veh setHitPointDamage [(_x select 0), (_x select 1)]; } forEach _hitp; _veh setFuel _vFuel; { _veh addWeaponCargoGlobal [_x,1]; } forEach _vWeap; { _veh addMagazineCargoGlobal [_x,1]; } forEach _vMags; } forEach _vehicles; sleep 20; SURV_VehiclesLoaded = true; saveVehicles.sqf /* File: saveVehicles.sqf Author: xBowBii (aka xbwb) 08/03/15 */ SURV_VehiclesLoaded = false; waitUntil {SURV_VehiclesLoaded}; while {true} do { profileNamespace setVariable ["SURV_Vehicles",[]]; { _Vehs = profileNamespace getVariable ["SURV_Vehicles",[]]; _vehicle = _x; _xType = typeOf _x; _xPos = getPos _x; _xDir = getDir _x; _xDmg = damage _x; _xOwns = _x getVariable ["YOUR_OWN_CUSTOMVAR",[]]; _xFuel = fuel _x; _weapons = weaponCargo _x; _magazines = magazineCargo _x; _hitPoints = []; _cachekey = format["%1_HP", _xType]; _hitpoints = missionNamespace getVariable[_cachekey, []]; if (_hitpoints isEqualTo []) then { _na = configProperties[configFile >> "CfgVehicles" >> _xType >> "HitPoints", "_hitpoints pushBack configName _x; true", true]; missionNamespace setVariable[_cachekey, _hitpoints]; }; _finalHitPs = []; { _finalHitPs = _finalHitPs + [[_x,_vehicle getHitPointDamage _x]]; } forEach _hitPoints; profileNamespace setVariable ["SURV_Vehicles",(_vehs + [[_xtype,_xpos,_xdir,_xdmg,_xowns,_xFuel,_weapons,_magazines,_finalHitPs]])]; } forEach vehicles; saveProfileNamespace; sleep 20; }; Both scripts executed by this: if (isServer) then { execVM "\PATH\TO\loadVehicles.sqf"; execVM "\PATH\TO\saveVehicles.sqf"; }; If you want to use it, please do so, just remember crediting my work even though I won't use it myself and I had a lot of fun to write this tiny script. I hope you appreciate my work, please post suggestions if you have any! xbwb
  2. Make it something like this ForEach (allMissionObjects ["classnameAmmoBox1", "classnameAmmoBox2"]) ; I think that should work. https://community.bistudio.com/wiki/allMissionObjects Édit: Yours would use forEach (allMissionObjects _ammoBoxClass); try both methods I listed ;)
  3. Try replacing the "Nil" default value of _vehicles to "[]", or try executing saveVehicles first Remove my multiplayer checks (SURV_VehiclesLoaded) bit of code, it might bug things
  4. Sure! Check for the "foreach allMissionObjects" if I remember correctly. Replace that with an array containing the list of ammo crates which you van get easily. (NearSupplies, nearObjects, allMissionObjects etc, then filter all those objects with typeOf)
  5. Psssst. Try checking this out, I hope it might help you out ! Careful: if you want to use this for multiplayer use, remember that players can edit this namespace very easily. xbwb
  6. Anyone news on this? @mind , is it now possible in some way to paint those simpleObjects without the need of 3DEN editor? There's no point of telling us we can createSimpleObjects from the mission if we can't texture them; right? Thanks!
  7. Hey guys, I can't get BIS_fnc_findSafePos to work, my RPT is getting spammed by this error message: Error in expression < BIS_fnc_isPosBlacklisted)) then { if ((_pos distance _testPos) >= _minDist) the> Error position: <_pos distance _testPos) >= _minDist) the> Error Undefined variable in expression: _pos File A3\functions_f\misc\fn_findSafePos.sqf, line 98 Error in expression <["_newX", "_newY", "_testPos"]; _newX = _posX + (_maxDist - (random (_maxDist * > Error position: <_posX + (_maxDist - (random (_maxDist * > Error Undefined variable in expression: _posx File A3\functions_f\misc\fn_findSafePos.sqf, line 90 When executing this code: _position = [[14291,14854,0],0,12000,5,0,20,0] call BIS_fnc_findSafePos; Is the function broken? Thanks, xBowBii
  8. xBowBii

    DSS: The Mod

    Hey Ranwer! It's so good to have you back! :D First of all, nice work on the IIR system, it looks great! I've seen you are still working with modules and it made me question something.. Why don't you prefer to make a mission that doesn't use modules? Modules are a fun way to go, but personnaly I'd prefer a premade MPMission that I can customize myself. I know that you prefer to use modules because they're easy to use for the server-owners and players, anyway I'll see if I can work on it too and check if I can add some things if you want. Do you think you could make a public Github so that we can help with the code? I think it would be very nice and easier for us. By the way, would you like help somewhere? I am ready to help if you need it. :) Stay awesome! xBowBii
  9. xBowBii

    DSS: The Mod

    Okay so guys ( @HeroesandvillainsOS and @Evil Organ mainly) I'd like to give my little opinion on what Ranwer just said/did.. You need to understand that for "solo" people who have projects like DSS or myself "Survivalized", it's very hard to keep working on because we can't stop comparing our work to that of a team like Exile or Epoch or whatever other "big" and known mods out there.. And when working on the mod, we kind of think like "we can't do aswell as X or Y mod" and it's very hard to keep working with that in mind.. When we see all the work of other mods we're kind of jealous and we say to ourselves "i'll never be capable of doing this".. So this is my one cent, maybe Ranwer isn't feeling like this at all but this is why I personally stopped.. "This is already done" and "X already has done this" and "Theirs is way better than mine" :( -xbwb
  10. xBowBii

    if variables

    Btw, use a "switch"-structure if you want better performance ;)
  11. Could you try on Altis? I always get that error when executing that code on altis.. In the VR map it works like a charm.. Uh? It doesn't matter if the code after my code is working, the game just throws an error when executing my code ;) But thanks in advance for the help guys, I appreciate it :)
  12. xBowBii

    DSS: The Mod

    That program looks awesome!
  13. xBowBii

    DSS: The Mod

    Looks neat ! Great job mate.
  14. xBowBii

    DSS: The Mod

    I will test MP too. ;)
  15. xBowBii

    DSS: The Mod

    I cannot wait to see these zombies!! :D
  16. xBowBii

    DSS: The Mod

    Awesome @Ranwer135 !!! How are you going to proceed for the release? Is it going to be public? Awesome work Ranwer!
  17. xBowBii

    DSS: The Mod

    I can't wait to see it! :D
  18. xBowBii

    DSS: The Mod

    Awesome, I can't wait to see these zeds ! Any new screenshots incoming? :D
  19. xBowBii

    DSS: The Mod

    Nice! I'm so hyped for the release. :D
  20. xBowBii

    DSS: The Mod

    Great news @ranwer135 !
  21. xBowBii

    ADuke's Kiowa Pack

    Looks really nice, I can't wait to see in-game pics. Keep up the good work mate!
  22. xBowBii

    DSS: The Mod

    Awesome news!
  23. xBowBii

    DSS: The Mod

    This looks great! I am not very familiar with Github either, I just know it's very-well done for development (using "issues" people can point out in the code, "pushes" where you can publish new versions, ...). You might want to give it a little look, maybe you'll find it perfect, who knows? ;) Have you yet found out how to save vehicles and players' stats across "restarts" for multiplayer? I guess the campaign saves automatically when the player exits? (I've never looked at how campaign works :s) For the PIP-thing, awesome. If you need any help at all, you know who to call ;) I'll send you some more ideas using the personal messenger. :)
  24. xBowBii

    DSS: The Mod

    @Ranwer135 Just some little questions :) - Will the loot work on all maps? (All maps that have lootPositions I guess?) - Do you have an idea on when the mod will be availible? - Will you put the source on Github so the development "team" will be able to review code an implement new features? For character projecting (for the Survival menu) what could be very nice is making another unit (non playable) using the exact same stuff as the player itself, and using PIP display it in the menu? (I can't express my idea correctly, I'll try to write it using steps: make non-playable unit using same stuff as player in the middle of nowhere, hide object from all players (including the player itself) but not from the "camera" facing it, so that you can display the camera's view as PIP in the inventory of the player and he can see himself (even if its not 100% him, because it's another unit)..) I'll try to explain it better a little bit later. :P PS: Could you check your inbox please? I've sent you a PM ;)
×