Jump to content
syscrash

Printing all Variables to a file

Recommended Posts

So I have been learning scripting for a short while and obviously my drive like many of you is to improve a favorite mod my friends and I play which has not been updated in a very long time. On to my goal:

 

I am trying to improve the mod by saving variables to a database. I have all that figured out but now I am trying to locate every variable in the scripts that need to be saved to MySql. I done a lot of this by scanning through the code, using find, etc inside Atom (Great for this BTW). But this process is very slow. 

 

Is there a command such as AllVariables or utilizing GetVariables I can utilize and print to a text file? So I can obtain a list of the variables sent to NameSpace??

 

I would image I would use a loop to pull through all the variables but through my research I cannot find how I would place them in a file that i could read. I come from the PHP world of programming. Any pointers or suggestions would be greatly appreciative. 

Share this post


Link to post
Share on other sites

I know of that command. I'm unsure if it's possible to write them all to a text file for review? Sorry for my confusion and thank you for your response. 

Share this post


Link to post
Share on other sites

Ah, my misunderstanding. I'm unfamiliar with building databases in Arma, but there are plenty of knowledgeable folks here who are. 

Share this post


Link to post
Share on other sites

copyToClipboard - Requires you to manually paste.

https://community.bistudio.com/wiki/copyToClipboard

copyToClipboard format ["allVariables :: %1", allVariables];

DLL requirement:

http://killzonekid.com/arma-extension-make_file-dll-v1-0/

diag_log - Prints to RPT

You can setup batch file to copy / paste for you though... All depends on what you are doing which leads me to:

What is it you are trying to accomplish?

Share this post


Link to post
Share on other sites

You can only serialize numbers, strings and booleans and the arrays of the above, so no you cannot save ALL variables even if you wanted to without some sort of hacking

Share this post


Link to post
Share on other sites

@Killzone_kid  Thank You and love your work BTW.  

 

@HazJ

I am currently working on the mod Overthrow. I love the campaign style with our group. But we run into the issue with the persistent save system (profileNamespace) getting corrupted on our multi player sessions. Anyone know how to decode profileNameSpace by any chance because I know the variables are in there? 

Long story short. I'm just setting up a MySQL database to store the data in there instead of the built in persistent save. I have a lot of work cut out for being new to sqf but I am having fun and learning and I have my motivation to learn more. Hopefully I will be contributing more to the community down the road.  I appreciate everyone's feed back!  

 

Share this post


Link to post
Share on other sites

You can search for the variables if you open it, I believe you can see values or if not, reverse it. Not sure why .vars is corrupting for you. Stick to what you are doing (MySQL method) haha. Feel free to add me on Steam/Discord for additional support! I admire your learn will power and motivation haha.

  • Thanks 1

Share this post


Link to post
Share on other sites
On 27.12.2018 at 12:15 AM, syscrash said:

Anyone know how to decode profileNameSpace by any chance because I know the variables are in there? 

It's just a binarized config file. Use Arma 3 Tools CfgConvert to debinarize it.

  • Like 2

Share this post


Link to post
Share on other sites

Thanks guys I'll give that a go tonight. I have stopped. Been learning a lot past few weeks. I apperciate the encouragement and help!!  

I hate to change topics. But do you guys have a specific workflow?  For example, I am trying to get more involved with using Github and I love the command line (old school). I find it difficult navigating all the time to my Arma3 Profile mission folders to edit, upload, etc. 

I was looking more into P drive but wasn't sure if there is an easier way of setting up a "working directory" on another hard drive of mine to make it easier to navigate. When I worked on websites, Hopefully that was not confusing. Just looking at making my workflow easier, testing/debugging, etc. 

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

×