User Tag List

Results 1 to 5 of 5

Thread: If you want to use scripts, but hesitate to edit them...

  1. #1
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,437
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.75%

    If you want to use scripts, but hesitate to edit them...

    I know making even minor changes to scripts can be intimidating to non-scripters, so I threw together a program to alleviate that problem. This will let you modify constants that control a script's behavior within limits set by its author. It doesn't require you to edit the file directly, so you don't have to worry about screwing anything up.
    This is a prototype of something I'd like to integrate into ZQuest eventually—even for those who are comfortable editing scripts, it would be more convenient. I doubt it'll make it into 2.5; if not, I'll continue developing this separately until at least the next version.
    Scripts have to be specifically made to work with the program, so you can't use it with any that are already out there. I've provided a demo script, but, as written, it doesn't work in ZC quite yet.
    Also, this only works with ZScript at the moment, but I do intend to add support for ZASM.
    Suggestions for interface improvements and better names would be welcome.

    ZScript Modifier
    Demo script (Vacuum.z)

    The source code's in Ruby. I used RubyScript2Exe to compile a Windows executable. The code should work on Mac and Linux as it is.

    zsm.rb



    Now, for those of you who actually write scripts, here's a file that illustrates the current format.

    zsmtest.z

    I'm open to suggestions on how it might be done differently. I like how this style blends in with regular comments, so you can easily insert extra notes for people editing the file manually without them looking out of place. However, the symbols are pretty arbitrary, and will only become more so with added functionality. Javadoc style might be preferable for its meaningful tags. Maybe something between the two, like ignoring lines that don't start with /// and determining their meaning from Javadoc-like tags.
    Of course, nothing like those will work with ZASM. That's going to need a whole different format.

    Obviously, there are a lot more features that could be added to this. Here's what I've thought of so far:
    - When a script is loaded, show a description of the script itself and what each argument does
    - Hexadecimal numbers
    - Allow int values to be selected from a list rather than simply setting a minimum and maximum
    - Let actual values be offset from given values (e.g. user enters 1-4, actual value is 0-3)
    - Determine one value from multiple inputs (e.g. if a number is 0-127 and 0 has a special meaning, ask about that separately)
    - Skip or change the meaning of some constants depending on values given earlier
    If anyone has more ideas, let me know.

  2. #2
    Octorok Plissken's Avatar
    Join Date
    Aug 2006
    Location
    VA
    Age
    32
    Posts
    431
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    vBActivity - Stats
    Points
    1,664
    Level
    13
    vBActivity - Bars
    Lv. Percent
    69.7%

    Re: If you want to use scripts, but hesitate to edit them...

    Thank you so much! I am about to take some classes that will help me with scripting but before that this is extremely useful.
    Creator of:

    INFO | VIDEOS | PICS | YOUTUBE

    ~Less is More~


  3. #3
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    33
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,280
    Level
    24
    vBActivity - Bars
    Lv. Percent
    44.61%

    Re: If you want to use scripts, but hesitate to edit them...

    Does this thing only work on constants? If so, that's very limiting. And I mean LIMITING. I've never once used a constant in my scripts that isn't in std.zh...

  4. #4
    Is this the end?
    ZC Developer
    Saffith's Avatar
    Join Date
    Jan 2001
    Age
    41
    Posts
    3,389
    Mentioned
    178 Post(s)
    Tagged
    6 Thread(s)
    vBActivity - Stats
    Points
    6,437
    Level
    24
    vBActivity - Bars
    Lv. Percent
    70.75%

    Re: If you want to use scripts, but hesitate to edit them...

    Quote Originally Posted by pikaguy900 View Post
    I've never once used a constant in my scripts that isn't in std.zh...
    Yes, but I've noticed you frequently use variables where constants would work as well.
    And, really, it's not so limiting. If you want to change the initial value of a variable, you can just make a new constant for that. That's generally a better design, anyway, as it's easier to change.

  5. #5
    Ultimate Prankster Lucario QDB Manager
    Just registered
    Nimono's Avatar
    Join Date
    Nov 2005
    Location
    Static Void Kingdom
    Age
    33
    Posts
    1,963
    Mentioned
    5 Post(s)
    Tagged
    2 Thread(s)
    vBActivity - Stats
    Points
    6,280
    Level
    24
    vBActivity - Bars
    Lv. Percent
    44.61%

    Re: If you want to use scripts, but hesitate to edit them...

    Quote Originally Posted by Saffith View Post
    Yes, but I've noticed you frequently use variables where constants would work as well.
    And, really, it's not so limiting. If you want to change the initial value of a variable, you can just make a new constant for that. That's generally a better design, anyway, as it's easier to change.
    Well, actually, when I made those scripts, I never truly knew about constants... XD I'll remember that in the future.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Armageddon Games is a game development group founded in 1997. We are extremely passionate about our work and our inspirations are mostly drawn from games of the 8-bit and 16-bit era.
Social