Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 8 9 [10] 11 12 ... 14

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

Dirst

  • Bay Watcher
  • [EASILY_DISTRA
    • View Profile

Hi milo,

Is there a way I can do either of the following?

1. Parse a .post.lua file or otherwise access the SHARED_INORGANICS from it to decide on what to do in that script.

2. Copy a single file from a filebank to a destination from within preraws.

The specific case here is generating a couple dozen simple files (secret_TESB_andesite.txt, secret_TESB_basalt.txt, etc.) and I'd rather only bring over the ones that match existing stone types.

I could do this by setting up 24 distinct filebanks within the mod, but zipping individual words is pretty silly.
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

1 can be done by reading the file and operating on the contents via another Lua script, but it's a pain in the ass.
2 is much easier, but still somewhat complicated (the easiest way would be to write a new template, but you could also use the @SCRIPT template).

There really isn't any easy way any way at all to copy single files from a bank that doesn't involve lots of Lua code.

I'll add support for granular bank copies next version, so if you can wait till then (It'll be soon) then you can just use some shiny new standard library templates to solve your problem :)
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

1 can be done by reading the file and operating on the contents via another Lua script, but it's a pain in the ass.
2 is much easier, but still somewhat complicated (the easiest way would be to write a new template, but you could also use the @SCRIPT template).

There really isn't any easy way any way at all to copy single files from a bank that doesn't involve lots of Lua code.

I'll add support for granular bank copies next version, so if you can wait till then (It'll be soon) then you can just use some shiny new standard library templates to solve your problem :)
That sounds great.  We're talking about saving a minuscule amount of disk space (actually, none at all unless a vanilla stone is modded out by some other addon) but this is more for reducing clutter.  In my specific case I'd rather be able to ECHO arbitrary text directly into a text file, but that might be a bridge too far.
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

Maybe I should add some simple templates for interacting with AXIS and rubble.files? That would allow easy file editing without the need for scripts... (obviously scripts would be more flexible, but for simple stuff templates would do fine)
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

8.4.0 is up now!

This version adds some more stuff for file banks, see the changelog and the documentation for details.
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

8.4.1 is up now!

This version is fairly simple, just some stuff to support my Underhive Settlement reboot.
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

jecowa

  • Bay Watcher
    • View Profile

I'm having trouble with the Mac version of this. It is having trouble finding files.

Spoiler (click to show/hide)

I've tried sticking the DF folder and rubble folder in different locations on my computer. From the documentation, it looks like /df/rubble/rubble32 is the setup that is supposed to work.

I've got the example "rubble.ini" from the documentation saved at /DF/rubble/rubble.ini, but it doesn't seem to recognize that it exists either.

Also, it's saving its log file to my ~/ directory instead of the "rubble" or "df" directory.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

I have never tested Rubble on OSX, so I have no idea what works and what doesn't.

Looking at your log it is obviously not finding anything. Rubble expects the root DF directory to be at "./.." and it's own files to be at ".". If you are running rubble with the current working directory set to "~" then that would explain why the log ended up where it did. Try putting "rubble.ini" in "~" and setting all your paths (specifically "dfdir" and "rbldir") in the ini. If you want a full list of options you can put in the ini run "rubble help".

You can skip the ini if you run Rubble with the current working directory set to "/DF/rubble/" (where DF is at "/DF/" and Rubble is at "/DF/rubble/".

AFAIK recent versions of OSX are all 64 bit, so you probably don't want to use "rubble32". Once a 64 bit DFHack is available I won't be providing 32 bit Rubble builds anymore anyway.
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

jecowa

  • Bay Watcher
    • View Profile

Moving rubble.ini to my home directory and specifying directories in it relative to that got it to work. Also, changing the browser script to "open http://127.0.0.1:2120/menu" got it to open the Rubble Web UI in the default web browser.

I've been trying different launch scripts to try to get it to use the rubble directory instead of the root directory, but haven't found one that works. I'm not sure if that's what I'm supposed to be using to change it. Maybe there's a clue in the launch script from the SoundSense app?:
Spoiler (click to show/hide)

I tried using the first 5 lines of that, but with no success:
Spoiler (click to show/hide)
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

I really have no idea how OSX handles that kind of thing. If you figure anything out though I want to know so I can add it to the section of the docs dedicated to running on different systems.

Maybe try:
Code: [Select]
#!/bin/sh
cd ~/test1/df/rubble/
./rubble
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

jecowa

  • Bay Watcher
    • View Profile

I really have no idea how OSX handles that kind of thing. If you figure anything out though I want to know so I can add it to the section of the docs dedicated to running on different systems.

Maybe try:
Code: [Select]
#!/bin/sh
cd ~/test1/df/rubble/
./rubble

That fixed it!
Spoiler (click to show/hide)

Here's a version of that script that doesn't need to know it's exact location:
Code: [Select]
#!/bin/sh
dir=${0%/*}
if [ -d "$dir" ]; then
 cd "$dir"
fi
./rubble

I don't know if it needs so many lines, but I'm guessing the SoundSense script has them for a reason.

I've still got the WebUI set to this:
Code: [Select]
open http://127.0.0.1:2120/menu
I'm guessing it always uses that port, and that URL will always be the same.

And yes, you do need to use "chmod +x" on both scripts for the Mac version. I think using .ZIP compression strips the permissions, but .DMG (and I think .TAR.BZ) preserve the permissions.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

That fixed it!

Glad it helped! I'll include that launcher script (probably with minor tweaks) in future Rubble versions if you don't mind :) (with credit of course)

I was playing around on Linux a yesterday, and I came up with a "generic" browser script. Basically it uses `uname -o | grep -i "linux"` to see if it is on Linux, and if not assumes OSX. I have since learned that `uname -s` will print the kernel name, which would be more consistent ("Linux" on most Linux systems, "Darwin" on OSX, but I'll still use grep so it handles variations).

And yes, you do need to use "chmod +x" on both scripts for the Mac version.

Good to know, I'll include the bit about setting the permissions in the documentation. Do you need to set the actual binary executable? I assume you do, but you never know...

Using tar would preserve the permissions, if they were there in the first place... Since everything is cross-compiled from a Windows machine, file permissions are simply never set.

I think I may go ahead a write scripts that "install" the Linux and OSX versions by copying the binaries to the correct places and marking the scripts executable, less fuss and bother for everyone then, just change permissions on the "install" script and run.

Your work on getting OSX Rubble working has been invaluable, and will save future OSX users much time and trouble.
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

jecowa

  • Bay Watcher
    • View Profile

Glad it helped! I'll include that launcher script (probably with minor tweaks) in future Rubble versions if you don't mind :) (with credit of course)
Yeah, that's fine.

Do you need to set the actual binary executable? I assume you do, but you never know...
Yes, the "rubble" and "rubble32" binaries need execution permission or else it will say "Permission denied". Sorry, I should have mentioned that before.

I think I may go ahead a write scripts that "install" the Linux and OSX versions by copying the binaries to the correct places and marking the scripts executable, less fuss and bother for everyone then, just change permissions on the "install" script and run.
A lot of Mac users might be uncomfortable using the terminal. Instead of having users run CLI commands, maybe you could apply the permissions to the Mac and Linux installer scripts on your Linux machine and tar just those two install scripts? I'm guessing the installer scripts would rarely need to be updated.

I'll be glad to test the Mac install script.
Logged

milo christiansen

  • Bay Watcher
  • Something generic here
    • View Profile

Can't you change the permissions via a "properties" menu or some such? You can in most Linux DEs, and I can't see OSX missing such and obvious feature.
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

jecowa

  • Bay Watcher
    • View Profile

The Mac permissions section of the "Get Info" (properties) window is very basic. It only allows you to control which users can read and write to the file or folder. Apple probably didn't think that end users would need to know what an execution privilege is.

To add execution privileges in Macs:
  • Open the Terminal (/Applications/Utilities/Terminal.app)
  • In the Terminal window, type "chmod +x " (with that final space, but without the quotes)
  • Drag the file that you wish to have execution privileges into the Terminal window.
  • In the Terminal window, hit the "return" key.
Logged
Pages: 1 ... 8 9 [10] 11 12 ... 14