Questions about Persistence and setting Alive mod

  1. 5 years ago

    Hi, I'm Michel and I've been reading these forums for a while. I've found many threads that really helped me sometimes, so thanks for that.

    Now I'm posting here for the first time as I have a couple of questions to which I haven't found any answers yet (I do apologise if they have been answered before, but could not find them using the forum's search function). Those questions are as follows:

    1. Is there any way of making the ACEX mod's fortify function compatible with Alive persistence?
    2. This one is a tad silly: when placing an object with the player logistic feature and the game has persistence on, is there a way of deleting permanently said object?

    Thanks in advance for any answers, tips or anything really.

    PS.: I didn't know where exactly to ask about this, rather in the "mission maker" section or in the War "Room/Persistence" one. So excuse me if I did wrong

  2. 1. I think ACE just made modifications that would make such a thing possible. I think @dixon13 has done some work relating to this, maybe he can share his stuff.

    2. I don't think so, at least not built into our exposed features. @Tupolov any hope on this one?

  3. Edited 5 years ago by dixon13

    @SpyderBlack723 @Michel answer to number 1 is yes. I have been testing with it and have gotten it to work on my end through some scripting for a mission I have been working on for my community. As I stated in this GitHub issue about 6 months ago #106 , you can just stick code in your init.sqf to get it to work (view GitHub post for info). This works but the down side is that upon restart of the mission, the objects you placed down are not removable. I have hacked a way around this problem though.

    I have setup the following to get ACEX Fortify to work with persistence, a custom ACEX Fortify preset, and a persistent ACEX Fortify budget.

    Note: I have setup the ACEX Fortify budget to update so that when a side west unit kills opfor or resistance, it will give them more currency; and when a civilian is killed, currency is taken away. You can edit the code to your liking but this example gives you an advance configuration.

    GitHub Gist

    EDIT: Moved code over to public GitHub Gist.

  4. Edited 5 years ago by Michel

    Thank you very much for the answers guys, really!

    @dixon13 Will try that as soon as possible, but again, thanks. Specially for posting you code, I've 0 skill when it comes to scripting and this just made my day.

  5. To answer number 2, you need to be admin and able to open up the debug console to run code. There is no easy way to delete objects permanently, but through script you can.

    You can delete an object by looking at it and running code below in your debug console...

    [alive_sys_logistics,"removeObject", [cursorObject]] call ALiVE_fnc_logistics;
    deleteVehicle cursorObject;

    This will remove the object from the database and delete the object as well. No other way I know of to delete objects and remove them from database, but I use this if people are starting to get crazy with building OPs/COPs/PBs, or stuff starts blowing up or glitches.

  6. Again, thank you. I just tried your scripts for the fortify tool and works marvellous, just what I was looking for.

  7. @dixon13 now all you need to do is find some way to only make things available with the fortify tool when you're within x meters of a specified container ;)

  8. @JD_Wang I think it would be pretty easy because IIRC there is a condition to check whether a player can fortify or not. I will look into it more when I get home because I actually want this kind of feature for my community. I have also updated my scripts above and will post the updates here.

  9. Using this function should work. Example below...

        params ["_unit", "_object", "_cost"];
        private _return = (MHQ distance _unit) < 50;
    }] call acex_fortify_fnc_addDeployHandler;

    This code will return true if the player is within 50 meters of an object called "MHQ". Above code should be ran on client at init, so probably just place it in initPlayerLocal.sqf

  10. That's awesome, thanks!
    I look forward to testing that out :)

  11. Edited 5 years ago by dixon13

    Here is easy way to make ammo crates persistent using ACE Logistics. This does not save the data in an ACE Logistics inventory, but it does save it's position and what is in the inventory of the ammo crate. To get around this, just make sure to take out the ammo crate and save it's position and data before restarting the server.

    _action = ["ASO_Logistics_Update", "Save Position", "", {
    	[ALiVE_SYS_LOGISTICS, "updateObject", [_target]] call ALiVE_fnc_logistics;
    	hintSilent "Position saved!";
    }, {true}] call ace_interact_menu_fnc_createAction;
    ["Reammobox_F", 0, ["ACE_MainActions"], _action, true] call ace_interact_menu_fnc_addActionToClass;

    Adds an ACE interaction to the ammo crates that says... "Save Position". Above code should be ran on client at init, so initPlayerLocal.sqf

  12. Updated my post above to include the ammo crate ACE interaction script.

  13. Edited 5 years ago by dixon13

    Moved my code above over to a public GitHub Gist to keep the forum clean here since there was a lot of code.

  14. Well, that's awesome.

  15. Edited 5 years ago by TheDragon117


    **update** Apologies, apparently I stared at script for too long, I walked away for 30 minutes and it became readily apparent I just needed to change Cursor Target with _vehicle and it worked a charm. So thanks for that code snippet.

    I was hoping you could help me understand the function you're using to delete the object, I'm trying to remove an object in a script. The object is detected in a trigger then I delete it which works fine until I load the mission again and then the vehicle returns. If I can hopefully understand that function I can keep the vehicle from returning when the server is reset.

    Sell_Vehicle = {
    		_lot = vehicles inAreaArray NDSF_Sell_Trigger;	
    		if (count _lot == 0) then {
    		"No vehicle in the shop to be sold." remoteExec ["hint", 0, false];
    		} else {
    		_vehicle = _lot select 0;
    			Switch (true) do {
    				case ((typeOf _vehicle) in ["LOP_AM_OPF_BTR60"]) : {
    				deleteVehicle _vehicle;
    				[west, 1500, false] call acex_fortify_fnc_updateBudget;
    				playSound3D ["ca\buildings\sounds\hydraulic_slide.ogg", BudgetPC];

or Sign Up to reply!