Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 18 19 [20] 21 22 ... 24

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

bloop_bleep

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (01/29/2019)
« Reply #285 on: March 06, 2019, 12:17:15 am »

PTW
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #286 on: March 15, 2019, 03:27:43 pm »

Updated the journal to include a search functionality and a help screen.

Spoiler: Search example (click to show/hide)

Updated github repo
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #287 on: April 04, 2019, 02:10:13 pm »

I continue to make progress on the Encyclopedia, although it has slowed down a bit recently, I've got sorting in by different parameters now (e.g. sort inorganic by their shear value, sort shields by their block value, etc...), pretty much any number associated with a particular raw can now be sorted by. I still need to implement complex sortings (e.g. sort by best material for edge weapon) that are based on more than one value, but that should be a fairly easy extension. I've also implemented a couple more options for hiding information, such as only viewing things that your civ knows about, as well as making any raw entry with a special character (!,$,#,*,=) in either the name or the token (e.g. [CREATURE:==THIS_CREATURE_SHOULD_BE_HIDDEN==]) be automatically hidden. This doesn't impact the vanilla raws, but several modders use such entries to make in game menus prettier. This allows those to remain, while not cluttering up the encyclopedia

Additionally I'm experimenting a little bit with generating random raws by modifying a random world D&D-like creator I wrote a while back. The random world creator makes creatures, plants, metals, spells, items, and all sorts of other stuff. The trick so far has been to write a "translation" script that takes the D&D-like information and puts it into raws. Below is a copy of two randomly generated plant. Basically the DESCRIPTION is what is generated by the random world creator, and the raws below that are what my script generates. The names still need a bit of work, as I basically used random words to generate names before.
Code: [Select]
{DESCRIPTION:a grand ovate magenta fungus, with light blue cap. it grows in the summer, autumn, and winter in desert badlands. it has short spreading dark magenta daises. the daises smell pungent. the daises can be used to mill a dark magenta dye}

[NAME:grand ovate magenta desert fungus]
[NAME_PLURAL:grand ovate magenta desert fungi]
[ADJ:grand ovate magenta desert fungus]
[PICKED_TILE:58][PICKED_COLOR:5:0:0][SHRUB_COLOR:5:0:0]
[VALUE:2]
[FREQUENCY:50]
[CLUSTERSIZE:5]
[SUMMER][FALL][WINTER]
[WET]
[BIOME:DESERT_BADLAND]
[PREFSTRING:light blue cap]
[PREFSTRING:short spreading dark magenta daises]
[PREFSTRING:white petals]
[PREFSTRING:silver stigma]
[PREFSTRING:dark magenta dye]

# Structure Details
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
        [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]

# Seed Details
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
        [MATERIAL_VALUE:1]
        [EDIBLE_VERMIN]
[SEED:grand ovate magenta desert fungus seed:0:0:0:LOCAL_PLANT_MAT:SEED]

# Growth Details
[USE_MATERIAL_TEMPLATE:FLOWER:FLOWER_TEMPLATE]
        [STATE_COLOR:ALL:#COLOR_STATE_GROWTH_FLOWER]
        [DISPLAY_COLOR:5:0:0]
        [EDIBLE_VERMIN]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
[GROWTH:FLOWER]
        [GROWTH_NAME:short spreading dark magenta daises]
        [GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:FLOWER]
        [GROWTH_TIMING:60000:119999]
        [GROWTH_PRINT:5:5:5:0:0:60000:119999:2]

# Product Details
[USE_MATERIAL_TEMPLATE:MILL:PLANT_POWDER_TEMPLATE]
        [STATE_NAME_ADJ:ALL_SOLID:dark magenta dye]
        [STATE_COLOR:#COLOR_STATE_PRODUCT_MILL]
        [DISPLAY_COLOR:5:0:0]
        [REACTION_CLASS:PLANT_MILL]
[MILL:LOCAL_PLANT_MAT:MILL]

Code: [Select]
{DESCRIPTION:a crawling scaly ivory algae. it grows in the spring and summer in sandy deserts. it has giant square saffron soft fruit, and short whorled gold leaves. the soft fruit smell musky and taste sweet and have round and tiny seeds. the leaves smell pleasant and have pungent edges. the soft fruit can be used to mill a saffron dye. the soft fruit can be used to brew a sweet spirit}
[NAME:crawling scaly ivory desert algae]
[NAME_PLURAL:crawling scaly ivory desert algae]
[ADJ:crawling scaly ivory desert algae]
[PICKED_TILE:58][PICKED_COLOR:7:0:1][SHRUB_COLOR:7:0:1]
[VALUE:2]
[FREQUENCY:50]
[CLUSTERSIZE:5]
[SPRING][SUMMER]
[WET]
[BIOME:DESERT_SAND]
[PREFSTRING:giant square saffron soft fruit]
[PREFSTRING:short whorled gold leaves]
[PREFSTRING:red veins]
[PREFSTRING:saffron dye]
[PREFSTRING:sweet spirit]

# Structure Details
[USE_MATERIAL_TEMPLATE:STRUCTURAL:STRUCTURAL_PLANT_TEMPLATE]
        [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
        [MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK]
[BASIC_MAT:LOCAL_PLANT_MAT:STRUCTURAL]

# Seed Details
[USE_MATERIAL_TEMPLATE:SEED:SEED_TEMPLATE]
        [MATERIAL_VALUE:1]
        [EDIBLE_VERMIN]
[SEED:crawling scaly ivory desert algae seed:0:0:0:LOCAL_PLANT_MAT:SEED]

# Growth Details
[USE_MATERIAL_TEMPLATE:SOFT_SHELL:FRUIT_TEMPLATE]
        [EDIBLE_VERMIN]
        [EDIBLE_RAW]
        [EDIBLE_COOKED]
        [STOCKPILE_PLANT_GROWTH]
        [MATERIAL_REACTION_PRODUCT:SEED_MAT:LOCAL_PLANT_MAT:SEED]
        [MATERIAL_REACTION_PRODUCT:POWDER_MAT:LOCAL_PLANT_MAT:MILL]
        [MATERIAL_REACTION_PRODUCT:DRINK_MAT:LOCAL_PLANT_MAT:DRINK]
[USE_MATERIAL_TEMPLATE:LEAF:LEAF_TEMPLATE]
        [STATE_COLOR:ALL:#COLOR_STATE_GROWTH_LEAF]
        [DISPLAY_COLOR:6:0:1]
        [EDIBLE_VERMIN]
[GROWTH:SOFT_SHELL]
        [GROWTH_NAME:giant square saffron soft fruit]
        [GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:SOFT_SHELL]
        [GROWTH_TIMING:120000:200000]
        [GROWTH_DROPS_OFF]
        [GROWTH_PRINT:'%':'%':6:0:1:120000:200000:3]
        [GROWTH_HAS_SEED]
[GROWTH:LEAF]
        [GROWTH_NAME:short whorled gold leaves]
        [GROWTH_ITEM:PLANT_GROWTH:NONE:LOCAL_PLANT_MAT:LEAF]
        [GROWTH_PRINT:0:6:6:0:1:ALL:1]

# Product Details
[USE_MATERIAL_TEMPLATE:MILL:PLANT_POWDER_TEMPLATE]
        [STATE_NAME_ADJ:ALL_SOLID:saffron dye]
        [STATE_COLOR:#COLOR_STATE_PRODUCT_MILL]
        [DISPLAY_COLOR:6:0:1]
        [REACTION_CLASS:PLANT_MILL]
[USE_MATERIAL_TEMPLATE:DRINK:PLANT_ALCOHOL_TEMPLATE]
        [STATE_NAME_ADJ:ALL_SOLID:frozen sweet spirit]
        [STATE_NAME_ADJ:LIQUID:sweet spirit]
        [STATE_NAME_ADJ:GAS:boiling sweet spirit]
        [DISPLAY_COLOR:6:0:1]
        [REACTION_CLASS:PLANT_BREW]
        [EDIBLE_VERMIN]
        [EDIBLE_RAW]
        [EDIBLE_COOKED]
[MILL:LOCAL_PLANT_MAT:MILL]
[DRINK:LOCAL_PLANT_MAT:DRINK]

My ultimate goal for this little side project is to be able to generate a completely random world with however many creatures, plants, etc... you want. Then, combined with the Encyclopedia you can "discover" a whole new world each time you play.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #288 on: April 07, 2019, 04:16:13 pm »

Code: [Select]
Created 9907 plants out of 10000 in 65.0 seconds
category 2
        MUNDANE     :   98.9%
        MAGICAL     :   1.1%
type 7
        SAVAGE      :   36.0%
        WILD        :   33.2%
        DOMESTIC    :   29.7%
        ARCANE      :   0.3%
        NATURE      :   0.3%
        ELEMENTAL   :   0.3%
        DIVINE      :   0.2%
subtype 6
        TREE        :   21.7%
        BUSH        :   20.5%
        GRASS       :   18.9%
        VINE        :   16.0%
        FUNGUS      :   12.5%
        MOSS        :   10.4%
growths 8
        LEAF        :   26.0%
        HERB        :   21.0%
        FLOWER      :   18.6%
        POD         :   18.2%
        SOFT_SHELL  :   16.9%
        GRAIN       :   16.2%
        HARD_SHELL  :   14.4%
        UNDERGROUND :   11.2%
products 5
        MILL        :   68.4%
        BREW        :   68.0%
        THRESH      :   16.5%
        EXTRACT     :   16.0%
        PULP        :   10.7%
biomes 51
        SHRUBLAND_TROPICAL              :       341     3.4%
        DESERT_ROCK                     :       335     3.4%
        MOUNTAIN                        :       327     3.3%
        SUBTERRANEAN_CHASM              :       326     3.3%
        MARSH_TEMPERATE_FRESHWATER      :       326     3.3%
        GLACIER                         :       322     3.3%
        SAVANNA_TEMPERATE               :       317     3.2%
        SWAMP_TEMPERATE_FRESHWATER      :       313     3.2%
        SWAMP_TROPICAL_FRESHWATER       :       312     3.1%
        FOREST_TAIGA                    :       309     3.1%
        DESERT_BADLAND                  :       309     3.1%
        FOREST_TEMPERATE_BROADLEAF      :       306     3.1%
        MARSH_TROPICAL_FRESHWATER       :       305     3.1%
        SUBTERRANEAN_LAVA               :       304     3.1%
        SWAMP_TEMPERATE_SALTWATER       :       303     3.1%
        MARSH_TEMPERATE_SALTWATER       :       302     3.0%
        FOREST_TROPICAL_DRY_BROADLEAF   :       300     3.0%
        SAVANNA_TROPICAL                :       298     3.0%
        FOREST_TEMPERATE_CONIFER        :       298     3.0%
        GRASSLAND_TROPICAL              :       293     3.0%
        TUNDRA                          :       291     2.9%
        DESERT_SAND                     :       290     2.9%
        MARSH_TROPICAL_SALTWATER        :       287     2.9%
        FOREST_TROPICAL_MOIST_BROADLEAF :       286     2.9%
        SWAMP_TROPICAL_SALTWATER        :       284     2.9%
        SHRUBLAND_TEMPERATE             :       284     2.9%
        GRASSLAND_TEMPERATE             :       280     2.8%
        SWAMP_MANGROVE                  :       275     2.8%
        SUBTERRANEAN_WATER              :       275     2.8%
        FOREST_TROPICAL_CONIFER         :       251     2.5%
        POOL_TEMPERATE_BRACKISHWATER    :       52      0.5%
        POOL_TROPICAL_FRESHWATER        :       48      0.5%
        LAKE_TEMPERATE_BRACKISHWATER    :       48      0.5%
        RIVER_TEMPERATE_BRACKISHWATER   :       47      0.5%
        OCEAN_TEMPERATE                 :       46      0.5%
        RIVER_TROPICAL_BRACKISHWATER    :       45      0.5%
        OCEAN_TROPICAL                  :       44      0.4%
        RIVER_TROPICAL_FRESHWATER       :       43      0.4%
        RIVER_TEMPERATE_SALTWATER       :       42      0.4%
        LAKE_TEMPERATE_SALTWATER        :       42      0.4%
        RIVER_TEMPERATE_FRESHWATER      :       41      0.4%
        OCEAN_ARCTIC                    :       41      0.4%
        LAKE_TROPICAL_SALTWATER         :       40      0.4%
        LAKE_TROPICAL_FRESHWATER        :       40      0.4%
        LAKE_TROPICAL_BRACKISHWATER     :       40      0.4%
        POOL_TEMPERATE_SALTWATER        :       38      0.4%
        POOL_TEMPERATE_FRESHWATER       :       35      0.4%
        RIVER_TROPICAL_SALTWATER        :       31      0.3%
        POOL_TROPICAL_SALTWATER         :       31      0.3%
        POOL_TROPICAL_BRACKISHWATER     :       31      0.3%
        LAKE_TEMPERATE_FRESHWATER       :       31      0.3%
« Last Edit: April 07, 2019, 04:35:41 pm by Roses »
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #289 on: August 20, 2019, 04:52:24 pm »

I have been working on and off on a new set of scripts that reads in a set of templates and generates an entirely random world, everything from the plants and creatures to the metals and soils. Essentially a randomized total conversion. The templates are written in json format and read in with a python script that puts them together to create objects for DF. The original purpose of these scripts was to create random D&D worlds to play through, and I've been working on getting it working with DF raws. Why? Because I thought it would be fun to start a single human adventurer in a totally unknown world, where creatures, materials, items, everything has unfamiliar names and properties and, using my Encyclopedia utility, catalogue everything and try to survive. Below is an example template for a creatures arm, just to give an idea of what the templates look like.

Code: [Select]
"6PART_ARM":    {"__comment": "shoulder, upper arm, elbow, lower arm, wrist, hand (2,4,6)",
"TYPE":     "ARM_BASIC",
"WEIGHT":   100,
"MATERIAL": ["SURFACE","INSULATION","MEAT","STRUCTURE"],
"DIGITS":   {"MIN": 1, "REQUIRED": ["FINGERS"]},
"ATTACK":   ["PUNCH"],
"REPEAT": {
"2": [1.0,
["L","left","[LEFT]"],["R","right","[RIGHT]"]],
"4": [0.5,
["UL","upper left","[LEFT]"],["UR","upper right","[RIGHT]"],
["LL","lower left","[LEFT]"],["LR","lower right","[RIGHT]"]],
"6": [0.1,
["TL","top left","[LEFT]"],   ["TR","top right","[RIGHT]"],
["ML","mid left","[LEFT]"],   ["MR","mid right","[RIGHT]"],
["BL","bottom left","[LEFT]"],["BR","bottom right","[RIGHT]"]]
},
"EXTERNAL": {
"BODY": [
"[BP:^1UA_J:^2 shoulder:STP] [CATEGORY:ARM_JOINT]^3 [JOINT][SMALL][INTERNAL][DEFAULT_RELSIZE:100][CONTYPE:UPPERBODY]",
"[BP:^1UA:^2 upper arm:STP]  [CATEGORY:ARM_UPPER]^3 [LIMB]                  [DEFAULT_RELSIZE:200][CON:^1UA_J]",
"[BP:^1LA_J:^2 elbow:STP]    [CATEGORY:ARM_JOINT]^3 [JOINT][SMALL][INTERNAL][DEFAULT_RELSIZE:20] [CON:^1UA]",
"[BP:^1LA:^2 lower arm:STP]  [CATEGORY:ARM_LOWER]^3 [LIMB]                  [DEFAULT_RELSIZE:200][CON:^1LA_J]",
"[BP:^1H_J:^2 wrist:STP]     [CATEGORY:ARM_JOINT]^3 [JOINT][SMALL][INTERNAL][DEFAULT_RELSIZE:20] [CON:^1LA]",
"[BP:^1HAND:^2 hand:STP]     [CATEGORY:HAND]     ^3 [GRASP]                 [DEFAULT_RELSIZE:80] [CON:^1H_J]"],
"BODY_DETAIL_PLAN": [
"[BP_LAYERS:BY_CATEGORY:ARM_JOINT:STRUCTURE:4:MEAT:1]",
"[BP_LAYERS:BY_CATEGORY:ARM_UPPER:STRUCTURE:25:MEAT:25:INSULATION:5:SURFACE:1]",
"[BP_LAYERS:BY_CATEGORY:ARM_LOWER:STRUCTURE:25:MEAT:25:INSULATION:5:SURFACE:1]",
"[BP_LAYERS:BY_CATEGORY:HAND:STRUCTURE:25:MEAT:25:INSULATION:5:SURFACE:1]"]
},
"RAWS": {
"BODY": ["{#KEY}"],
"BDP":  ["[BODY_DETAIL_PLAN:#KEY]"]
}
}

I'm finally at a point where everything is working as intended and generating nearly everything (some work still needs to be done on entities and their buildings), but now I need to come up with a large amount of template entries in order to get some proper good randomization.

If anyone is interested in helping out, what I would like are any custom creatures (either entire ones or just their bodies), plants, items, inorganics, materials, entities, syndromes (e.g. poisons), etc... that you are particularly proud of. I won't bother asking you to put it in a template format, just the relevant raws so that I can parse them into templates that can be randomized.

For those of you interested in the python scripts and the currently created templates you can find them in the Utilities section of my github collection, and if you are very interested and would like to learn exactly what each of the entries in a template does and make your own templates just let me know and I can put together a little ReadMe
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #290 on: August 30, 2019, 03:03:21 pm »

The Random World Creator (RWC) continues to make progress. With the current set of templates there are about ~1 million combinations of plants that can be created and ~20 million creatures. Of course the more combinations the longer it takes to generate the random raws, which is why creatures take longer than plants which take longer than syndromes (also the shear complexity of creature contributes to the time needed to create). Below is a run with 1000 of each of the currently enabled templates. (More than 1000 inorganics are created, because some of the templates require a companion inorganic, like ores that require metals)

Code: [Select]
RANDOM WORLD CREATOR STARTING

Reading templates/raws.json
Created 1000 syndromes     out of 1000 in 5.3 seconds
Created 1000 environments  out of 1000 in 4.1 seconds
Created 1000 materials     out of 1000 in 2.6 seconds
Created 1159 inorganics    out of 1000 in 6.1 seconds
Created 1000 plants        out of 1000 in 10.5 seconds
No weapons created
Created 1000 creatures     out of 1000 in 48.8 seconds
No buildings created
No reactions created
No entities created
Writing EXTERNAL raws
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #291 on: January 16, 2020, 12:00:39 pm »

In anticipation of the new upcoming release I have put the RWC on hold and have begun a massive rewrite on my set of scripts. I will post more updates when the new release (and cooresponding DFHack) comes out, but for now if you want to look at the newest work being done, you can check out the devel branch of my github
Logged

FantasticDorf

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #292 on: February 13, 2020, 12:59:16 pm »

Hiya, i've mainly come to ask a question regarding the wrapping script, i wouldn't particularly call it a suggestion for a plugin or command but rather just a check-up on the archaic form of yoinking to summon creatures to your desired location which has been used on numerous DFhack things in the past.

Since the new interactions for 47.xx creates brand new entities that don't rely on a nessecity to exist but only to be defined (a body required with [DOES_NOT_EXIST]) and few other perfunctory arguement rules like length of persistency of the summon & whether the unit has historical relevance, do you think wrapper would be a appropriate rubyscript tool for these kind of desired DFhack triggers?

Your 'Stone Mine' proof of concept design was very interesting. If i might add in accordance with [SKILL_ROLL_RANGE] which would allow units to use workshops such as pseudo gyms for a longer amount of time until the job is completed or suspended with extra-experience or attribute outcome. The future of the scripts shown here will be definitely PTW.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (03/15/2019)
« Reply #293 on: February 14, 2020, 10:53:38 am »

Hiya, i've mainly come to ask a question regarding the wrapping script, i wouldn't particularly call it a suggestion for a plugin or command but rather just a check-up on the archaic form of yoinking to summon creatures to your desired location which has been used on numerous DFhack things in the past.

Since the new interactions for 47.xx creates brand new entities that don't rely on a nessecity to exist but only to be defined (a body required with [DOES_NOT_EXIST]) and few other perfunctory arguement rules like length of persistency of the summon & whether the unit has historical relevance, do you think wrapper would be a appropriate rubyscript tool for these kind of desired DFhack triggers?

Your 'Stone Mine' proof of concept design was very interesting. If i might add in accordance with [SKILL_ROLL_RANGE] which would allow units to use workshops such as pseudo gyms for a longer amount of time until the job is completed or suspended with extra-experience or attribute outcome. The future of the scripts shown here will be definitely PTW.

Thanks for the comments, the new stuff included with 47 definitely have me thinking about all the things I can do. I've actually started keeping a list of new features and ideas for how they can be used. The main thing to work out is how dfhack can interface with these new things. Once a relatively stable dfhack version is released I will start poking around in there and seeing what I can figure out.

I'm also updating all my scripts so that they are a little simpler. And have a more consistent layout and help information. Almost all the scripts are done, but I'm starting the systems from scratch. I've axed the class and civilization systems for now because I think they will be heavily influenced by the new stuff, but the enhanced system, which basically adds new tokens for the raws (like buildings that can only be built outside or changing the amount of time it takes to complete reactions) will be in my first release for the 47 version. I've also set it up so that it is relatively simple to add new tokens to the enhanced system, you will only need to modify a single file instead of before which needed 4 separate files to be updated!
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (04/06/2020)
« Reply #294 on: April 06, 2020, 02:50:39 pm »

First major update in some time. I have made sure that all my scripts are working on DF/Hack version 47.04. The currently available scripts and systems is a much smaller subset of my previous scripts/systems, but I am working on getting everything converted to the new setup that I am using. The first four posts contain information (or will soon contain information) on what is currently included in the package
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (04/06/2020)
« Reply #295 on: April 08, 2020, 12:03:08 pm »

Alright, so I have pushed all the updates to the devel branch of my github, and updated the first three posts for what is currently included in the repo. Now I am looking for testers, especially the Enhanced Building and Enhanced Item systems (the scripts all have built in testing, the systems have minimal testing as they are more complicated). If anyone wants to try them out feel free and let me know how they work out/if you have any questions. There are very simple examples in scripts/tests/raw_files that you can use as a basic guide.
Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (04/06/2020)
« Reply #296 on: April 14, 2020, 01:23:39 pm »

Added a new token to the Enhanced Item system, you can no specify the fire rate of ranged weapons. It works by putting
Code: [Select]
{FIRE_RATE:base rate:skill increase:max rate}in the ranged items raws (currently can only be specified in the actual ranged item, not the ammo), where

base rate = number of ticks until the next shot with no weapon skill (in vanilla DF this is ~80)
skill increase = number of ticks the base rate is decreased per weapon skill (in vanilla DF this is ~2)
max rate = fastest the weapon can fire regardless of skill (in vanilla DF this is ~40)

so if you wanted a weapon that fires once every tick regardless of skill
Code: [Select]
{FIRE_RATE:1:0:1}or a weapon that is really slow to fire unless you have skill with it
Code: [Select]
{FIRE_RATE:500:50:1}
Note that this only changes the time between shots, the unit will still act between shots just like they do now. Also worth noting, firing every tick will drain ammo like mad. Since most times the game is playing at >20 frames (frame = tick) per second, it will empty a quiver quite quickly. I am planning on creating the option for one ammo item to be used multiple times (think, instead of carrying 20 "bullets" you carry 20 "clips" in your quiver) so that the ammo will last a little longer. Also I am working on implementing burst fire
« Last Edit: April 14, 2020, 01:26:07 pm by Roses »
Logged

Warmist

  • Bay Watcher
  • Master of unfinished jobs
    • View Profile
Re: Roses' Script, System, and Utilities Collection (04/06/2020)
« Reply #297 on: April 15, 2020, 08:19:17 am »

<...>
Note that this only changes the time between shots, the unit will still act between shots just like they do now. Also worth noting, firing every tick will drain ammo like mad. Since most times the game is playing at >20 frames (frame = tick) per second, it will empty a quiver quite quickly. <...>

Gif material right there :D

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (04/06/2020)
« Reply #298 on: April 17, 2020, 12:04:33 pm »

It's no gif, but it is a picture of a unit firing a crossbow at 1 bolt per tick

Logged

Roses

  • Bay Watcher
    • View Profile
Re: Roses' Script, System, and Utilities Collection (04/06/2020)
« Reply #299 on: April 21, 2020, 12:48:03 pm »

I've added two new fire modes to projectile weapons, a spread shot mode and a burst fire mode.

The spread shot mode functions like a shotgun and changes the projectile fired to multiple projectiles.
Code: [Select]
{SPREAD_SHOT:# of projectiles:spread distance:per target distance}So if you were to put
Code: [Select]
{SPREAD_SHOT:5:1:4}onto a crossbow, every time you fired a crossbow bolt, it would create 5 bolts (but only costing a single bolt) with a target offset of 1 tile for every 4 tiles away the target is from the shooter. If you set the spread distance to 0 all created projectiles will have the exact same target position.

The burst fire mode functions pretty much how you would imagine
Code: [Select]
{BURST_FIRE:# of shots}So if you were to put
Code: [Select]
{BURST_FIRE:4}onto a crossbow, the unit would fire four projectiles in four ticks, and then wait the normal fire rate delay to fire again. If you also use the FIRE_RATE command the normal delay will be replaced with the FIRE_RATE delay.

I've also begun adding short cuts to some of the other triggers, so instead of needing to provide scripts you can just use built in commands. For instance, instead of
Code: [Select]
{ON_EQUIP}
    {SCRIPT:unit/change-attribute -unit HOLDER -attribute [ STRENGTH +200 ]:50}
you use
Code: [Select]
{ON_EQUIP}
    {ATTRIBUTE_CHANGE:STRENGTH:200:50}
Again, these are identical, but the later is easier to read and understand in my opinion
Logged
Pages: 1 ... 18 19 [20] 21 22 ... 24