Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 [3] 4 5 ... 24

Author Topic: Roses' Script, System, and Utilities Collection (07/06/2021)  (Read 87068 times)

expwnent

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #30 on: September 30, 2015, 01:24:48 pm »

That's how it's supposed to work but I think I noticed a few scripts that were in both places so I was confused.

I'm not sure there's a simple way to extend the script finding system to do that. You might be able to do it manually by checking for the existence / modify date of hack/scripts/whatever and calling it if it's newer than data/save/adsf/raw/scripts/whatever.
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #31 on: September 30, 2015, 02:04:21 pm »

That's how it's supposed to work but I think I noticed a few scripts that were in both places so I was confused.

I'm not sure there's a simple way to extend the script finding system to do that. You might be able to do it manually by checking for the existence / modify date of hack/scripts/whatever and calling it if it's newer than data/save/adsf/raw/scripts/whatever.
Seriously: Stop abusing script systems!
What next? Hash each script and then distribute approved hashes??

Why such simple and elegant system needs to be "improved" until there is no logic on what gets to run?
Why do we need 20 places that run scripts?
</rant>
My opinion is that the problem is elsewhere: we need a way to update raw folders and/or scripts with more automation. E.g. i was using this to have light redirect in raws that gets called on load and the rest in the "mods" folder. That way mods can be updated and the saves will be automatically up-to-date. This however is not perfect: it lacks the raws updating functionality (e.g. automatically adding missing creatures and etc...)

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #32 on: October 01, 2015, 03:08:50 pm »

Alright, so I figured I would explain my new script organization format before I upload them, just so people can know what to expect, and offer criticism/advice.

The basic idea behind the structure is that scripts that effect specific things should be in specific folders. In addition the different "systems", as I call them, each get their own folder. And finally there is a special folder (called functions) where I store different functions that are shared between multiple scripts, so that a simple script_environment call can be used instead of a copy/pasting them into multiple locations. This new use of "functions" means that almost all of my scripts are much shorter than they were previously, and, additionally, allows for easier creation of more scripts in the future. The current complete list of scripts and organization is;

  • scripts
    • base
      • on-death.lua
      • on-time.lua
      • roses-init.lua
    • building
      • subtype-change.lua
    • civilizations
      • level-up.lua
      • noble-change.lua
      • resource-change.lua
    • classes
      • add-experience.lua
      • change-class.lua
      • learn-skill.lua
      • level-up.lua
    • events
      • trigger.lua
    • flow
      • liquid.lua
      • random-surface.lua
      • random-unit.lua
    • functions
      • building.lua
      • civilization.lua
      • class.lua
      • entity.lua
      • event.lua
      • item.lua
      • map.lua
      • misc.lua
      • tables.lua
      • unit.lua
      • wrapper.lua
    • item
      • create.lua (differs from the base create script in only that it has a duration argument which deletes the item after a certain number of ticks)
      • material-change.lua
      • projectile.lua
      • quality-change.lua
      • subtype-change.lua
    • tile
      • material-change.lua
      • temperature-change.lua
    • unit
      • attribute-change.lua
      • body-change.lua
      • counter-change.lua
      • propel.lua
      • skill-change.lua
      • trait-change.lua
    • wrapper.lua

I am, of course, open to criticism/discussion. At this point I am fine with changing things around if those in the know think it would be better, but after I put out this release I am really hoping to stick to a single convention for all future work.

I do have to decide where best to include "system" files. That is to say, if you want to use the class/civilization/event system you need a corresponding file classes.txt/civilizations.txt/events.txt. I suppose I could have the scripts check in multiple locations for each, but where should they check?
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #33 on: October 01, 2015, 03:21:16 pm »

That all looks good.

I would have it look in the raw/ folder of the current save to help promote savegame mobility.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #34 on: October 01, 2015, 03:29:49 pm »

Currently it actually looks in the raw/objects folder since I created the templates for the systems based on the raws themselves. I think I will continue checking there, but encourage people to place them separately so they can easily be accessed without searching through all the objects files.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #35 on: October 01, 2015, 03:33:12 pm »

That makes sense.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #36 on: October 06, 2015, 10:44:34 pm »

So a release has been delayed by my discovery that flows (mist, web, dragonfire, fire, trailing dust, etc...) can be confined to a single square http://www.bay12forums.com/smf/index.php?topic=139553.msg6531964#msg6531964. There are a couple scripts that I have been rewriting to take advantage of this, and most significantly it has prompted me to rehaul the wrapper script, which will hopefully provide a more robust and complete system that is easy to use. I have almost finished all the adjustments and am now in testing mode.

Right now I am simply making sure that nothing is giving errors when run, then I will release a test run that lets others check (along with me) that the effects are actually happening.
Logged

expwnent

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #37 on: October 14, 2015, 11:23:53 pm »

Any update?
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #38 on: October 17, 2015, 07:10:31 pm »

Yes, sorry. I came down with the flu and am now desperately playing catch up with work. But I think that I should be pushing my release this week.

EDIT: So I just sort of made a breakthrough (nothing mind boggling, but substantial for my understanding of lua) in terms of string parsing. This allows for very complex equations which can be referenced in my wrapper script. When I finish coding this up you will be able to create an equation using any number of variables you want for both a target and source in an interaction to generate numbers. It seems a little complex in writing, but I will make sure to include a detailed walkthrough of how it works.
« Last Edit: October 20, 2015, 11:03:48 pm by Roses »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #39 on: October 22, 2015, 05:59:16 pm »

Ok, so I am nearing release and am now just working on some readme and help files. What information do people feel would be relevant and good to know in easy to look up files?
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.0
« Reply #40 on: October 27, 2015, 06:39:24 am »

Whatever you feel is the most complex stuff to understand without a readme :). I am sure we will be able to ask other questions in this thread. I can't wait to see the new release!
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.1 (10/27/2015)
« Reply #41 on: October 27, 2015, 09:02:35 pm »

Well, I have finally uploaded all of my changes. The original post has the link to the GitHub. Also included is a ReadMe that should answer most questions.

Now I did do a fair amount of testing, but I am guessing that there are still bugs buried here and there. So please let me know if there is anything you run across that errors out or just doesn't work.

For now I am working on finishing up my extensive examples for the three systems. I am almost done with them, but like usual I keep wanting to add to them.
Logged

Max™

  • Bay Watcher
  • [CULL:SQUARE]
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.1 (10/27/2015)
« Reply #42 on: October 27, 2015, 10:23:47 pm »

That flow stuff looks fascinating, were I not in the middle of a bunch of GIMP-work I'd have to poke around with it more.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.1 (10/27/2015)
« Reply #43 on: October 28, 2015, 03:08:40 pm »

Updated the first post so it is easier to see what scripts are included with the package. Will update to include information about the various systems once I finish my examples.
Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Roses' Script, System, and Utilities Collection v0.1 (10/27/2015)
« Reply #44 on: October 31, 2015, 09:59:33 am »

Script for item spawning with a duration is just what I needed for my conjuration workshop! I will be sure to use some of your scripts and give you a proper credit, thanks a lot for doing that!
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository
Pages: 1 2 [3] 4 5 ... 24