Bay 12 Games Forum

Please login or register.

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

Author Topic: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)  (Read 10707 times)

Exponent

  • Bay Watcher
    • View Profile

With my next release, using the raw functions, you will be able to mess around with the 4-bit matgloss field and 4-bit biome field that exist in the 32-bit designation field.  But I'm not entirely sure precisely how those work (there was some talk of it in the 3Dwarf Beautification thread that I'll likely check out later), so I'm not bothering to do much with them.  I might add in a few functions to make it easier to read/write these fields, though.  Still no promise what changing them will do, however.
Logged

Exponent

  • Bay Watcher
    • View Profile

New version (0.6 Beta):  DFFD Download.  I'll say more later.  Roommates are watching Star Trek: TNG right now, so I can't concentrate at the moment.   :)

Okay, here's the change log:

  • added bodily fluid functions (blood, pus, ichor, goo, slime) in the Occupancy categories, along with related constants in the Constants category
  • renamed is_vomit to has_vomit, and moved it and set_vomit to the Occupancy categories
  • renamed is_snow_covered to has_snow, and set_snow_covered to set_snow, and moved them to the Occupancy categories
  • added support for the string type, including a to_string function and the concatenation operator (+)
  • added print and print_line functions for writing to the output panel
  • added the is_allocated function
  • added a new Experimental category, including functions for reading/writing type, matgloss id, and biome id
  • provided a variation for most query functions to accept specific x, y, z coordinates, instaed of just defaulting to the current tile's x, y, z coordinates
  • fixed various bugs with the functions in the Raw category, and added mask_and_set_ versions of each
  • various small improvements to the interface
  • updated viewport calculation code to properly handle changes in the latest DF version (0.28.181.40a)
« Last Edit: August 18, 2008, 10:42:15 pm by Exponent »
Logged

Ter13

  • Bay Watcher
  • Oh wait... Dwarves like food, don't they?
    • View Profile

=D You took my debug message suggestions, I see!

You are officially my hero, but you are going to be sharing the spotlight with Winston Churchill, Andre Lamothe, George Carlin, and the Quaker Oats guy...
Logged
Murderhold - A story about a fortress closed off from the world, attempting to survive a zombie-infested wilderness.
Murderhold Discussion thread

Goran

  • Bay Watcher
    • View Profile

Any chance to add a function to turn constructions into smoothed rock? Would be fun to engrave stuff you build.
Logged

Exponent

  • Bay Watcher
    • View Profile

Any chance to add a function to turn constructions into smoothed rock? Would be fun to engrave stuff you build.

I found a way to do it given what is already available, though it's ugly.  I might add this as an actual function or set of functions, though it definitely belongs in the experimental category, since it probably doesn't leave the memory looking exactly like the game would expect it to be, but it appears to be good enough to fool it.

Condition:
Code: [Select]
is_constructed
Operations:
Code: [Select]
choose(get_raw_type = 493, set_raw_type(43), nop);
choose(get_raw_type = 495, set_raw_type(79), nop);
choose(get_raw_type >= 496 and get_raw_type <= 514, set_raw_type(get_raw_type - 189), nop);

The first operation changes constructed floors to detailed stone floors.  The second like works on pillars.  And the third line works on all the different directions of walls.

You can add additional checks to the condition (in_viewport, z >= cursor_z, et cetera) if you want to limit what stuff gets changed.
Logged

Spelguru

  • Bay Watcher
  • Rabid Swedish Person
    • View Profile

A few questions:
How can one check the raw type of a tile?
Say I want to create rough obsidian walls/floors, how to check the type and material? There is "get_raw_type" and "get_matgloss_id" but how does one see the output?

*Edit* Using the Dtil utilities Tile Editor is great for finding matgloss and type. For the record: rough wall is 219 :)
*Edit2* 'Xept it only returns a 4 on different stone types, which I think means just the generic stone material, not the specific type. Hmmmm, gonna test something. ... Had to change biome to change slate to obsidian :/
« Last Edit: August 21, 2008, 10:34:56 am by Spelguru »
Logged
Got Ninja?
Orkz Orkz Orkz Orkz, Orkz Orkz Orkz Orkz... WAAAAAGH!
NHP (Non human pact. Copy and paste if you are going to destroy all human-like creatures in spore.)

Jorgon

  • Bay Watcher
    • View Profile
    • http://wiki.shiware.com

This is what I have found out so far.. This is still a mostly guess until I can look at it more.

I believe that there is a vector of materials valid for a tile, and the matgloss is the index into that vector. A tile could be changed to any that exists in that list, but not anything other than that. If you open up SDK Properties, and look at the Materials field, you can see all available materials, and that a tile's matgloss doesn't correlate. (Unless I am mis-remembering)

Edit:
BTW Exponent, I haven't actually run this myself yet, but I love the idea.
« Last Edit: August 21, 2008, 01:00:01 pm by Jorgon »
Logged

Heavy Flak

  • Bay Watcher
  • Olsmo Lives
    • View Profile
Re: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)
« Reply #52 on: September 14, 2008, 06:18:30 pm »

I've found an odd little bug... though, I'm not sure if that's the proper thing to call that.

If you create magma at a specific location, just, you know, a 7/7 splatter of magma, it just hangs out there without spreading out.  That's fine, but what isn't, is that the magma doesn't seem to burn rocks / items.  Living creatures it melts just fine, but any object that's just sitting there just seems to ... hang out in the magma.

Heh, any clue what might be going on? 
Logged

Exponent

  • Bay Watcher
    • View Profile
Re: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)
« Reply #53 on: September 14, 2008, 08:02:20 pm »

Not really.  I don't have much experience with magma and fires and such in normal gameplay either, so I probably wouldn't be the best to speculate on what is happening within the game.  You could possibly try setting the temperatures at the same time that you set the magma level.  (There are two temperature fields, but I don't know the difference between them, so I'd recommend setting them both to the same value at the same time.  set_temperature(), without the _1 or _2 prefix, should do just that automatically.)  Since the operations box can hold multiple operations separated by semicolons, you can simply do:

set_magma_level(7);
set_temperature(12000);

Pick whatever number seems appropriate.  I just grabbed the temperature for a magma man from the wiki, as I don't know offhand the normal temperature of magma.  If you want to find out that temperature, you can just do an at_cursor condition with the operation print_line(to_string(get_temperature_1)); and execute that operation set with your cursor over a chunk of natural magma.
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)
« Reply #54 on: September 14, 2008, 10:18:08 pm »

I just grabbed the temperature for a magma man from the wiki, as I don't know offhand the normal temperature of magma.

2500 or 3500 IIRC.

Close
Quote
According to the raw data files, magma's temperature is somewhere between 1300°C and 1400°C, which translates to 2300°F–2500°F .
Logged

Heavy Flak

  • Bay Watcher
  • Olsmo Lives
    • View Profile
Re: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)
« Reply #55 on: September 15, 2008, 08:09:41 pm »

Thanks for the quick replay, Exponent.  I've got to say, the speed with which you handle bugs, respond to questions, and keep this utility updated is amazing.

I tried your suggestion.  Setting temperature isn't actually needed, as the magma automatically sets the surrounding area to be temp 120000, but even if you do that, it doesn't seem to trigger the magma, if that makes sense.  I've found you can get magma to actually work as a flow if you designate the area you want to be water first, let it move a couple ticks of time, then doing a set_liquid_type_to_magma. 

Even if you do that, though, rocks will turn molten but never seem to vanish... so, my work around has been to set the boiling point to something low and watch the rocks vaporize. 
Logged

Draco18s

  • Bay Watcher
    • View Profile
Re: Exponent's For Each Tile - A Flexible Map Alteration Tool (v0.6 beta release)
« Reply #56 on: September 15, 2008, 11:27:30 pm »

Setting temperature isn't actually needed, as the magma automatically sets the surrounding area to be temp 120000, but even if you do that, it doesn't seem to trigger the magma, if that makes sense.  I've found you can get magma to actually work as a flow if you designate the area you want to be water first, let it move a couple ticks of time, then doing a set_liquid_type_to_magma.

Has to do with the flow [STATIC] flags, I think.
Logged

Cheshire Cat

  • Bay Watcher
  • You Have Struck Turtle Shell!
    • View Profile

hey there everyone

exponent, i must confess i worship your for each tile utility. i love exploring things in adventure mode, and your utility makes it much easier to quickly create huge and interesting places to pillage. or in my serious fortresses on the very rare occasion when i accidentally flood my whole fort with magma and want to wall it up really fast.

unfortunately i cant get it going in 49d.

i tried sticking the stuff from the wikipedia article in the core.general xml file in tweak. it just stops tile edit and adjust start, and for each tile gives the same error message regardless. if im doing something wrong please fill me in.

when i try running it from tweak, it tells me tweak threw and exception. here is the full enormous set of text it also vomits out.

Spoiler (click to show/hide)

anyways, hope your still reading this thread and can help me out. and yes, i have got .net runtime 3.5.

Logged

Exponent

  • Bay Watcher
    • View Profile

Hmm, after looking at the project (which I haven't looked at since August or whatever, and thus unfortunately do not remember the details of very well), and looking at the error, my best guess is that I had added the use of HashSet<T> in one of the later versions, which uses System.Core.dll.  And System.Core.dll isn't listed in the error's list of loaded assemblies, but is listed as the missing file (minus the .dll extension, which I suppose is implicit).  If you're somehow missing that file (which I believe was added with .NET 3.5 or something), then you'd probably get that error.  ExpressionParser.ParseIdentifiers() is indeed where the HashSet<T> class is probably first used, and the function doesn't do much else.  I don't know how you could have .NET 3.5 without having that file, but that certainly seems to be the most likely cause of the error at the moment.  My file is located in C:\Windows\Assembly.  Check that folder and see if it is in there, and is listed as version 3.5.0.0.
Logged

Sinergistic

  • Bay Watcher
    • View Profile

I have a question: Is it possible to un-mine and un-reveal a tile using this? For example, I wish to 'fill in' various gem cutouts that I have mined along a pathway. Normally, I would do this with walls, but that "looks funny".

If I could somewhat get the tile to revert to an unmined/unrevealed state (I.E. Black) that would be awesome and would make my OCD so very, very happy.
Logged
Pages: 1 2 3 [4] 5 6