Home   Help Search Login Register  

Author Topic: writing external files / cross-mission data-access  (Read 1384 times)

0 Members and 2 Guests are viewing this topic.

Offline shole

  • Members
  • *
writing external files / cross-mission data-access
« on: 07 May 2008, 16:40:25 »
hi
i'm writing an addon where i absolutely must read the same data across every mission that uses my addon, and write to that data with some mechanism
(this would be as a part of my displayeventhandler addon; http://www.ofpec.com/forum/index.php?topic=31384.0 )
i'm way out of my depth with this, so i'm asking for suggestions on how to proceed

ideal functionality would be to have the game ask for a key assignment when it detects an unassigned key from any addon and have a config button in main menu for later reconfiguration

here's ideas i've had;
1. force users to use a launcher which grabs variables from memory <- bad idea, immediately discarded and never even concidered
2. dump variables into arma.rpt and force users to run an external parser that writes the appropriate config file <- also bad idea, no way
3. create a campaign and force users to start/restart a mission and show a config dialog in there, which creates a campaign status file, which would be read by the addon
problem; as i understood it, scripts are 'chrooted' to arma install dir with no access outside it, like user profiles, where campaign status is stored
is there a way around this?
apart from creating a symbolic link to the profile folder, which also is a bad idea and very unreliable
4. force users to run an external config application that reads the list of possible keys from a database manually written by each addon author that uses this
not very user friendly, and prone to user errors in keeping key list in sync with addons
5. i noticed there's some variables that look a lot like some addons in the activeKeys[] property in the *.ArmAProfile file - can these, or any property in the profile, be written and read somehow?

better ideas for sharing variables across missions are welcomed
« Last Edit: 07 May 2008, 16:56:52 by shole »

Offline Cheetah

  • Former Staff
  • ****
Re: writing external files / cross-mission data-access
« Reply #1 on: 07 May 2008, 22:43:57 »
I think that you can include external files to get variables. But I'm not sure if you can rewrite those files to update variables etc. Think that it was Mando Missile where I saw the include, so mandoble might know if it's possible to write data.
Like missions? Help with Beta Testing! or take a look at the OFPEC Missions Depot for reviewed missions!

Offline shole

  • Members
  • *
Re: writing external files / cross-mission data-access
« Reply #2 on: 08 May 2008, 13:37:56 »
yes, reading data inside the arma filetree is not a problem
the problem is there's no way of writing inside the arma tree - only function i know that can write is to the profile, which is outside the arma folder and unreachable by any read function i know of
only thing i KNOW would work would be an external executable, which is not optimal, but would have to do if nobody has any better ideas

Offline Mr.Peanut

  • Former Staff
  • ****
  • urp!
Re: writing external files / cross-mission data-access
« Reply #3 on: 08 May 2008, 14:08:28 »
If you do decide to go with an external, might take a look at dsts.
« Last Edit: 12 May 2008, 16:34:25 by Mr.Peanut »
urp!

Offline shole

  • Members
  • *
Re: writing external files / cross-mission data-access
« Reply #4 on: 08 May 2008, 18:04:43 »
ah, yes
this would be option #1, which i discarded outright
maybe if it was already widely used and offered some wider advantages, perhaps
like dxdll did
but it's not really nice to demand it without prior application and this visibly little advantage