Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: A couple questions about tags needed for a fountain  (Read 939 times)

Dramegno

  • Bay Watcher
  • Gobo the other white meat
    • View Profile
A couple questions about tags needed for a fountain
« on: May 25, 2015, 12:19:07 am »

yes, does anyone know how I can duplicate the water wheel's needing to have water to activate i.e. the equivalent to [NEEDS_WATER] unless that tag actually exists.

and finally is their a way I can get a building to generate mist like a waterfall?

Can these thing happen currently in dwarf fortress either with or without using scripts (if scripts post a link for a primer)
« Last Edit: May 25, 2015, 12:21:45 am by Dramegno »
Logged
So, it's AnimaRytak, mighty Void God, versus the greatest cluster[FOWL] my incompetence can engineer.

I will be so god damn proud if AMBASSADOR bites your head off.

Usul

  • Bay Watcher
    • View Profile
Re: A couple questions about tags needed for a fountain
« Reply #1 on: May 25, 2015, 05:46:53 am »

I know a script to check water around a workshop existed at some point, but I couldn't find it.
Generating mist can be done using the spawn-flow script in your DF/hack/script/modtools (assuming you already have DF-hack).
Logged

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: A couple questions about tags needed for a fountain
« Reply #2 on: May 25, 2015, 05:51:08 am »

Check Masterwork 6.2 for 34.11, the hermit has a building called "handpump". It only works if it's build next to water and every time a reaction is used, it uses up 1 unit of water nearby. Maybe that's of use.

If you want a proper fountain:
Quote
<DFHOME>\hack\scripts\tap.rb
Code: [Select]
$fountains ||= []

cur_source = {
:liquid => 'water',
:amount => 7,
:life => 7,
:pos => [0,0,1]
}
cmd = 'help'
axis = 0
found = false
$script_args.each { |a|
case a.downcase
when 'water', 'magma'
cur_source[:liquid] = a.downcase
when /^r-?\d+.*$/
cur_source[:life] = a[/^r(-?\d+)/, 1].to_i
when /^\d+$/
cur_source[:pos][axis] += a.to_i
axis += 1
found = true
when /^z-?\d+.*$/
cur_source[:pos][2] += a[/^z(-?\d+)/, 1].to_i
when /^y-?\d+.*$/
cur_source[:pos][1] += a[/^y(-?\d+)/, 1].to_i
when /^x-?\d+.*$/
cur_source[:pos][0] += a[/^x(-?\d+)/, 1].to_i
else
puts "source: unhandled argument #{a}"
end
}
if (!found)
cur_source[:pos][0] += df.df_cursor.x
cur_source[:pos][1] += df.df_cursor.y
cur_source[:pos][2] += df.df_cursor.z
end

def fount(s)
if tile = df.map_tile_at(*s[:pos]) and tile.shape_passableflow and tile.shape_basic==:Open
# XXX does not check current liquid_type
des = tile.designation
cur = des.flow_size
if cur != 7
tile.spawn_liquid(cur+1, s[:liquid] == 'magma')
else
fount({
:pos=>[s[:pos][0],s[:pos][1],s[:pos][2]+1],
:liquid=>s[:liquid]
})
end
end
end

$fountains_onupdate ||= df.onupdate_register('fountains', 6) {
# called every 6 game ticks (100x a dwarf day)
$fountains.each { |s|
fount(s)
if s[:life] > 0
s[:life] -= 1
end
if s[:life] == 0
$fountains.delete(s)
end
}
if $fountains.empty?
df.onupdate_unregister($fountains_onupdate)
$fountains_onupdate = nil
end
}

if cur_source[:pos][0] >= 0
if tile = df.map_tile_at(*cur_source[:pos])
if tile.shape_passableflow
$fountains << cur_source
else
puts "Impassable tile: I'm afraid I can't do that, Dave"
end
else
puts "Unallocated map block - build something here first"
end
else
puts "Please put the game cursor where you want a source"
end

onload.init:
Code: [Select]
tap MAGMA_TAP
Quote
You create a 3X3 workshop, named (in the raws) MAGMA_TAP.  If you have built it where one side is empty and the opposing side is next to a wall containing a blood of armok (just the middle square on each side) it creates a permanent, uncontrolled flow of magma on the side across from the gem. The only way to turn it off is to mine the blood gem away or destroy the workshop.

All done by arbarbonif
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Dramegno

  • Bay Watcher
  • Gobo the other white meat
    • View Profile
Re: A couple questions about tags needed for a fountain
« Reply #3 on: May 25, 2015, 03:31:52 pm »

okay I think I did something wrong or was I supposed to edit the script?
I got the fountain built but nothing, I built it on the other side of a tear of Armok but it didn't spew anything.

Also by reading what appears to happen it might not be what I have originally intended. what I want to build is basically a mist generator that also functions like a well of sorts
« Last Edit: May 25, 2015, 03:34:10 pm by Dramegno »
Logged
So, it's AnimaRytak, mighty Void God, versus the greatest cluster[FOWL] my incompetence can engineer.

I will be so god damn proud if AMBASSADOR bites your head off.

smakemupagus

  • Bay Watcher
  • [CANOPENDOORS]
    • View Profile
Re: A couple questions about tags needed for a fountain
« Reply #4 on: May 26, 2015, 12:20:11 am »

Meph was sharing relevant code that might be a starting point for you, not a finished solution that does exactly what you want.

Meph

  • Bay Watcher
    • View Profile
    • worldbicyclist
Re: A couple questions about tags needed for a fountain
« Reply #5 on: May 26, 2015, 01:33:20 am »

These are raws that arbarbonif send to me, I have not used them yet. Feel free to talk to him. :)
Logged
::: ☼Meph Tileset☼☼Map Tileset☼- 32x graphic sets with TWBT :::
::: ☼MASTERWORK DF☼ - A comprehensive mod pack now on Patreon - 250.000+ downloads and counting :::
::: WorldBicyclist.com - Follow my bike tours around the world - 148 countries visited :::

Dramegno

  • Bay Watcher
  • Gobo the other white meat
    • View Profile
Re: A couple questions about tags needed for a fountain
« Reply #6 on: May 26, 2015, 09:34:02 am »

okay I just wanted to make sure that I didn't ... mess it up.  Is there a beginners guide to ruby dwarf fortress scripting cause I can find a bunch for basic ruby stuff cause that would help me out a bunch.  but if I have to tear apart the scripts in the df-hack folder to get an idea how to do get it working, then i will but it might get messy but then again that is how I learned actionscript 2.0 in flash...
Logged
So, it's AnimaRytak, mighty Void God, versus the greatest cluster[FOWL] my incompetence can engineer.

I will be so god damn proud if AMBASSADOR bites your head off.