Jump to content
Sign in to follow this  
dragon zen

How to Save Content For Replayable Mission, Like VAS???

Recommended Posts

Hi friends:

I want to ask whether I can let players save their component (such as game setting, their preset weapons and so on) during game, and then they can load it easily when re-play the mission. I think such function is just like VAS but I don't know whether it is an addons or pure script system.

I am very appreciated if any body could give me some hint for this, thanks, :D.

Dragon

---------- Post added at 07:54 PM ---------- Previous post was at 07:52 PM ----------

In addition, please notice I want to edit a pure mission, rather than using additional Addons, so I ask whether I can write some script and save some code outside the mission file, and then search and load it next time.

Share this post


Link to post
Share on other sites

With the help of the @inidbi addon (which only needs to run on the server) you can do just that.

There are some examples in this thread:

http://forums.bistudio.com/showthread.php?150293-iniDB-Save-and-Load-data-to-the-server-or-your-local-computer-without-databases!

Just make sure you use this newer version and not the one from the thread:

http://www.armaholic.com/page.php?id=23340

Share this post


Link to post
Share on other sites

or save it in the players profile.

//save
profileNamespace setVariable ["myCurrentWeapon", currentWeapon player];
saveProfileNamespace;

//recall   -   "arifle_MX_Black_F" being the default weapon to add if the profile variable is not found
player addWeapon (profileNamespace getVariable ["myCurrentWeapon", "arifle_MX_Black_F"]);

Heres an example loadout manager that i originally wrote for Iceman's DLS though it never got implemented due to us both losing motivation and RL getting in the way. Think it still works, given it a quick test and appears ok. This uses the players profileNamespace to store unlimited loadouts.

TEST MISSION

Use the action menu to display the UI, fill a name in the bottom edit box to save your first loadout.

Edited by Larrow

Share this post


Link to post
Share on other sites

Word of warning: It's not really advisable to store huge amounts of data in the profile.

I'm using inidbi in my template-mission that me and my friends use for our mcc/zeus sessions.

The way I have it set up, it first asks me to select a savefile (campaign). Once a campaign is loaded, every player will get the loadout he had when he last played that campaign. I've also included a function that allows to save and load selected vehicles and ammocrates along with their contents.

Essentially this allows us to play multi-session campaigns where we keep all our equipment but can still restart the map when we want to build a new mission or even when the team travels to a different island.

Aside from a few limitations, it all works pretty well, but I wouldn't feel comfortable saving that much data to profile.

Share this post


Link to post
Share on other sites

It would be so much better if we were able to create our own .VARS that way we could check if it existed and load our saved vars. It would save the main profile from getting to large and everything having to be loaded, would also provide some safety against corruption, if you no longer use a certain script/addon then delete its .vars file.

Share this post


Link to post
Share on other sites
With the help of the @inidbi addon (which only needs to run on the server) you can do just that.

There are some examples in this thread:

http://forums.bistudio.com/showthread.php?150293-iniDB-Save-and-Load-data-to-the-server-or-your-local-computer-without-databases!

Just make sure you use this newer version and not the one from the thread:

http://www.armaholic.com/page.php?id=23340

WOW WOW WOW, thank you so much!!!

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×