Bay 12 Games Forum

Please login or register.

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

Author Topic: Mod Base 0.95yy. Discontinued.  (Read 60899 times)

Shadowlord

  • Bay Watcher
    • View Profile
Re: Mod Base 0.91b. Cumulative modpack released, Martial mod updated.
« Reply #165 on: July 20, 2008, 09:53:44 am »

Edit:
Correction Finding and replacing '#' DOES work :D! Somehow I ended up with copies of the objects .txt files in /raw/graphics/objects and was looking at those to see if they had been changed by the mod manager, instead of the correct ones in /raw/objects... Oops. However, I do still wonder about this:

   New feature! - conditional entry overwriting/adding. The syntax is fairly incomprehensible, but to append a change to all entries of a certain type, you make an entry called [CREATURE:#] or some other type like ENTITY, etc. To specify which entries to use, [COND:] tags are used. Use [COND:<tagname>] to check for tag presence, [COND:<tagname>!] to check for absence. Use [COND:<tagname>@<argnumber>#<argvalue>] to check for a specific argument's value in a specific tag, or add an exclamation to the end to check for anything but that value in that tag.
Some other functions don't work with this, namely entry and possibly tag referencing. Value modification via arithmetics works.

creature_awfulman.txt has "[COND:BODY@1&QUADRUPED]" - & where that post says to use # - and I'm wondering which is correct? Do they both work, or was it changed from # because it's used for other things, or what? (& seems to work anyhow)

I'm intending to use this feature to change the font character of all the rock types which have a few particular characters. However, some of them use a number, some of them use a character... One of those characters which I want to replace is #. I had some difficulty at first, but that was my fault. It seems to be working now - Example of what I'm using it to do:

replacestuff.txt:
Code: [Select]
replacestuff

[OBJECT:MATGLOSS]

[MATGLOSS_STONE:#]
[COND:TILE@1&'#']
[TILE:158]

Changes all matgloss_stone entries whose tile is '#' to 158.


Also, I got this exception + stack trace once (but only once, it's worked fine the other 8 or so times) when I clicked the continue and reload button:
Spoiler (click to show/hide)

Edit: See the top of the post for a correction.
« Last Edit: July 20, 2008, 11:36:35 am by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Mod Base 0.91b. Cumulative modpack released, Martial mod updated.
« Reply #166 on: July 20, 2008, 02:01:30 pm »

Well, the exception is thrown by the moddown button. Which should not happen. Maybe some weird stuff is happening when the click from the modal "exit menu" gets past into the moddown button while the thing is reloading. I'll just disable those buttons when the mod compilation starts, and only reactivate them when the mods are reloaded.

BODY@1 in COND means the first parameter (the BODY itself being zeroth) in the BODY tag.
# means "exact match", while & means "inclusive match". I'm not exactly sure how it will react to [COND:TILE@1#'#'], but since you are unlikely to get any TILE tags with '#' as only a part, using & is perfectly allowable.
The reason it uses & in the "awfulman" mod, is because it must work on both standard DF and my Martial Mod - in the MA mod, standard body sets like HUMANOID and QUADRUPED are replaced by HUMANOID2 and QUADRUPED2 - so I need an inclusive match.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Shadowlord

  • Bay Watcher
    • View Profile
Re: Mod Base 0.91b. Cumulative modpack released, Martial mod updated.
« Reply #167 on: July 22, 2008, 12:35:19 am »

A couple feature requests:

Could it be possible in the future to include a user character set with a mod? (treating them just like other files that get checkboxes in the mod enable screen)

Also, could it also be possible to have files which specify to replace particular tiles of a user character set with an image? E.G. If I want to allow users to optionally replace the shrub graphic with a different graphic which makes live and dead shrubs look distinct, but only looks decent if the brown color has a bunch of red and little green (e.g. the user would probably only want to use it if they are using a particular color scheme or something).

P.S. Although you said there would be, there doesn't appear to be any source code in the package :P.

I already effectively have all the classes written for reading in bmps (which consists of delegating that responsibility to .net  ;)), splitting apart the images into tiles, possibly replacing some images, writing them back into a bmp, etc - these are all things the DF map compressor does - although the code is written in c# and requires .net 2.0. So compiling it with vb.net 2003 would be a bit unlikely to work. Also, I used generics. So it'd definitely require .net 2.0.

However I could perhaps repackage those classes to be public (instead of internal) accessible so that they can be used for this sort of thing, and release a dll containing them, and/or release their source. (Right now, you could add the map compressor as a reference and access public classes and members, but the ones that deal with bitmap splitting and stuff are internal instead of public - you can't use them from another assembly yet unless you use reflection to bypass the access restriction.)

(Let me know if you want that. At the moment, I'm working on a different DF-related project, which is a user character set + ModBase mod, and so it could use the two features I just asked about :P, particularly being able to include the user character set as part of the mod)
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Shadowlord

  • Bay Watcher
    • View Profile
Re: Mod Base 0.91b. Cumulative modpack released, Martial mod updated.
« Reply #168 on: July 22, 2008, 07:42:41 am »

I seem to be running into a bizarre problem.

At the moment, I'm trying to get ModBase to modify or replace certain words in language files. It looked like it would be easy:
Quote
filename was here

[OBJECT:LANGUAGE]

[trANSLATION:DWARF]
    [T_WORD:APPLE:bemong]
    [T_WORD:AWE-INSPIRING:gostang]
    [T_WORD:BITCH:shimbil]
etc

But I ended up with language_dwarf.txt being filled with [T_WORD:BULWARK:rithzam] (which is the last entry in the ModBase mod's language replace file).

So then I tried
Quote
[COND:T_WORD@1#APPLE][T_WORD:APPLE:bemong]
[COND:T_WORD@1#AWE-INSPIRING][T_WORD:AWE-INSPIRING:gostang]
[COND:T_WORD@1#BITCH][T_WORD:BITCH:shimbil]

But that did exactly the same thing. Does it think every T_WORD in language_dwarf is part of the same word, instead of each being their own word, or what?
« Last Edit: July 22, 2008, 08:25:46 am by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Mod Base 0.91b. Cumulative modpack released, Martial mod updated.
« Reply #169 on: July 22, 2008, 10:31:44 am »

Hmm. I'll have to look into that. I might have overlooked the T_WORD when making the multi tag list. Each T_WORD in a TRANSLATION entry is a tag. The thing is that if the tag is not a multi tag, the parser will go through any tags of matching type (the first element of a tag) and replace it with the source tag. As per your description, this is exactly what's happening, since it goes through all tags in sequence and in the end, replaces everything with the last tag.

I'll make a fix for it, but I won't release until I've at least got it to mod language files.

As for the requests - it's possible to do this in a rather non-flexible way. Specifically, the MSECT entry in the mod descriptor can be made to accept more tags. Right now it only knows FILE. It can be made to understand TILESET. Actually, that's what I'm doing now to have it understand speech files. For the other request, it might be possible, I just haven't fiddled around with that stuff yet. But if I remember right, there are some functions for image editing, and I could make use of those.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Mod Base 0.91b. Cumulative modpack released, Martial mod updated.
« Reply #170 on: July 22, 2008, 02:43:47 pm »

Alright, I did overlook the T_WORD when making the list. Fixed now.
I did preliminary testing of the tileset merger - seems to work fine. You need to provide a "true blue" - 0-0-255 - background for whatever tiles you don't want overwritten. The prog looks through the top left pixel of each tile - if it's not blue, it copies the tile over from your image to the target tileset (no true masking - it will copy the blue in the tile). The file you specify has to be the same name as the one you edit - I found no way to do otherwise without adding more description files. The program will not overwrite the existing tileset though, it will instead create a new one with a "mod_" added to the filename, and automatically set it as the Windowed mode tileset.
Of course, the tileset adding part of the thing also works. I'll now test the speech files some more, and look again for any obvious bugs, and probably release. I'll update the MCM with the new mod placement standart, too. Also, Modbase distribution will no longer house mods, only the program itself, and the source.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile

Bump't. Added some new tags to the mod files, and shoved most of the program's data into a separate folder. I'll do that a few more times, I think, until I reach an acceptable state of it.

Keep in mind, mods are no longer bundled with the 'base!
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile

Moved the download links for Modbase and MCM to the top of the first post.

Any comments yet?
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Shadowlord

  • Bay Watcher
    • View Profile

I'm getting an an exception upon clicking the scan mods button when my mod is in the modbase folder along with only the 'original' and 'testmod' mods, or when there's only a couple other mods (some seem to still trigger it, some don't). (Mine's named 'sl_tilemod')

It's occurring inside Form1's LoadFilesToList. I loaded the source up and ran it through visual basic 2005 express edition's debugger and:

It's occurring in this line (line 576 of Form1.vb): mods(CInt(md.args(2))).order = mods(x).order
md.args(2) is "4". mods.Length is NOT 4 or higher... It's trying to set mods(4).order when mods.Length is below 4! It seems to be reading md (from modcfg) from a config file which remembers mods that I've removed the .txt files for, and is presumably remembering the former position of my mod in the list of mods, or something like that, and trying to force it into it again.

Haven't had a chance to try any of the new stuff yet, or test the t_word fix, since this problem cropped up. :P

Edit: Fixed it for you (I've included some of the code around it in this snippet) - this gets rid of the crashing anyhow. I don't know if it's what you'd prefer it to do. :P
Code: [Select]
                                If md.args(1) = mods(x).name Then
                                    Dim pos As Integer
                                    pos = CInt(md.args(2))
                                    If pos >= 0 And pos < mods.Length Then
                                        mods(pos).order = mods(x).order
                                        mods(x).order = CInt(md.args(2))
                                        mods(x).active = CBool(md.args(3))
                                        For t As Integer = 4 To md.args.Length - 1 Step 2
                                            mods(x).setmodulestate(md.args(t), CBool(md.args(t + 1)))
                                        Next
                                        sortModsByOrder()
                                    End If
                                End If

How is the sorting *supposed* to work? It doesn't look alphabetical, or is that because I just screwed it up and the screwed up version borked the normal version too? (I just loaded the non-fixed version to check and see if it was sorted alphabetically with all the mods in the list, and it wasn't)

Edit again:
Okay, on T_WORD, I can't seem to get it to do what I want: replace, or remove and recreate, words in each language - I'm removing some accent marks. Here's some things I've tried (using FOO and bar as examples, though I used the actual dwarf language files instead - I just don't want to mess with accent marks here):

I've tried just specifying [T_WORD:BULWARK:rithzam] etc. That makes a new word and leaves the old one.
I've tried putting [!REPLACE] before the [T_WORD:FOO:bar], and after, and in both cases it had no effect.
I've tried [COND:T_WORD@1#FOO][T_WORD:FOO:bar], but that still only makes a new word and leaves the old one.
I've tried [T_WORD:FOO:#][!DEL!][T_WORD:FOO:bar]. That adds a verbatim [T_WORD:FOO:#] entry in addition to the [T_WORD:FOO:bar] entry, and still leaves the original accent-marked version T_WORD version of FOO.
Finally I tried [T_WORD:FOO][!DEL!][T_WORD:FOO:bar] and that resulted in: [T_WORD:FOO:bar] [T_WORD:FOO] along with the original accented version of [T_WORD:FOO:bar] still being in the file.

Edit again:
About the tileset var:
I can't say I like ModBase deleting all the comments from init.txt, and not backing it up, or warning it was going to do that D: (I use winmerge to migrate my init.txt changes to new versions of DF, and having the comments missing would be a nuisance)
Also, ModBase's new tileset var doesn't appear to work with graphical mode - it's not changing the graphical mode tileset, only the non-graphical one.

Otherwise, looks cool!
« Last Edit: July 23, 2008, 09:16:57 am by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile

Yeah, graphics mode tilesets are another thing. I'll add that, since I don't think it will hurt.

I presume you changed "CInt(md.args(2))" to "pos", but that variable gets the same value assigned right before. I did copypaste that, probably, but I see no reason for one to work while another crashes. The sorting is not alphabetical, it follows the order in which the mods are loaded. When mods are loaded, the subroutine that throws you the error goes through each mod and each entry in the modbase.cfg, performing an operation similar to swapping channels on an auto-tuned TV. If it does not find a mod in the config, it will not touch it. Likewise, if a mod is in the config but not in your folder, nothing will happen.

T_WORDs are tags. If you want to replace multi-tags, the only sure way is deleting those you want deleted, and adding the changed ones. Basically, the only way right now is add [T_WORD:FOO:!] for every word you want edited, and add your own entries.
If all you want to do is replace accent marks, try something akin to this:

[trANSLATION:#]
[COND:<whatever can be used to identify the language you want>]
[T_WORD:#:<accent-marked letter>!!<normal letter>] - repeat for every accent mark

I'm not sure HOW this will work, but it might.

For init - I don't really know how to handle comments in parsed files. I do warn to create a copy of the init in the readme, though. And you can use Modbase itself to carry over init settings.
« Last Edit: July 23, 2008, 11:00:37 am by Sean Mirrsen »
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile

Hm. A bit of personal impression. All I did for this version was copy over the 3 files, and the modbase dir from my current version to the new version. Then I deleted the "original" dir, just in case, and ran Modbase. The entire setup took me...  let's see.. 1, 2, 3, 4, 5, 6, 7. Seven clicks, plus one to close the program. :) Version changing has never been easier.
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Shadowlord

  • Bay Watcher
    • View Profile

I presume you changed "CInt(md.args(2))" to "pos", but that variable gets the same value assigned right before. I did copypaste that, probably, but I see no reason for one to work while another crashes.

It doesn't crash because I added this check: If pos >= 0 And pos < mods.Length Then

The statement which attempts to write to mods(pos).order (along with the other statements after it, although they likely didn't need to be), got put inside that if/then/endif. So, it doesn't crash because if it's out of bounds it doesn't get run.

Okay, I'll try [T_WORD:FOO:!]. I thought they were entries instead of tags, but hadn't noticed the bit in the readme about deleting tags yet either.

And done: It worked! :D

What does !! do? Search and replace inside the current tag? Let's try that now...
Hmm, that doesn't seem to want to work, or I'm doing something wrong.
Spoiler (click to show/hide)

I tried without [OBJECT:LANGUAGE] as well. If it were working, it would be acting on [T_WORD:ACT:ar¢], I think. (It isn't)

(Not that I need that now, since the other method is working and I already generated all the fixed word lists and such :P)

On comments in init.txt: Anything that isn't inside a [] block is a comment, so you can just read those in when you're not in an [ block, store them when you reach a [ or the end, and spit them back out when you write out the file. I can't say for raws, since I don't know what format comments are supposed to be in for them (or if they're even allowed).

Did you notice the new options in init.txt? That's why I use winmerge to move my init.txt settings to new versions. ;)

Edit: Here's a nice one, click a mod to get its list of components open, then hit Scan, notice that it doesn't close the list or anything, and then try to check or uncheck one of them. CRASH BANG.
« Last Edit: July 23, 2008, 11:42:34 am by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile

Modbase cares not about new options in init. Unless those options have unique placement rules, they're all the same to it, and any changes you do will be added, like to any other entry.

And in your example, the cause is the LANGUAGE condition. There's no language tag in the TRANSLATION entry. You could check for the TRANSLATION itself though.

edit: tried the setup myself. It doesn't seem to work, but it might be me messing something up when copying your text. It still causes multiple tags though... I need to find a way to fix that.
« Last Edit: July 23, 2008, 11:55:30 am by Sean Mirrsen »
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Shadowlord

  • Bay Watcher
    • View Profile

Whoops at that. *changes it to [COND:TRANSLATION@1#ELF]*

*tries it again*

What the...

Spoiler (click to show/hide)
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive

Shadowlord

  • Bay Watcher
    • View Profile

Yeah, graphics mode tilesets are another thing. I'll add that, since I don't think it will hurt.

In case we weren't talking about the same thing, what I meant was that I have [GRAPHICS:YES] in my init.txt, and when I tested Modbase's tileset feature, it only changed FONT, not GRAPHICS_FONT, so it did not appear to work.

(The actual mob graphics stuff is all well and good too, of course... :P)

P.S. Here's a better fix for the crash I mentioned and fixed before:
Code: [Select]
                                if md.args(1) = mods(x).name Then
                                    Dim pos As Integer
                                    pos = CInt(md.args(2))
                                    If pos >= 0 And pos < mods.Length Then
                                        mods(pos).order = mods(x).order
                                        mods(x).order = pos
                                    End If
                                    mods(x).active = CBool(md.args(3))
                                    For t As Integer = 4 To md.args.Length - 1 Step 2
                                        mods(x).setmodulestate(md.args(t), CBool(md.args(t + 1)))
                                    Next
                                    sortModsByOrder()
                                End If

Now it remembers whether the mod (if its saved list position # or whatever was >= the number of mods now) was active and what components of it were enabled still, whereas my quick fix didn't. It just stops it from trying to swap position with a nonexistant mod now. (I had just woken up an hour or so earlier when I did the first fix. :P)
« Last Edit: July 23, 2008, 07:30:39 pm by Shadowlord »
Logged
<Dakkan> There are human laws, and then there are laws of physics. I don't bike in the city because of the second.
Dwarf Fortress Map Archive
Pages: 1 ... 10 11 [12] 13 14 ... 21