Bay 12 Games Forum

Please login or register.

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

Author Topic: Rubble 8.5.5 - DF 44.7 - New DF, new Rubble.  (Read 67505 times)

nefariousD

  • Bay Watcher
    • View Profile
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #30 on: January 22, 2016, 10:29:57 am »

Love this tool and all the great scripts/mods it comes with.. Thank you Milo!
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #31 on: January 22, 2016, 02:53:55 pm »

Ran into a speedbump.  My creature graphics info keeps showing up in the aux text folder.

That is, graphics_test_creatures.graphics.txt shows up in the same "text" folder as the book titles.

That is probably a bug in the output function. I can say with confidence that this feature worked back when I added it, but who knows, I may have broke it by accident since then...

Now for your other questions:

1) PRINT works the way it does on purpose, but it could be nice to have a way to add stuff to a new "major warnings" section at the end of the log...

2) You mean something like:
Code: [Select]
{@IF;$A;YES;
    # Do something
;
    {@IF;$B;YES;
       # Do something else
    ;
       # Do a default action
    }
}

$B should not be expanded until the second @IF call. If it is being expanded earlier then that is a major bug that will break all kinds of stuff. I just did a bunch of work on the expansion function to fix a different bug, and I thought I tested all that stuff...

Hmm... I need to check, but it may be possible that I accidentally told one of the templates to expand all variables regardless of if they are nested in a child template or not. This should not be the case, but I have missed more obvious problems before :(

Or do you mean that it is not being expanded at all?

EDIT: Say your PM with an error log, that helps a lot. Expect an answer (and a fix if needed) soon.
« Last Edit: January 22, 2016, 03:09:49 pm by milo christiansen »
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #32 on: January 23, 2016, 06:55:46 am »

... I just did a bunch of work on the expansion function to fix a different bug, and I thought I tested all that stuff...

Hmm... I need to check, but it may be possible that I accidentally told one of the templates to expand all variables regardless of if they are nested in a child template or not. This should not be the case, but I have missed more obvious problems before :(

Or do you mean that it is not being expanded at all?

EDIT: Say your PM with an error log, that helps a lot. Expect an answer (and a fix if needed) soon.

@Milo a testing framework to detect regresions early could help and accelerate the development of the Rubble templates and lua bindings; here are some lua testing frameworks http://lua-users.org/wiki/UnitTesting, Busted framework (Elegant Lua unit testing) is in active development (last git log 8 days ago) and is compatible with moonscript.

When using this system each new functionality should have one or more case test with the expected result when the implementation is correct. This represent some work but can also be time saving, semiautomatic bug hunting...
Love this tool and all the great scripts/mods it comes with.. Thank you Milo!
I support this!
« Last Edit: January 23, 2016, 07:24:38 am by Abadrausar »
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #33 on: January 25, 2016, 01:01:51 pm »

Finding a framework for unit testing isn't a problem (Go comes with a pretty good one, and I could throw something together for unit testing templates without too much trouble), the hard part is actually getting the tests written. I should probably get inspired and at least get a testing interface written...

Anyway...

@Dirst:
  • I could not reproduce the bug you reported with @IF, the addon you specified as the failing one generated without errors. I can't decide if that is good or bad... On one hand, no bug, no problem, but on the other there may be a bug that I am missing somehow...
  • The warnings system you requested is in and working, I rather like it now that I have it, thanks for the suggestion!
  • I used your addon to test the warnings system because it generates two sets of warnings, both indicating bugs in your addon:
    • The TESB_FAVOR_SYNDROME template (in the inorganic file) needs to be updated to include the INORGANIC: prefix in the call to SHARED_OBJECT_EXISTS. All the other shared object IDs seem to have been fixed.
    • The creature graphics raw file is missing the OBJECT:GRAPHICS tag at the top of the file (this explains why the raw consistency checker spews a slew of warnings when the graphics addon is active).


Rubble 7.3.2 is up now!

This version brings some bug fixes and one new feature, warning messages.

I did do some extra work to help make a later transition to my Lua VM as painless as possible, but it's all minor stuff.

Speaking of my Lua VM: I have a lexer, now all I need is a parser/code-generator. AFAIK the VM itself is basically done. I included source code for the VM and a Rubble script API that uses it, but neither one has been tested since just before I started work on the lexer, so they probably won't compile... If you are feeling really masochistic you can probably build a version of Rubble that uses Lua 5.3 for scripting, but it would be a non-trivial task right now.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #34 on: January 25, 2016, 01:36:56 pm »

I could not reproduce the bug you reported with @IF, the addon you specified as the failing one generated without errors. I can't decide if that is good or bad... On one hand, no bug, no problem, but on the other there may be a bug that I am missing somehow...
That particular case doesn't produce any errors, but the inner @IF never seems to execute.  I worked around it by faking an AND condition (test for two bits of text separated by a space, rather than each bit individually).

The warnings system you requested is in and working, I rather like it now that I have it, thanks for the suggestion!
Thanks for coding that in!

The TESB_FAVOR_SYNDROME template (in the inorganic file) needs to be updated to include the INORGANIC: prefix in the call to SHARED_OBJECT_EXISTS. All the other shared object IDs seem to have been fixed.
Yeah, that was a *facepalm* when I noticed it.

The creature graphics raw file is missing the OBJECT:GRAPHICS tag at the top of the file (this explains why the raw consistency checker spews a slew of warnings when the graphics addon is active).
Ah, I thought that was one of the things the extended file extensions handled.  Now it makes much more sense, thanks for all of your work on Rubble!
Logged
Just got back, updating:
(0.42 & 0.43) The Earth Strikes Back! v2.15 - Pay attention...  It's a mine!  It's-a not yours!
(0.42 & 0.43) Appearance Tweaks v1.03 - Tease those hippies about their pointy ears.
(0.42 & 0.43) Accessibility Utility v1.04 - Console tools to navigate the map

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #35 on: January 25, 2016, 02:07:27 pm »

That particular case doesn't produce any errors, but the inner @IF never seems to execute.  I worked around it by faking an AND condition (test for two bits of text separated by a space, rather than each bit individually).

Hmmm... I'll look it over when I get home. Not sure how or why that would be the case, but it may just be one of those stupid little bugs.

Ah, I thought that was one of the things the extended file extensions handled.  Now it makes much more sense, thanks for all of your work on Rubble!

Nope, Rubble never modifies the raws directly beyond adding a "this file has been automatically generated" header and adding the file ID (that line at the beginning that matches the file name without extension).

I think it would be really nice to have a "testing interface", basically a special CLI Rubble interface that runs specially formatted "test files" that combine some template code with an expected output section. The test interface would find and run all of these test files, reporting any that do not generated the expected output. By unifying the test and it's expected result into the same file (possibly with multiple sets of tests in a file) it would be possible (or rather, easy) for bug reports to be accompanied by a simple test demonstrating the problem. Writing enough tests to cover everything would be a heroic job, but I could handle it the same way I am handling the rules for the raw consistency checker, a few at a time ;) Of course the simpler I make the test format the better, as a simple format is more likely to be used by others (and the more it is used by others the less work I have to do).
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: Rubble 7.3.1 - DF 42.4 - OK, *now* it works!
« Reply #36 on: January 26, 2016, 11:10:12 am »

@Milo: Thanks for implementing !SHARED_OBJECT_DUPLICATE
Spoiler (click to show/hide)
I believe that !SHARED_OBJECT_DUPLICATE is not working as intended because
Code: [Select]
{SHARED_OBJECT_EXISTS;PLANT:MUSHROOM_HELMET_PLUMP;Plump helmet exist;Plump helmet does not exist}Places a Plump helmet exist comment into the plant_z_Intensive subterranean sprouting.txt file but
Code: [Select]
{!SHARED_OBJECT_DUPLICATE;PLANT:MUSHROOM_HELMET_PLUMP;MUSHROOM_HELMET_PLUMP_SPROUTING;true}
or
{!SHARED_OBJECT_DUPLICATE;PLANT:MUSHROOM_HELMET_PLUMP;MUSHROOM_HELMET_PLUMP_SPROUTING;false}
Abort with the message: Call to !SHARED_OBJECT_DUPLICATE trying to duplicate an object that does not exist. Make sure this template is parsed *after* the object you want to extend.
Code: [Select]
{@PARSE_TO;TEMP;{@READ_TABLE;Libs/Base:!SHARED_OBJECT_CATEGORY:REACTION;MAKE_MEAD}Places the entire reaction into the file, so maybe that if !SHARED_OBJECT_DUPLICATE call the function @READ_TABLE before doing modifications this could work?

I am reading the book Programming in Lua by Roberto Ierusalimschy trying to understand the code and being of some utility, as an exercise  I am modifying SHARED_OBJECT_REPLACE_TAG function, the warnings are only for debug purposes because I do not really understand fully what I am doing.
Spoiler (click to show/hide)
In order to make
Code: [Select]
{SHARED_OBJECT_REPLACE_TAG;REACTION:MAKE_MEAD;REAGENT:honey;[REAGENT:honey:150:LIQUID_MISC:NONE:CREATURE_MAT:NONE:HONEY][HAS_MATERIAL_REACTION_PRODUCT:DRINK_MAT]}Work, by the moment the thing eludes me,  but I think that I am approaching the solution little by little, Some deeper reading will be needed... :-X :'( ::)

If anyone can give me some directions or insights about this, I will be grateful. :)
« Last Edit: January 26, 2016, 12:17:59 pm by Abadrausar »
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.3.2 - DF 42.5 - Something clever goes here!
« Reply #37 on: January 29, 2016, 03:52:15 pm »

OK, first of all just because SHARED_OBJECT_EXISTS reports an object exists does no mean that !SHARED_OBJECT_DUPLICATE will be able to see it yet (they are in different parse stages). Is your file processed AFTER the file containing the plump helmet definition?

@READ_TABLE being able to see the object when !SHARED_OBJECT_DUPLICATE cannot is more troubling... I'll run a few tests when I get home to confirm that it is working as intended (or not).

Speaking of tests: Next version you will be able to write something like this:

Code: [Select]
>>> Example Test:
{ECHO;Test Output...}
===
Test Output...
<<<

And run it automatically with "rubble_test". This system is implemented and working, I probably could have pushed out a new Rubble version today, but I wanted to make a few minor tweaks (to other things) so I waited.

Your version of SHARED_OBJECT_REPLACE_TAG appears to do exactly what you want, obviously I haven't tested it... The only thing I can see that may be a problem is that "subtoken" should be indexed from 1 (it's a Lua table). If I remember correctly tag.Params is indexed from 0 because it is a direct interface to a Go slice, and I didn't bother to offset the index to make it more Lua friendly...
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: Rubble 7.3.2 - DF 42.5 - Something clever goes here!
« Reply #38 on: January 29, 2016, 08:39:28 pm »

OK, first of all just because SHARED_OBJECT_EXISTS reports an object exists does no mean that !SHARED_OBJECT_DUPLICATE will be able to see it yet (they are in different parse stages). Is your file processed AFTER the file containing the plump helmet definition?

@READ_TABLE being able to see the object when !SHARED_OBJECT_DUPLICATE cannot is more troubling... I'll run a few tests when I get home to confirm that it is working as intended (or not).

Speaking of tests: Next version you will be able to write something like this:

Code: [Select]
>>> Example Test:
{ECHO;Test Output...}
===
Test Output...
<<<

And run it automatically with "rubble_test". This system is implemented and working, I probably could have pushed out a new Rubble version today, but I wanted to make a few minor tweaks (to other things) so I waited.
This will be very nice! I will try to make some case test, at least for the templates and functions that have more use in my particular style of modding. :o
Your version of SHARED_OBJECT_REPLACE_TAG appears to do exactly what you want, obviously I haven't tested it... The only thing I can see that may be a problem is that "subtoken" should be indexed from 1 (it's a Lua table). If I remember correctly tag.Params is indexed from 0 because it is a direct interface to a Go slice, and I didn't bother to offset the index to make it more Lua friendly...
Argh!!! the 0 or 1 index trap between lua and the C lang family derivatives. The worse here is that it is not always evident when some array comes from the C like (goland) conventions or those of Lua (mathematical convention) except for  local subtoken = string.split(target,":",-1) there I have no excuse that is clearly a Lua lvalue.
I had noticed that tag.Params where not defined anywhere into the lua sources but I had not realised the meaning of that, they were defined in the goland side...

Thanks a lot for your insights, they have been very util, I am less braked now. :D
« Last Edit: January 29, 2016, 08:58:28 pm by Abadrausar »
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.3.2 - DF 42.5 - Something clever goes here!
« Reply #39 on: February 01, 2016, 12:56:14 pm »

The 0, 1 thing will be less of a problem once the new VM hits. With the new bindings all indexes exposed to Lua are 1 based and all indexes in the template language are 0 based (obviously the Go APIs will be zero based as well :P).

7.4.0 is up now, and with it comes template unit testing!

I wrote tests for a bunch of the more error-prone standard templates, in particular @IF and !SHARED_OBJECT_DUPLICATE, both performed flawlessly... All told I have ~15 tests in this version, not very many, but it's a start.
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

Abadrausar

  • Bay Watcher
  • empowering ideas
    • View Profile
    • ♫♪♀HDFPS♂♪♫
Re: Rubble 7.3.2 - DF 42.5 - Something clever goes here!
« Reply #40 on: February 03, 2016, 02:09:49 pm »

The way `SHARED_OBJECT_KILL_TAG` and `SHARED_OBJECT_REPLACE_TAG` match tags are now much more flexible and works exactly as intended. Thanks Milo!
...@IF and !SHARED_OBJECT_DUPLICATE, both performed flawlessly...
!SHARED_OBJECT_DUPLICATE duplicate the code as intended but then it is imposible to use SHARED_OBJECT_REPLACE_TAG or any other over the duplicated object, the reason is that DUPLICATE uses
Code: [Select]
return "{_INSERT_SHARED_OBJECT;"..nid.."}"That is what were used before the introduction of hygiene to evite the clash of identifiers of objects, instead of
Code: [Select]
{!SHARED_OBJECT_CATEGORY;"..v..":%{id};"..v.."}Or any of its specializations. The duplicated object is even inserted into the rubble registry, but it can not be found because it has been inserted in a place of the hierarchy that does not correspond to the kind (creature, plant, material, ...) of the object.
This can be seen when running this code (working)
Spoiler (click to show/hide)
and comparing with (half-working)
Spoiler (click to show/hide)
That says that it does not find the just duplicated plant where all others are placed.
I can see how dealing with a function (DUPLICATE) that must have the capacity to register all possible types of SHARED_OBJECT is complicated and error prone (I know, I have tried and the result is not good to look upon... :o >:( ???)
So my proposal is: what if DUPLICATE simply returns the PRERAWS(id) of the object except the first token (the token id) and then we use the SHARED_object that is correct for his kind?
An example of duplicating a plump helmet with this method.
Code: [Select]
{!SHARED_PLANT;PLANT:MUSHROOM_HELMET_PLUMP_SPROUTING;{!SHARED_OBJECT_DUPLICATE;PLANT:MUSHROOM_HELMET_PLUMP}}The internal coding is more simple, the object is correctly registered and we can also use DUPLICATE in any place (flexibility of prototypes) where some PRERAWS are expected (there are a lot)
Opinions?
« Last Edit: February 03, 2016, 02:44:15 pm by Abadrausar »
Logged
::: Humble Dwarf Fortress Publishing System ♫♪♀HDFPS♂♪♫ Mods Push Published in DFFD are auto updated in local Players Catalog :::

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.4.0 - DF 42.5 - Unit testing!
« Reply #41 on: February 08, 2016, 03:00:41 pm »

Did you look at the tests that come with the new version? One of them tests the proper way of duplicating a shared object created via one of the specialized variants. The process is somewhat complicated: First you need to duplicate the object with a full ID (aka you need to add an explicit type prefix) and turn raw auto-correction OFF, then you need to manually correct the raws (the easy way is to use the raw merger). If you really want the full effect you also need to call the template to register the new object with a type category.

Short version: !SHARED_OBJECT_DUPLICATE works exactly as intended, it's just lower level than you expected. If you need to duplicate lots of objects the sequence can be wrapped in a template, the only reason why there is not already such a template is because most use cases I could think of will want to wrap the sequence in a template anyway...

For reference, here is the test in question:
Code: [Select]
This test makes sure the preferred way to duplicate an object works.
>>> !SHARED_OBJECT_DUPLICATE C:
{!SHARED_INORGANIC;TEST_SOD_C;[FOO][BAR]}

{!SHARED_OBJECT_DUPLICATE;INORGANIC:TEST_SOD_C;INORGANIC:TEST_SOD_C2;false}{!;
{SHARED_OBJECT_MERGE;INORGANIC:TEST_SOD_C2;INORGANIC:?;[INORGANIC:TEST_SOD_C2]}
{!SHARED_OBJECT_CATEGORY;INORGANIC:TEST_SOD_C2;INORGANIC}}
===
[INORGANIC:TEST_SOD_C]
[FOO][BAR]

[INORGANIC:TEST_SOD_C2]
[FOO][BAR]
<<<

If you want the result object to have a "PLANT:" prefix it needs to be supplied to the call to !SHARED_OBJECT_DUPLICATE (and this will necessitate disabling raw auto-correction). I could "smarten up" the auto-correction feature so it handles this case, all it would need is a call to "string.split" and a bit of extra logic...
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.4.1 - DF 42.5 - Unit testing!
« Reply #42 on: February 13, 2016, 12:38:17 pm »

7.4.1 is up now!

This version brings some flexibility updates to !SHARED_OBJECT_DUPLICATE as well as a minor fix for my 24x24 tileset. The changes this time are minor, so no need to update unless you really want to...
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile
Re: Rubble 7.4.2 - DF 42.6 - Color manipulation!
« Reply #43 on: February 23, 2016, 12:31:06 pm »

7.4.2 is up!

This version is in support of the latest First Landing version and to update the Base to 42.6, no other new features or bug fixes included.

For the last 3 days, for hours on end it has been like this: Compile and run the Rubble test interface, wait for the (inevitable) crash, find the script where it crashed, translate that section of script code into a small snippet that does the same basic thing, feed that snippet into my compiler-tester (which prints side-by-side listings from my Lua compiler and the 5.3 reference compiler), figure out where my compiler is going wrong, and finally fix the ^$&# bug and repeat. Yes, it is very frustrating and annoying, why do you ask?

The good news is that I should finally have the compiler (and the VM) ready for Rubble 7.5, yay! The bad news is that I probably have a day or so of compiler debugging (and maybe some VM debugging) before I get that far, wish me luck!
Logged
Rubble 8 - The most powerful modding suite in existence!
After all, coke is for furnaces, not for snorting.
You're not true dwarven royalty unless you own the complete 'Signature Collection' baby-bone bedroom set from NOKEAS

nefariousD

  • Bay Watcher
    • View Profile
Re: Rubble 7.4.2 - DF 42.6 - Color manipulation!
« Reply #44 on: February 24, 2016, 07:21:53 am »

Good luck, and thank you for 7.4.2!
« Last Edit: February 24, 2016, 08:48:06 am by nefariousD »
Logged
Pages: 1 2 [3] 4 5 ... 14