Bay 12 Games Forum

Dwarf Fortress => DF Modding => Utilities and 3rd Party Applications => Topic started by: milo christiansen on July 02, 2013, 11:12:28 am

Title: Rubble v3.13 (for 34.11) - Minor bug fixes!
Post by: milo christiansen on July 02, 2013, 11:12:28 am
Rubble: After Blast comes Rubble

==============================================
Overview:
==============================================

Rubble is a raw generator, eg. it takes "preraws" and generates Dwarf Fortress raw files from them.

By using "templates" (either predefined or defined yourself) you can greatly simplify the task of writing a Dwarf Fortress mod.
For example, there are templates that automate registering workshops and reactions, which will not only save you time but also reduce the chance of bugs as well.

For non-modders Rubble makes it easy to install mini-mods so you can create your perfect custom Dwarf Fortress.

Required Reading for Modders (in most-important-first order):
   This readme
   HowTo Rubble - Tutorials
   Rubble Addons - Lots of stuff about addons in general
   Rubble Base Templates - The template documentation for the "Base/Templates" addon
   Rubble Native Templates - The template documentation for the built-in templates
   Rubble Libs Templates - The template documentation for the library templates
   The included addons - A little short on comments but still a great resource
   Raptor Basics - Raptor overview
   Everything in "raptor command docs" - the Raptor command documentation, NEEDED if you plan to do anything with Raptor

If you do not plan on doing any modding the only thing you need to read is this readme.

==============================================
Install:
==============================================

Backup your "raw/objects" folder! Rubble will delete all your existing raw files!
Extract Rubble to "<DF Directory>/rubble".
Install your addons to "<DF Directory>/rubble/addons"
(If you use DFHack) add "script rubble.dfhack" to your dfhack.init file, this step is VERY IMPORTANT for DFHack users!
Run "rubble -addonlist" OR run "Rubble GUI.exe"

Now you are good to go! Documentation is in the "rubble/other" folder as is source code and OSX/Linux binaries.

To activate or deactivate a Rubble addon you may set it's entry in addons/addonlist.ini to "true" or "false". If you just added an addon it will not have an entry until Rubble has run at least once (after the addon was added).
If you want to run Rubble without generating anything so as to update the addon list file just run 'rubble -addonlist'

If you can (eg. you are running on windows) it is HIGHLY recommended to use the GUI. The GUI automates the process of updating and editing addonlist.ini and is generally much faster then doing everything by hand (plus you don't have to mess around with the command prompt, if you dislike that kind of thing)

If you want to run multiple worlds with radically different addon sets it is HIGHLY recomended to run "rubble -prep=<region name>" before switching worlds!

If you use OSX or Linux, 32 bit binaries for these OSes can be found in the "rubble/other" directory. If you want 64 bit binaries you can compile them yourself, source code is in other/src (along with basic build instructions).

==============================================
Configure:
==============================================

Rubble allows you to change its settings via command line options or a config file. To see these options and their defaults run "rubble -h".

ALL command line options may also be specified in the config file.

Rubble tries to read the file "./rubble.ini", if this does not fail Rubble will load settings from here before processing command line options (command line options always take precedence).
Example "rubble.ini" (using some of the defaults):
   [rubble]
   dfdir = ..
   outputdir = ../raw/objects
   addonsdir = ./addons

Rubble supports external launchers via the -config and -addons command line options
-config allows you to set/create rubble variables.
   Usage: -config="key1=value1;key2=value2;keyN=valueN"
      (Note that the ';' may need to be a ':' on non-windows systems)
-addons allows you to override the default rules for loading addons by explicitly listing which ones you want to load.
   Usage: -addons="addon1;addon2;addon3;ect"
      (the same note about ';' applies here as well)
These two options are mostly for use by external launchers.

If you want to regenerate the raws for a save just run 'rubble -outputdir="../data/save/<savename>/raw/objects"'

All directories used by Rubble must exist (you should get an error message if not).

==============================================
Included Addons:
==============================================

I include addons in the base Rubble install that fix bugs, demo something useful, or are just too useful to leave out.
Needless to say these addons make a good place to look for info on how to do something.

If you want to generate the Rubble version of "vanilla DF" you will need to activate the "Base/Files", "Base/Templates", and "Base/Clear" addons, these addons are already active in the default addonlist.ini.

Spoiler (click to show/hide)

==============================================
BUGS (and other issues):
==============================================

Known Issues (non-bug):
   
   You should not use the extension .txt for readme files, as this will cause Rubble to parse those files.
      See "Rubble Addons.txt" for more details.
   
   It may be possible to see FBs made from "dfhack command" or "caste transformation", there is nothing I can do about this as autosyndrome requires the use of inorganic materials.

When making an error report please post the FULL log file! Posting just a few lines tells me almost nothing about the problem, after all I made Rubble write all that stuff for a reason :)

If any of the documentation is not 100% clear just ask.
I know everything there is to know about how Rubble works and so I tend to forget to put
"obvious" stuff in the docs. A reminder that I forgot something is more a help than a hindrance.

==============================================
Changelog:
==============================================
Spoiler (click to show/hide)

Download (at DFFD) (http://dffd.wimbli.com/file.php?id=7801)
Title: Re: Rubble v1.3 - After Blast comes Rubble (Not ready for general use, preview only)
Post by: MagmaMcFry on July 02, 2013, 02:02:31 pm
<redacted because not nice>
Title: Re: Rubble v1.3 - After Blast comes Rubble (Not ready for general use, preview only)
Post by: milo christiansen on July 03, 2013, 05:39:23 pm
As for the competition, a little back and forth should make us all stronger ;) Just remember that a lot of templates are going to change at some point.

Thanks for the report. As for SET leaking stuff all over the cause is a little hard to explain but obvious once you know how NCA4 handles return values. The junk you are getting is because I forgot that I needed to clear the return register, as the command that sets a variable's value returns "unchanged" aka whatever the previous command returned.

One of the dumb bugs that I still need to fix. Now that I think about it I forgot to test SET (as well as a few other templates) after I ported them to NCA, oops.

One other bug that may cause some of that stuff is that i used SCRIPT where I should have used !SCRIPT or #SCRIPT The following replacement for "raw/source/base/base_templattes.txt" should fix those errors (as well as the SET error).
Code: [Select]
'Templates used in the base

Note that to keep the output properly formatted templates often have ugly indentation'

'The comment templates, very simple, just do nothing.'
{!TEMPLATE;COMMENT;}
{!TEMPLATE;C;}

'VOID, a little more complicated, this is a prime example of using ...'
{!TEMPLATE;VOID;
{SCRIPT;
(foreach params {
'Note that params here is NOT the same map as the one passed to foreach'
(rubble:stageparse [params 1])
(break -1)
})
(ret "")
;...}
}

'PANIC, cause Rubble to exit with an error, not used in the base.'
{!TEMPLATE;!PANIC;msg;
{!SCRIPT;(panic (rubble:expandvars {%msg}))}
}
{!TEMPLATE;PANIC;msg;
{SCRIPT;(panic (rubble:expandvars {%msg}))}
}
{!TEMPLATE;#PANIC;msg;
{#SCRIPT;(panic (rubble:expandvars {%msg}))}
}

'The next two templates are for stripping leading/trailing whitespace from a string.
A formatting tool mostly, helps keep whitespace under control in generated files.'
{!TEMPLATE;ECHO;
{SCRIPT;
(var tmp)
(foreach params {
(set tmp (append [tmp] [params 1]))
})
(ret (rubble:stageparse [tmp]))
;...}
}
{!TEMPLATE;E;{ECHO;...}}

'SHARED_OBJECT and SHARED_ITEM. SHARED_ITEM will be removed as soon as I get around to it.'
{!SCRIPT;(map "rubble:shared_object_data")}
{!TEMPLATE;SHARED_OBJECT;id;raws;
{SCRIPT;
(if (eq [rubble:shared_object_data {%id}] "ok"){
(rubble:stageparse {%raws})
(ret "")
}{
(set rubble:shared_object_data {%id} "ok")
(ret (rubble:stageparse {%raws}))
})
}
}
{!TEMPLATE;SHARED_ITEM;id;raws;{SHARED_OBJECT;%id;%raws}}

{!TEMPLATE;IF;a;b;then;else;
{SCRIPT;
(if (eq {%a} {%b}){
(ret {%then})
}{
(ret {%else})
})
}
}

{!SCRIPT;(map "rubble:once_data")}
{!TEMPLATE;ONCE;id;raws;
{SCRIPT;
(if (eq [rubble:once_data {%id}] "ok"){
(ret "")
}{
(set rubble:once_data {%id} "ok")
(ret (rubble:stageparse {%raws}))
})
}
}

{!SCRIPT;(map "rubble:static_data")}
{!TEMPLATE;STATIC;id;raws;
{SCRIPT;
(if (exists rubble:static_data {%id}){
(ret [rubble:static_data {%id}])
}{
(set rubble:static_data {%id} (rubble:stageparse {%raws}))
})
}
}

{!TEMPLATE;SET;name;value;
{SCRIPT;
(rubble:setvar {%name} {%value})
(ret "")
}
}

{!SCRIPT;(var "rubble:adventure_tier_data" -1)}
{!TEMPLATE;#ADVENTURE_TIER;
{#SCRIPT;
(set rubble:adventure_tier_data (add [rubble:adventure_tier_data] 1))
(ret [rubble:adventure_tier_data])
}
}

{!TEMPLATE;!PRINT;
{!SCRIPT;
(foreach params {
(console:print "\t" [params 1] "\n")
(break -1)
})
(ret "")
;...}
}
{!TEMPLATE;PRINT;
{SCRIPT;
(foreach params {
(console:print "\t" [params 1] "\n")
(break -1)
})
(ret "")
;...}
}
{!TEMPLATE;#PRINT;
{#SCRIPT;
(foreach params {
(console:print "\t" [params 1] "\n")
(break -1)
})
(ret "")
;...}
}

{!TEMPLATE;SHARED_INORGANIC;id;raws;
{SCRIPT;
(append
"{SHARED_OBJECT:" {%id} ";\n"
"[INORGANIC:" {%id} "]\n\t"
(rubble:stageparse {%raws})
"{#_REGISTERED_ORES;" {%id} "}"
"{#_REGISTERED_REACTION_CLASSES;" {%id} "}"
"{#_REGISTERED_REACTION_PRODUCTS;" {%id} "}"
"\n}"
)
}
}
{!TEMPLATE;SHARED_MATERIAL_TEMPLATE;id;raws;
{SCRIPT;
(append
"{SHARED_OBJECT:" {%id} ";\n"
"[MATERIAL_TEMPLATE:" {%id} "]\n\t"
(rubble:stageparse {%raws})
"{#_REGISTERED_ORES;" {%id} "}"
"{#_REGISTERED_REACTION_CLASSES;" {%id} "}"
"{#_REGISTERED_REACTION_PRODUCTS;" {%id} "}"
"\n}"
)
}
}

'This is used for generic animal mats'
{!TEMPLATE;ANIMAL_MAT;
{IF;$GENERIC_ANIMAL_MATS;YES;
CREATURE_MAT:ANIMAL
;
LOCAL_CREATURE_MAT
}
}

{!TEMPLATE;#AQUIFER;
{IF;$USE_AQUIFERS;YES;
[AQUIFER]
;
Aquifer Disabled
}
}

'An evil hack to make declaring items easy.'
{!TEMPLATE;BASE_ITEM;type;item;def;
{SHARED_OBJECT;%item;
{ITEM;%type;%item;%type}
%def
}
}


{!SCRIPT;(map "rubble:tile_data")}
{!TEMPLATE;SET_TILE;id;tile;
{SCRIPT;
(if (exists rubble:tile_data {%id}){
}{
(set rubble:tile_data {%id} {%tile})
})
(ret "")
}
}
{!TEMPLATE;#TILE;id;default;
{#SCRIPT;
(if (exists rubble:tile_data {%id}){
(ret [rubble:tile_data {%id}])
}{
(ret {%default})
})
(ret "")
}
}

'This tells Rubble to only read this file on the first pass and to not write it to disk.'
{!SCRIPT;(rubble:skipfile "base_templates")}

A fix for variable expansion woes is comming in the next version. I should have thought of that problem myself :(
Title: Re: Rubble v1.4 - After Blast comes Rubble - Now with everything working! (I hope)
Post by: milo christiansen on July 08, 2013, 06:25:47 pm
Updated to 1.4- see first post.

Changelog highlights:
Variable expansion is fixed
NCA updated to version 5
lots of template bugs fixed, some small some large
Added support for tilesets
Title: Re: Rubble v1.4 - After Blast comes Rubble - Now with everything working! (I hope)
Post by: MagmaMcFry on July 09, 2013, 06:50:42 am
Code: [Select]
test_file

--1

--2
[DESCRIPTION:A [i]real[/i] small furry creature from Alpha Centauri.]
--3

--4

  [DESCRIPTION:A small furry creature from Alpha Centauri.]
--5
Nope, still not working.
Title: Re: Rubble v1.4 - After Blast comes Rubble - Now with everything working! (I hope)
Post by: milo christiansen on July 11, 2013, 02:26:53 pm
That is correct behavior, variables outside of templates are expanded last, AFTER the post parsing pass. Variables inside of a template body are expanded before the template is parsed. To fix your template you would need to suround the variable with an ECHO template like so:
Code: [Select]
--1
{SET;DESC;A small furry creature from Alpha Centauri.}
--2
[DESCRIPTION:{E;$DESC}]
--3
{!TEMPLATE;SET_AND_WRITE_DESC;desc;
  {SET;DESC;%desc}
  [DESCRIPTION:{E;$DESC}]
}
--4
{SET_AND_WRITE_DESC;A [i]real[/i] small furry creature from Alpha Centauri.}
--5
Most of the time variables are not used outside of templates or inside of template bodies where this would be a problem, variables are mostly for settings and the like, if you want to do anything complicated it is better to use NCA.
Title: Re: Rubble v1.5 - After Blast comes Rubble - Now with better script support!
Post by: milo christiansen on July 11, 2013, 02:32:43 pm
Updated to 1.5

Changelog highlights:
NCA much improved
All templates except the unportable ones are ported to NCA
Title: Re: Rubble v1.5 - After Blast comes Rubble - Now with better script support!
Post by: milo christiansen on July 18, 2013, 11:20:06 am
1.6 is almost done. Highlights will be MUCH better tileset support and NCA v6

Tileset support will be automatic in that all the SHARED_XXX templates (except SHARED_OBJECT) will automaticly wrap tile numbers and colors in the correct template calls. One problem is that plant raws with embeded materials will not extract the material tags, sorry no good way to do that, you'll have to wrap those manually.

NCA6 adds better script value support for native commands, this allows me to add more powerful commands and provide better Indexable support as well as having more internal types for faster math (no more converting to/from string all the time, floating point support possible)

Script debugging will be MUCH easier as I have added a ncash command. Calling ncash will start a slightly nerfed version of NCASH6 allowing you to examine the environment at the point it was called as well as run any debuging code you want before exiting and allowing Rubble to continue.

Look for the update sometime next week.
Title: Re: Rubble v1.6 - After Blast comes Rubble - Now with FULL tileset support!
Post by: milo christiansen on August 21, 2013, 02:45:47 pm
I have version 1.8 almost ready to ship, just a few script related things to finish up first. (1.7 got skipped, I was finished and had it all packed up when I had a "strange mood" and finished off NCA7, which adds so much cool stuff that shipping a 1.7 with a 1.8 to follow very soon seemed to be a waste)
Title: Re: Rubble v1.8 - Now with even better script support!
Post by: milo christiansen on August 23, 2013, 02:20:33 pm
Version 1.8 is up!

Changelog highlights:
Finally added support for a config file
Updated to NCA7, this included many, many, changes to the script runtime (I rewrote it almost from scratch). A bunch of commands are now namespaced/renamed and there is support for "object literals". All these changes make NCA even easier to use.
Added a template for addon hooks.
Title: Re: Rubble v1.8 - Now with even better script support!
Post by: Taverius on September 07, 2013, 09:46:51 am
This is confusing me:

Quote
{#WRITE_TILESET;<PATH>}
    Write calls to SET_TILE and SET_COLOR for all calls to #TILE and #COLOR to file <PATH>.
    This should only be used once to get a template for making a tileset addon, it has no other use.
    Note that for this to work #WRITE_TILESET MUST be called AFTER every call to #TILE or #COLOR!

It only needs to be called once, but it needs to be called after every #TILE/#COLOR call?

... huh?
Title: Re: Rubble v1.8 - Now with even better script support!
Post by: Taverius on September 08, 2013, 02:20:22 am
Code: [Select]
Error: Script Error: Invalid Token: Found: TknCmdEnd. Expected: TknString or Tkn
CmdBegin or TknDerefBegin or TknObjLitBegin. On Line: 50 Column: 3.
Near line: 8 In last file
Was just trying it out with the broken arrow addon enabled.
Title: Re: Rubble v1.8 - Now with even better script support!
Post by: milo christiansen on September 13, 2013, 01:48:40 pm
Sorry if I am a little late, I don't visit the forums much :(

#WRITE_TILESET is something of a special command. It should only be used to generate a tileset file, and so is ment to be added to the last file processed temporarily. As its description says it writes (to the file name passed as a param) a call to SET_TILE or SET_COLOR for ever call to #TILE or #COLOR that exists in the raws.

As for your error... That is a script error, eg it was caused by NCA. This appears to be a syntax error, but if you were using the vanilla base and addons it is more likely to be a goof on my part. When I get home I'll take see if I can reproduce the error and see what is wrong. Look for more info after 2 pm monday.
Title: Re: Rubble v1.9 - Now with bug fixes!
Post by: milo christiansen on September 16, 2013, 03:23:01 pm
Rubble 1.9 uploaded.

Change log highlights:
Fixed ITEM_CLASS
The Rubble windows binary now has an icon!
Title: Re: Rubble v2.0 - Now with tweak scripts!
Post by: milo christiansen on September 26, 2013, 04:44:00 pm
Rubble 2.0 uploaded.

This was going to be version 1.10 but then I added Tweak Scripts. Tweak scripts are the bigest thing to happen to Rubble since the SCRIPT template, basicly they are small NCA scripts that run before or after generation, thereby allowing you to "tweak" the raws.

A little hard to explain, take a look at the included addons, they ALL use tweak scripts for one thing or another.
Title: Re: Rubble v2.0 - Now with tweak scripts! (and a GUI)
Post by: milo christiansen on October 21, 2013, 05:21:32 pm
2.1 is on it's way and it has some new stuff!
Mostly I changed the scripting system (again) and added new addons to deal with some vanilla raw bugs. The reason I have not uploaded it yet is that I still need to do some more testing.
Title: Re: Rubble v2.0 - Now with tweak scripts! (and a GUI)
Post by: thistleknot on October 21, 2013, 09:53:40 pm
I tried learning your's cuz the format looks less intimidating than blast...

I successfully applied simple materials to vanilla

so I tried with civforge

first run through I got a few errors related to readme files... so I deleted them, and re-ran

apparently there is an undefined template that causes a crash
Code: [Select]
base\tissue_template_cf.txt
=============================================
Parsing...
addons\__generic_animal_mats\aaa_generic_mats_overrides.rbl
    Error: Invalid template: REGISTER_REACTION_PRODUCT
    Near line: 2 In last file

Spoiler (click to show/hide)

I would suspect naturally, to avoid halting the app, that instead it should log the nonfind, and not touch it, and move on to the rest.  Then a modder can go in and add the soulshard template to animal generic template what-not later.
Title: Re: Rubble v2.0 - Now with tweak scripts! (and a GUI)
Post by: milo christiansen on October 29, 2013, 05:11:07 pm
Without seeing the whole log its a little hard to see exactly where the crash happened...

Oh! I know what the problem is! Let me guess, you replaced the base, nothing wrong with that... just that REGISTER_REACTION_PRODUCT is defined (along with lots of other critical templates) in "base_templates.rbl". Copy that over to your base and you should be good to go.

The problem has nothing to do with "base\tissue_template_cf.txt" and everything to do with "addons\__generic_animal_mats\aaa_generic_mats_overrides.rbl" and its dependency on the default base.

Rubble will not touch anything that is not a template call (eg surounded in {}), and as "base\tissue_template_cf.txt" has no curly brackets at all the only thing Rubble will do to it will be to add a file id line, which in this case is not needed.

About ignoring and going on... Not a good idea. This could easily lead to (very) invalid raws causing all sorts of problems. I belive that if something is worth complaining about it is worth fixing and my tools reflect that.

About my format looking less intimidating than Blast, you do know that the syntax I use was copied from Blast right? ;)


About 2.1: I was going to be uploading that today, but my flash drive died, literaly as I was copying the archive over :(
Title: Re: Rubble v3.0 - Can now load addons from .zip files!
Post by: milo christiansen on November 04, 2013, 05:58:21 pm
2.1? I meant 3.0!

Saturday night, in a sudden codding frenzy I basicly rewrote the whole thing :)
The only parts that are (mostly) untouched are the template execute code and the indexable support for addon files (rubble:raws), everything else has been redone to one degree or another.

Also I fitted in the latest NCA (the scripting subsystem), now renamed to Raptor.

Basicly the whole thing is now faster and better all around.

The two big changes are the removal of the base (it's now just another addon) and the ability to load addons and groups of addons from zip files.
Title: Re: Rubble v3.0 - Can now load addons from .zip files!
Post by: CryptoCactus on November 07, 2013, 05:37:47 pm
FYI zapping aquifers seems to consistently result in this:

Code: [Select]
Error: Script Error: Wrong number of params to bool:not. Near Line: 15 Column: 23
  Near line: 1 In last file.

Complete log:
Spoiler (click to show/hide)

Also note the log still says 2.1 instead of 3.0.


edit: Ah, gotta love/hate the easy ones. Extra paren in the script.

Looks like
(bool:not ) false)
should be
(bool:not false)


Yeah? Seems to work, anyway.
Title: Re: Rubble v3.0 - Can now load addons from .zip files!
Post by: milo christiansen on November 11, 2013, 11:27:54 am
I never zap aquifers aside from when I first tested that addon, not sure how that slipped through...
The next version should provide better position info for errors :) some errors that is.
Thanks for reporting it anyway, the next version will have that fixed.

About the incorect version in the header... I forgot to update that when I edited the .rc file, shouldn't happen again as I added a comment to remind myself next time :)
At least it's not as bad as the last time I forgot to update the header, it still said v1.0 when the version was 1.6? I think.

BTW: when the log says "Near line: 1 In last file." that is mostly worthless as 1 is the default for the line value in the Rubble parser. The only thing that returns "good" positions most of the time is the Raptor parser, and most of the time the postion returned from that is meaning less because Rubble dose not give Raptor a good offset for the start of each script.
For now error position information is more of a hint than anything else :(

3.1 will include a much improved addon loader that can load grouped and nested addons, for example Base/Files, Base/Templates, and Base/Clear are the new names for base, base_templates, and clear_raws. 3.1 won't be uploaded until the next Better Dorfs is ready, as until that is done I never know when I will want to add a new template or fix a bug :)
Title: Re: Rubble v3.2 - Now with forced init scripts!
Post by: milo christiansen on November 26, 2013, 02:32:43 pm
3.2 is up!

3.2 included minor script bugfixes (none of the bugs effected Rubble) and "forced init scripts", a useful new tool for the makers of large addon packs.
Title: Re: Rubble v3.3 - Now MUCH better tileset support!
Post by: milo christiansen on December 02, 2013, 02:03:07 pm
3.3 is up!

3.3 has more tileset related templates as well as a better version of the ITEM template (renamed to SHARED_ITEM, you can still use the old name but please don't, it'll be going away soon)

Also I built a version of the Raptor shell into Rubble, so you can now do things like validate scripts without needing an extra tool.
Title: Re: Rubble v3.5 - New (sort-of) library addons!
Post by: milo christiansen on December 23, 2013, 03:12:50 pm
The "Libs/DFHack/Announcement" addon has a bug in the script.
Its not a major problem, but announcements will not be written to the gamelog. To fix it all you need to do is change "msg" to "text" in the last block of code in the script.

As this addon is not used anywhere yet I will not upload a new version of Rubble until I find/fix some other bugs and/or add some new stuff.
Title: Re: Rubble v3.6 - Scripting improvements!
Post by: milo christiansen on January 08, 2014, 06:23:25 pm
3.6 is up!

The main change to 3.6 is the improvement of rubble:raws and the update to Raptor 2.2.
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: milo christiansen on January 13, 2014, 01:42:46 pm
And quickly followed by 3.7 :)

This update is mostly to add some templates, I finally found a use for the @ prefix ;)
(also variable handling in parameters has changed a little and the config file is more flexible)
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: milo christiansen on January 15, 2014, 05:09:33 pm
I need a place to put this so I'll just leave it here (after all the only place it is used right now is in Rubble)

announce.lua, print a message to the screen and game log:
Usage: announce "message" [color]
Code: [Select]
local helpstring = [[ Display an announcment and write it to the game log.
  announce message|? [color]
    message  The message you want to display.
    color    The color to display the message in.
    ?        Print this help.
]]

if not dfhack.isMapLoaded() then
qerror('Map is not loaded.')
end

local args = {...}
if not args or args[1] == "?" then
print(helpstring)
return
end

local text = args[1]

-- COLOR_BLACK
-- COLOR_BLUE
-- COLOR_GREEN
-- COLOR_CYAN
-- COLOR_RED
-- COLOR_MAGENTA
-- COLOR_BROWN
-- COLOR_GREY
-- COLOR_DARKGREY
-- COLOR_LIGHTBLUE
-- COLOR_LIGHTGREEN
-- COLOR_LIGHTCYAN
-- COLOR_LIGHTRED
-- COLOR_LIGHTMAGENTA
-- COLOR_YELLOW
-- COLOR_WHITE
local color_id = args[2]
if not color_id then color_id = "COLOR_WHITE" end

local color = _G[color_id]

dfhack.gui.showAnnouncement(text, color)

local log = io.open('gamelog.txt', 'a')
log:write(text.."\n")
log:close()
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: thistleknot on January 16, 2014, 07:39:02 pm
is this a new script?  If so, there's a new thread for scripts.

Is it a fix?

Doesn't seem like the current form of announcements used in mwmod, so I'm figuring it's something your using.
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: milo christiansen on January 18, 2014, 01:36:15 pm
That is the script that drives the "Libs/DFHack/Announcement" Rubble addon, basicly it allows you to display announcements without needing to edit the script every time you add one.

To use with just DFHack:
announce "This will show in white!"
announce "This will be red!" COLOR_LIGHTRED

To use with Rubble:
Activate "Libs/DFHack/Announcement" and "Libs/DFHack/Command" then
{DFHACK_ANNOUNCE;Rubble, Fast and simple!;COLOR_LIGHTGREEN}
(That template will generate a product line for an autosyndrome rock and possible a material)

The script is listed in the main script thread, I just put it here to have something to link to.
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: Meph on January 18, 2014, 02:21:43 pm
I like it, because it adds to the gamelog. :)
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: milo christiansen on January 18, 2014, 02:31:08 pm
The gamelog thing was something of an afterthought ;)

Glad you like it :)
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: milo christiansen on January 21, 2014, 11:42:59 am
Well I was going to upload 3.7.1 today, but DFFD won't cooperate...

In any case it was mostly just a internal update (mostly better Raptor errors), no big deal.

3.7.2 will be the same thing to Rubble itself, better error messages are coming!
Title: Re: Rubble v3.7 - More templates (and other minor changes)!
Post by: milo christiansen on January 24, 2014, 04:43:37 pm
Ok, 3.7.2 will not be coming after all :( largely because I added some more stuff that will require a new Better Dorfs version.

Expect 3.8 as soon as I can add a good coat of polish to the latest BD
Title: Re: Rubble v3.8 - Better error messages!
Post by: milo christiansen on January 28, 2014, 12:01:35 pm
3.8 is up!

3.8 Mostly brings better error messages, but there are some other goodies as well :)
Title: Re: Rubble v3.8 - Better error messages!
Post by: CryptoCactus on February 12, 2014, 03:01:59 pm
Zap aquifers is being silly again.

Error in zap_aquifers.post.rsf, line 18, c17. I believe

Code: [Select]
(raw:disable)
should be

Code: [Select]
(raw:disable[file])
Title: Re: Rubble v3.8 - Better error messages!
Post by: milo christiansen on February 14, 2014, 05:17:32 pm
oops...

I guess you can tell I never use that addon.
The raw parser used to use a global file, but after I added threading I changed it and aperently missed that line...

Anyway 3.9 is up!

This update is mostly just changes library addons.
Title: Re: Rubble v3.9 - Lib Addon improvments!
Post by: milo christiansen on March 01, 2014, 01:44:42 pm
3.10 is on it's way, All I need to do yet is finish updating BD2 and BDC the I'll upload :)
Title: Re: Rubble v3.10 - Creature Graphics (and other new stuff)!
Post by: milo christiansen on March 05, 2014, 03:47:19 pm
As a new version is not expected for a few weeks at least I will post this bug and workaround here for all to see:
Bug:
"Dev/Dummy Reactions" does not work at all.
Fix:
Replace "(ret out)" with "(ret [out])" in file "reaction_dev_dummy_reactions.txt"
Title: Re: Rubble v3.11 - Awesome new DFHack stuff!
Post by: milo christiansen on March 10, 2014, 12:05:13 pm
3.11 is up!

Main highlights:
Bug fixes
Libs/DFHack/Fluids!
Title: Re: Rubble v3.12 - Awesome new DFHack stuff (that works now)!
Post by: milo christiansen on March 17, 2014, 05:18:17 pm
Last version had a tiny bug in the script that drives "Libs/DFHack/Liquids" so none of the buildings that filled minecarts worked.
This version (3.12) fixes that as well as adding a very important new ability.
Title: Re: Rubble v3.12 - Awesome new DFHack stuff (that works now)!
Post by: milo christiansen on March 19, 2014, 04:27:28 pm
I was a little pressed for time when I last posted so I didn't really explain much, anyway the "important new ability" is the "prep" "addon". (prep is not really an addon, but it kinda acts like one)

Prep is my answer to the problem of mutiple (possibly very diferent) worlds using the same DFHack and init settings. Some addons assume that they will be able to write arbitary DFHack scripts and/or make init changes that will then persist for as long as you use the world in question, the problem with this is that people tend to run several worlds at the same time, and breaking your old worlds every time you generate a different set of raws in uneceptable.

Basicly addons that make changes to something other than the raws can now have scripts and data files added to a special "addon" named "prep" that is then written to the raw folder. When you want to switch worlds you first run "rubble -prep=<region>" to load this "addon" and run it's scripts. This ensures that the same tileset is installed, all the DFHack scripts are the proper versions, ect. for running the specified world.
If you want to revert to the "default" settings (eg the setting used by the main raw folder) just run "rubble -prep=raw".

All the default addons that needed it should have prep support, so in general you do not need to do anything special to use this new ability.
Title: Re: Rubble v3.13 (for 34.11) - Minor bug fixes!
Post by: milo christiansen on April 09, 2014, 04:11:21 pm
So 3.13 is up, and it is probably the last version for 34.11, it is certainly the last 3.x version.

I am currently testing "pre4" which uses Rex instead of Raptor for it's scripting susystem. The main reason for the switch is speed, Rubble 3.13 takes ~11-12 seconds to generate all default addons while Rubble pre4 takes ~3.5 (quite the improvment!).

The change will also bring several other improvments, mostly due to the fact that Rex was designed from the ground up to solve all the biggest problems with Raptor.
The main issue is that all scripts will need to be rewritten at least a little, for example the old syntax "(var a 10)(set a 100)" is now "&var a = 10; [a = 100]".

pre4 (or 4.0 as it will be known by then) will not be out for some time as I need to port all the default addons AND all the addons in Better Dorfs, which adds up to a lot of scripts to rework :)
I would also like to hold it back until DF2014 is out, so all my porting can pile up at once...