-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vehicle and crate save/load system across mission restarts #154
base: development
Are you sure you want to change the base?
Vehicle and crate save/load system across mission restarts #154
Conversation
The very early integration of my save/load script for vehicles and crates. The area check function is non-operational which means everything will be saved and loaded which probably breaks a lot of decorations placed around the base and many functions are still filled with old comments and such but here it is in its early form.
Updates: -Area check function should work now -Crate save function added. -Inventory set and get functions for dealing with difficult inventories of objects. Also inventories should now be able to hold weapons with various attachments and containers with items in them like bags or uniforms. All of this is still untested. Might be stuff that breaks in this.
Did some bug hunting and fixed deep inventory save/load system data structure being set wrong. Silly oversight that held me up many days.
Accidentally left in debug stuff. Removed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code as is looks solid. We will need to check if crates are handled by the cleanup script right now, as I'm not sure that's the case. If they are not we will need to make sure they get cleaned up, as otherwise they'll exist forever.
Apologies for the delay in getting back to you on the @Ridderrasmus |
_startLoad = _obj addAction ["Start load", { | ||
if (isServer) then { | ||
[] call vn_mf_fnc_full_load; | ||
[player, _this select 2] remoteExec ["removeAction", 0, true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect. You're globally removing action with _this select 2
ID, which can be different action on every client.
Also this will only work on local hosted as the action won't do anything on dedicated server.
|
||
_savedData = [[], []]; | ||
// To be extra sure we don't load before ID's have been assigned | ||
waitUntil { (((vehicles select {typeOf _x == "vn_b_air_oh6a_01"}) select 0) getVariable ["vehAssetId", ""]) != ""}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems pretty fragile if there's no vehicle of this type it will break. Instead, it should wait for ID system to be initialized, however it works in MF.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it was meant to be temporary but never figured out how to check for the system to finish initializing. Know where I should look to find that?
mission/functions/systems/vehicle_saving/fn_start_save_loop.sqf
Outdated
Show resolved
Hide resolved
_veh setPos (_loc select 0); | ||
_veh setDir (_loc select 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setPos
format is not compatible getPos
and will cause issues if vehicle is over and object. setDir
should also be avoided as it resets up vector.
Use position world and vectorDirAndUp.
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
Co-authored-by: Filip Maciejewski <[email protected]>
System that saves and loads crates and vehicles across mission restarts.
Fully intended to be given over to you lot to change and mess around with however you want to make it work better for Mike Force. Added mission parameters for the autosave which probably also could be done better in your system somewhere.
Been in some contact with Alablm about how to do this and I will probably come back with one or two more things some time down the line to add.
Thanks for an awesome persistent mission.