Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 11 12 [13] 14 15 ... 24

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

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #180 on: February 09, 2017, 07:49:10 pm »

I would rather just manually write an extra script for that; there comes to be a point where that's easier.

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #181 on: February 10, 2017, 12:12:59 pm »

True, but then if you want to add new functions you will need to go into the script and modify them, some people might not be comfortable editing lua files. But yes, instead of having the whole equation written out I could just link it to a script.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #182 on: February 15, 2017, 03:35:49 pm »

So since every time I make a change to one of my scripts/functions/systems I usually end up breaking another, and have often put out buggy code I have decided to invest the time in writing a test script. What this script does is check that all systems, scripts and functions are performing correctly. That all required raw entries are found and that everything is in order. When run it will generate a LOT of text and information. It will alter units, entities, and the map so it should only be used in fort mode and only on a save you don't care about. After it is run it will generate a simple list of anything that was found to be not working.

And because I can't do anything simple without adding way more than is needed, I have generalized the test system to work for anyones scripts, they simply need to follow the standard format (i.e. the processArgs format) and one of the arguments needs to be -testRun with the corresponding test code written there. The testing script will then run all scripts it can find with the -testRun command. Note that many scripts need units, locations, buildings, and items. The testing script picks these things randomly and inserts them into the -testRun script. This won't work for all scripts, but it should give some good benchmarks.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #183 on: February 24, 2017, 04:56:40 pm »

So I am playing a bit with my random creature creator (RCC) and trying to create better templates. Here are some of the creatures. They are pretty messed up, granted this is with all of the options turned on. You will get much more reasonable creatures by only choosing from certain templates (e.g. don't mix and match tentacles and arms/legs, etc...)

This one shows off the body part color naming scheme along with the single body part name (blob) and hairless name (bald). The description isn't too crazy.
Code: [Select]
[NAME:pink skinned bald blob:pink skinned bald blobs:pink skinned bald blob]
[DESCRIPTION:A common animal found in the wilderness., It lives in deep underground places. A hairless leathery creature with a single part body,
a large head and no eyes, a simple nose, a beak, and large ears. It has two tentacles attached to it's upper body with claws and six tentacles attached to it's lower body with clubs.
It Is only found underground. It cleans itself when dirty. Maximum Size: 19kg ]

This one shows off the eye color naming along with feathered naming (both fluffed and fowl come from the feather template). I should restrict words to a single template. The number of fingers in the description might be a little much.
Code: [Select]
[NAME:fluffed purple eyed fowl:fluffed purple eyed fowls:fluffed purple eyed fowl]
[DESCRIPTION:A common animal found in the wilderness. A feathered creature with a single part body, a head a single horn and four eyes, no nose, a beak, and pointed ears.
It has two arms and hands with four fingers each and two legs with hooves. It Is found in hardy places. It often greets other animals by head bumping them. It cleans itself when dirty. Maximum Size: 22kg ]

Here is one with a basic name and a description that doesn't match it at all. The fen comes from the temperate wetland, and the centipede comes from the 100 legs (again number of claws seems overkill). The name should probably mention that it is tusked or it has pincers or some such
Code: [Select]
[NAME:fen centipede:fen centipedes:fen centipede]
[DESCRIPTION:A common animal found in the wilderness. A hairy creature with a two part body, two heads two tusks and two eyes, a snout, a beak, and no ears.
It has four arms with large pincers and one hundred legs and feet with four claws each. It Can be found in any temperate wetland. Maximum Size: 20kg ]

For reference, limiting which templates are chosen from you can get creatures like, which actually doesn't sound too bad.
Code: [Select]
[NAME:tropical claw-fowl:tropical claw-fowls:tropical claw-fowl]
[DESCRIPTION:A common animal found in the wilderness. A feathered creature with a two part body, a head four horns and no eyes, no nose, a beak, and no ears. It has two wings and two legs and feet with four claws each. It Can be found in any dense tropical location. Maximum Size: 4kg ]

What I really need to do now is create more templates and think up more names. Should I branch out from english? Start using prefixes like geo/terra/aqua/aero? I am using names like crustacean, insect, amphibian, reptile, etc... Should I change those to specific creature names? There are a couple templates I do that for (e.g. the single horn template can have the name unicorn, the single eye template can have the name cyclops, etc...) I could also just make names random, or select words from the language files.

EDIT: Alright, I added the ability to link templates, so now you can have a single torso template that's linked to specific other templates to create more complex random creatures. For example, say you wanted to create a host of random scorpions (with six legs, two arms with pinchers, and a stinger and the rest random) you would just need to create the scorpion torso template and link it with the appropriate legs, arms, and attachments. Then the creator will select random biomes, material templates, facial features, extra attachments (wings, spikes, etc...), and other additions to make each scorpion unique.

EDIT2: Another update, I have added the ability to weight templates. before you had to make multiple copies of a template if you wanted it to be more selected than another, now you just change it's weighting.
« Last Edit: March 01, 2017, 02:10:53 pm by Roses »
Logged

Kaytavo

  • Bay Watcher
  • The Pie Master
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #184 on: March 04, 2017, 09:11:13 pm »

Hello I was looking at your scripts, and decided to try it. Since using these scripts/systems is mostly DIY, I was wondering two things:

1. Is there a program to easily make the raws/txt files or should I just use Notepad++?

2. Would it be ok once I finish getting every thing set up to release my .txt's for class/civs/ect. so that others can you them?

Thank you in advance.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #185 on: March 04, 2017, 09:42:35 pm »

1. notepad++

2. i've already done that with fortbent, it shouldn't be a problem

Kaytavo

  • Bay Watcher
  • The Pie Master
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #186 on: March 04, 2017, 10:06:41 pm »

1. notepad++

2. i've already done that with fortbent, it shouldn't be a problem

Fortbent has this set up? hmm i must of grabbed an old version then, as DFHack did not list any class related commands in that console

EDIT: it seems the rose-init line is commented out
EDIT2: ok i got the command to work... sort of... it always says "no unit declared" i'm in adv mode btw
EDIT3: ok i have gotten it to work mostly needed -unit # and -class name, but it isn't doing much unfortunitly
« Last Edit: March 04, 2017, 11:59:25 pm by Kaytavo »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #187 on: March 06, 2017, 11:50:41 am »

Sorry, I don't have internet at home currently so I don't get to get on here much on the weekend.

1. Yeah, I use notepad++
2. And like Putnam said, I actually encourage you to share your work. Like you said it's mostly DIY with me just providing the framework so please do share any work you do with it.

Now on to your problems, if you are using Fortbent I can't be of much help since Putnam has his own way of interfacing with my scripts (which is totally fine too and once again encouraged!). If you aren't using Fortbent can you elaborate on what you mean by, "it isn't doing much"?
Logged

Kaytavo

  • Bay Watcher
  • The Pie Master
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #188 on: March 08, 2017, 05:52:33 pm »

well i'll have to figure out how to install it into a clean copy first. I tried putting it in the raws folder but i have the impression that is wrong, should probably put in in the dfhack folder ok appearently there is another raw folder in hack, oops.
« Last Edit: March 08, 2017, 05:58:42 pm by Kaytavo »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #189 on: March 08, 2017, 07:04:46 pm »

No, it should go in the DF_DIR/raw/ folder not the DF_DIR/hack/raws (or whatever the dfhack one is)
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #190 on: March 20, 2017, 12:08:45 pm »

First I would like to apologize for the lack of updates. No reliable internet for two months is rough, but this week/weekend should be a good one.

So I am getting ready for a major release this week and wanted to give a little heads up on two things that have changed.

1. Previously in all of my systems I made a distinction between physical and mental attributes. For example the Class System would use BONUS:PHYS_ATTRIBUTE and BONUS:MENT_ATTRIBUTE, both of these still work (for backwards compatibility) but they just link to BONUS:ATTRIBUTE, so going forward you can just use BONUS:ATTRIBUTE (and for any of the other systems just get rid of any reference to physical or mental). Note that all changes are backwards compatible, and if you prefer to make the distinction in your files you are free to do so. But it is no longer required.

2. Many of the names of functions in my various functions/x.lua scripts have been "changed". The reason for the parenthesis is that I have linked the old function names with the new one, again for backwards compatibility. The reason for the change is I made the function name more consistent with what the function returns.
  a. All functions that start with check (e.g. checkInventoryType) will return true/false.
  b. All functions that start with get (e.g. getInverntoryType) will return a list of whatever it was trying to get or an empty list if nothing is found.
  c. All functions that start with change (e.g. changeAttribute) will change something in game, if the change is successful it will return true, it will return false if unsuccessful
  d. All functions that start with add/remove (e.g. addAttack) will add/remove to/from an existing table (in the case of addAttack it will add to the unit.actions table). These don't have any return
  e. All functions that start with compute (e.g. computeAttackValues) use functions and whatever inputs are needed to calculate a number(s)
  f. All functions that start with find (e.g. findBuilding) use a specially defined string (more info will be available in the ReadMe) to locate the id/ids of the desired object
  g. All functions that start with queue (e.g. queueCheck) create a persistent delay object which triggers at a latter time (even after a save/reload)
  h. All functions that start with track (e.g. trackAttribute) are used in conjunction with a change function and are for the purpose of advanced interactions
There are a number of other functions named specifically for what they do, but this change helps me better remember what each function does/returns

Right now I am in the process of testing all of the changes and additions I have made over the past month without reliable internet. The big holdup right now is making sure the Detailed Unit Viewer works on all units, and in all modes. The problem is that currently it used view_screen shenanigans to get the various thoughts, preferences, emotions, etc... that you would get in the normal unit viewscreen. But these screens are different for different modes, and again different for various units (tame vs. not-tame animals, civ fort members vs civ non-fort members, etc...). I am thinking it almost might be easier to read all of the details from the unit directly and recreate the text. That would ensure it works in any mode on any unit. Something that is interesting about using the view-screen method is that tame animals will have the same set of entity preferences that their civ does, even if those would normally not be shown in the normal unit viewer.
Logged

Amostubal

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #191 on: March 22, 2017, 09:28:52 am »

ptw
Logged
Legendary Dwarf Fortress
Legendary Discord Group
"...peering into the darkness behind the curtains, evokes visions of pixies being chased by dragons while eating cupcakes made of coral iced with liquid fire while their hearts burn out with unknown plant substances..." - a quote from the diaries of Amostubal

Amostubal

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #192 on: March 22, 2017, 01:31:48 pm »

well I had started following to await any future release information, but I had found an error in one of your scripts when used in dfhack 43.05 beta 1.  so I'll post it for you or anyone else who may be in need of it.

In on-death.lua v1.0 line 43, old line:
Code: [Select]
killer_id = tonumber(target.relations.last_attacker_id)
replace with new line:
Code: [Select]
killer_id = tonumber(target.relationship_ids.LastAttacker)

just a change needed when moving from 43.03 to 43.05.  That line was spamming errors at me over here. I love reading through your scripts, I feel like I've learned something as I move page to page.
Logged
Legendary Dwarf Fortress
Legendary Discord Group
"...peering into the darkness behind the curtains, evokes visions of pixies being chased by dragons while eating cupcakes made of coral iced with liquid fire while their hearts burn out with unknown plant substances..." - a quote from the diaries of Amostubal

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #193 on: March 22, 2017, 03:54:37 pm »

That's a universal problem, I'm going to have to update all of my scripts to account for the complete removal of the relations struct and moving of everything in it to other places.

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (08/27/2016)
« Reply #194 on: March 22, 2017, 07:02:29 pm »

Yeah, I just saw in the DFHack thread that the relations entry was removed and things were moved to other places. Since I am still working in the last version of DFHack I hadn't noticed. I will make sure to make note of each of the places that need to be adjusted. Ideally we could get a bash script or something that goes through all the scripts and makes the adjustments, but I've got enough other stuff to work on that that would be a very low priority

https://i.img.ie/0cO.png
https://i.img.ie/0cH.png
https://i.img.ie/0cd.png
https://i.img.ie/0cG.png
https://i.img.ie/0cW.png
« Last Edit: March 28, 2017, 11:03:49 am by Roses »
Logged
Pages: 1 ... 11 12 [13] 14 15 ... 24