ZLib -- Zarqon's useful function library

The main benefit is that your script settings are separate from mafia's settings. The main drawback is that at present, people must manually edit the vars_myname.txt file to change these values. The previous page has a post with more details about how it works. Eventually, calling ZLib directly will allow for editing vars.
 
The main drawback is that at present, people must manually edit the vars_myname.txt file to change these values.

It would take 20 minutes to whip up a program in C# or Java that would provide a quick GUI for editing the zlib vars based upon which zlib-depending scripts are used... would this be a worthwhile endeavor until this functionality is built into zlib?
 
I got to thinking about a vars editor for zlib. Mainly on how a script writer would be able to identify the variables of note and give some settings for what values are added. For example, technically you could put "bob" in the threshold variable for zlib, but it wouldn't make sense.

And the variables are interspersed in the source file, which makes it hard to track them all done.

So, I was thinking, what if we gave zlib the ability to use a map file to set up the initial variables. Basically a setvars() that takes a map file that just happens to have other fields for showing to an editor. That way, you could put the "documented" variables in a map file which someone's editor could play with, and just call setvars() on the file.

Right now, you don't need much for the basic one:

1. Variable Name
2. Default Value

For an editor, it would have a few other things that would be nice:

3. Type (familiar, location, string, float, etc)*
4. Documentation (a single line to explain what the variable is)

One of the "types" could be "obsolete" which would tell the map version of setvars() to get rid of the variable. That way, we have a central file format for describing variables, getting some documentation on them, and allowing for an editor. If zlib could go through the file, then you just have a single setvars("name_of_map_file") at the bottom which would set up everything not already done.
 
Don't forget "script(s) which use this variable".

I imagine you want setvar to have a version that lets you set all these fields:
Code:
setvar("ascend_fightBosses", "boolean", "If true, don't break on bosses", "ascend.ash")
and if there were multiple scripts calling setvar, you'd concatenate the last "scripts which use this" field together to create a list of all of them.
 
Don't forget "script(s) which use this variable".

I imagine you want setvar to have a version that lets you set all these fields:
Code:
setvar("ascend_fightBosses", "boolean", "If true, don't break on bosses", "ascend.ash")
and if there were multiple scripts calling setvar, you'd concatenate the last "scripts which use this" field together to create a list of all of them.

Maybe, but I would think it would be easier to write that file by hand and not try to dynamically build up the vars. But, I also imagined it as a per-script file, so I would have one for each of my scripts. That way, if you gather up all the vars file in a directory, you have all the variables used by all the scripts.

Also, having zlib combine the variables together, you get more of a problem with the obsolete idea. Since one script may used it and one won't.
 
I started work on a zlib variable editor last night in C#. One thing that would be really helpful would be to have a list of all scripts that use zlib, and a brief run-through of the variables required for each, as well as some data about what kind of values are valid for each. I will be starting a thread for script writers to make a post about their script and it's variables.
 
Ooh, I definitely don't want to have to ship an extra file with each script, or have to record the vars in two places, etc. For the scripter's convenience I think you want to put it all in one place to ensure everyone uses it.
 
brenny, the simplest way to figure this out is to download each of Zarqon's and my scripts and run them each once. That'll give you a great starting data set. As I said earlier, if you require every scripter to separately do something to interface with the zlib parser, it's going to get a lot less use.
 
Ok, so I have created a new thread here. dj_d, I already have the information for a few scripts that I already use, such as harcore checklist, Wossname, and Daily Dungeon Diver. The thread is simply for scripts that I'm not using... such as your Ascend.ash, and other scripts that I have not seen or heard of. This is just a good way for me to let people opt in to the editor.
 
You all are forcing my hand. ZLib already has (commented-out) functionality which will interact with my server to provide this functionality, but better.

It will be an online repository of all script settings, including type (which is part of the variable declaration and will be sent to the server when initializing the value). It will be publicly editable to include calling script(s) info, as well as documentation on what it does and what possible values to set it to. Additionally, it will be privately editable to adjust all your script settings there, rather than by opening the possibly confusing text file, and then save that file to your data dir, overwriting your previous settings.

Sound good? I hope so. Calm down, everyone. All in good time.
 
So I was doing some testing today, and I noticed that there are a few variables that are created by multiple scripts if they don't exist... namely automcd, defaultoutfit, is_100_run, threshold, and unknown_ml. Are these created by Zlib, or are they all just common properties that each script attempts to set?
 
Multiple scripts use these properties, including ZLib. There is no single owning script. If you are trying to track down the creating script, you'll need a way of specifying multiple scripts. Otherwise, you could just arbitrarily choose one. In that case ZLib makes sense as a choice for these variables.
 
There is no single owning script.

Great! That puts me probably within a week of an initial release on the graphical variable editor. During the save process I give the user an editable preview of the file... so I will probably just put those settings in their own section in the file.
 
While I'm happy that you're producing this editor, I'm still rooting for zarqon to finish his version. I'd like to be able to change these variables without ever needing a user to download a separate piece of software. I'm very much looking forward to the WOSSMAN.

Go for it zarqon! WOSSMAN, Banzai!
 
Back
Top