[SCR / SCR util] PropMONGLER (r3: 10-04-30) - browse and edit persistent variables

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Scripting / Modding Moderators, Moderators for English X Forum

User avatar
AtomicDryad
Posts: 209
Joined: Sat, 19. Jan 08, 02:04

[SCR / SCR util] PropMONGLER (r3: 10-04-30) - browse and edit persistent variables

Post by AtomicDryad » Wed, 24. Mar 10, 17:04

ACHTUNG! WARNING! DISCLAIMER!
This can probably screw up your game if used improperly. If you're not familiar with a variable please don't delete or change it. Do not whine to the author of a script if you break it with PropMONGLER, unless you are the author and talk to yourself. If you start talking to yourself as the result of using PropMONGLER, please contact a licensed physician.

OOC BLURB
PropMONGLER is a tool to browse and edit both global and local variables. It is capable of looking into nested arrays.

This is intended for development use, though it can be used to tweak certain third party scripts, perhaps. Please note that while I have tested it and it works for me, there may be unforseen bugs. The last 20 edits are backed up in the global 'ad.PropMONGLER.backup.

Also note that a good portion of this was written with the assumption of sanity in X3 scripting, however I have since discovered that not only is an array automatically a reference object, but the arrays returned by 'get global / get local' are refs to persistent data. Again, I have tested to ensure that the script behaves according to such odd rules.

IC BLURB
"Split say spoon not exist!"

USAGE
Copy script and t file, run script from script editor. Once it's been executed once it will also appear on the Community Config Menu, if installed. (If you don't know how to run a script from the script editor, do not use.)

Please let me know if you find this useful, and if you have advice on ways to improve, tell me!

http://fnord.to/x3/propmongler-r3.zip

Image
Image
Image

TODO
Creating gvars/lvars.
Copying, deleting, repositioning, and adding subarrays.
Rewrite, as I'm not pleased with the chaotic code structure that was the result of discoveries while writing this. :lol:

CHANGELOG
r2: allows one to call this from within a script for debugging, passing it an array as argument.
r3:
Feature: Insert/remove array members.
Feature: Menu for player owned items.
Feature: Task listing / termination on objects.
Bugfix: Copying a var that's an array now creates a clone, instead of copying the variable (which was a ref).
Last edited by AtomicDryad on Fri, 30. Apr 10, 23:55, edited 5 times in total.

Logain Abler
Posts: 2254
Joined: Mon, 31. Oct 05, 09:44
x4

Post by Logain Abler » Sun, 28. Mar 10, 15:58

Great utility AtomicDryad,

I've been using this alot to check all the array formats and values whilst rebuilding PM, saves a lot of write to log files comands and values can be checked in real-time.

This is a must have. I won't be building scripts without it.

LA

Logain Abler
Posts: 2254
Joined: Mon, 31. Oct 05, 09:44
x4

Post by Logain Abler » Mon, 29. Mar 10, 18:42

This utility should be added to the tutorial & resources sticky. Honestly this is without a doubt one of the most useful scripts/utilities that anyone whose scripts use global/local variable could have.

I just wish I'd thought of it first!

Please, please, please try this utility and don't let it slip under the radar. Trust me you will love it.

LA

User avatar
AtomicDryad
Posts: 209
Joined: Sat, 19. Jan 08, 02:04

Post by AtomicDryad » Wed, 31. Mar 10, 06:03

Thanks :D
R2: No array adding/reordering/etc yet, but now it can be used inside a script for debugging as so:
Image

User avatar
s9ilent
Posts: 2011
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent » Wed, 31. Mar 10, 09:13

:) Gw,

I had an idea like this once (Thou I was possibly over zealous in what I wanted from it, and I was overwhelemed so I gave up the idea)

Just an idea, add some kind of 'variable explorer' option, which could essential act like a windows explorer sort of thing, but for a variable (of array type). So it could open up a menu with a tree view of the elements in the array.

User avatar
AtomicDryad
Posts: 209
Joined: Sat, 19. Jan 08, 02:04

Post by AtomicDryad » Fri, 2. Apr 10, 17:40

s9ilent wrote:
Just an idea, add some kind of 'variable explorer' option, which could essential act like a windows explorer sort of thing, but for a variable (of array type). So it could open up a menu with a tree view of the elements in the array.
Well, it basically acts like a filemanager already (objects are drives, variables are directories, variables with arrays are subdirectories), though it's more like MC than explorer. A tree view seems feasable, I may add it some time.

User avatar
AtomicDryad
Posts: 209
Joined: Sat, 19. Jan 08, 02:04

Post by AtomicDryad » Fri, 30. Apr 10, 23:53

New version:
Feature: Insert/remove array members.
Feature: Menu for player owned items.
Feature: Task listing / termination on objects.
Bugfix: Copying a var that's an array now creates a clone, instead of copying the variable (which was a ref).

Logain Abler
Posts: 2254
Joined: Mon, 31. Oct 05, 09:44
x4

Post by Logain Abler » Fri, 30. Apr 10, 23:55

AtomicDryad wrote:New version:
Feature: Insert/remove array members.
Feature: Menu for player owned items.
Feature: Task listing / termination on objects.
Bugfix: Copying a var that's an array now creates a clone, instead of copying the variable (which was a ref).
Outstanding

LA

Coruskane
Posts: 811
Joined: Fri, 13. Jun 08, 13:14
x3tc

Re: [SCR / SCR util] PropMONGLER (r3: 10-04-30) - browse and edit persistent variables

Post by Coruskane » Wed, 22. Sep 10, 13:19

Please let me know if you find this useful,
darn useful.

But I only found this from links in others threads. Maybe request for this to be added to S&M library and Tutorials/Resources?

and if you have advice on ways to improve, tell me!
Maybe add a logging feature? For example, one useful feature would be to loop through all ships and write to a log file all local variables that follow a certain root/pattern. E.g. write to log fille all that begin with plugin.X.Y.*. This could enable nice checking that a local variable setting etc is configured correctly for a wide variety of particular instantiations and circumstances.

edit: and likewise, being able to nuke variables (either local for a given object, global, or local for all objects) according to a root would be nice.

User avatar
Jack08
Posts: 2971
Joined: Sun, 25. Dec 05, 11:42
x3tc

Post by Jack08 » Sun, 7. Nov 10, 08:51

The download link is broken, is anyone able to upload this somewhere?

Logain Abler
Posts: 2254
Joined: Mon, 31. Oct 05, 09:44
x4

Post by Logain Abler » Sun, 7. Nov 10, 11:30

Jack08 wrote:The download link is broken, is anyone able to upload this somewhere?
Try this:
propmongler

LA

User avatar
Jack08
Posts: 2971
Joined: Sun, 25. Dec 05, 11:42
x3tc

Post by Jack08 » Sun, 7. Nov 10, 11:32

Logain Abler wrote:
Jack08 wrote:The download link is broken, is anyone able to upload this somewhere?
Try this:
propmongler

LA
Tyvm Logain

jtedit
Posts: 6
Joined: Thu, 16. Apr 09, 23:33
x3ap

Re: [SCR / SCR util] PropMONGLER (r3: 10-04-30) - browse and edit persistent variables

Post by jtedit » Thu, 11. Nov 10, 21:52

AtomicDryad wrote: If you start talking to yourself as the result of using PropMONGLER, please contact a licensed physician.
What if you already talk to yourself? :P

Very useful anyway. Thanks.

User avatar
ScRaT_GER
Posts: 1958
Joined: Tue, 8. Jan 08, 19:19
x3tc

Post by ScRaT_GER » Mon, 30. May 11, 00:29

Hi,

none of the downloads works anymore. Could someone reupload this script?

Greetings,
ScRaT

Btw: This needs to be in the tutorials or scripts sticky.

User avatar
ScRaT_GER
Posts: 1958
Joined: Tue, 8. Jan 08, 19:19
x3tc

Post by ScRaT_GER » Thu, 29. Dec 11, 12:16

I reuploaded this script and made it a setup-only script, which automatically adds a hotkey. There is no uninstall script though...

http://www.file-upload.net/download-398 ... R.zip.html

Greetings,
ScRaT

Post Reply

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”