Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Attribute tag rules file format  (Read 916 times)

mizipzor

  • Bay Watcher
    • View Profile
    • Blog
Attribute tag rules file format
« on: August 29, 2008, 10:09:52 am »

Im working on a python script that parse all found creature files to find the creature tags and checks what parameters they have. That part is almost done, now I want to export the rules to a file to be used later to validate created creatures.

Im a bit unsure as to how to make the file format. There are no other attribute parameter types other than digit and string, right?

But what about the digits? Are they all in the same range, 0-255?

If both the above the statements are true, which would be perfect, then I think I would do something like this:

[NAME:a:a:a]

For indicating that the NAME attribute takes three parameters (at least I think it does, was a bit long ago I actually checked the files myself), all alpha/characters.

Any comments? Just wanted to bounce some thoughts.  ;D
Logged

Untelligent

  • Bay Watcher
  • I eat flesh!
    • View Profile
Re: Attribute tag rules file format
« Reply #1 on: August 29, 2008, 11:13:31 am »

Some of the digits are quite a bit larger than that, and the temperature-related digits are over 10000.

I remember the maximum temperature was somewhere above 60000, so the absolute maximum digit range would be 0-65535. Actually, I think it would be more than that; it's possible for some parameters, like the damblock (I think. I could be wrong about that.) to go into negatives, although I don't think there's any in the vanilla raws.
« Last Edit: August 29, 2008, 11:17:49 am by Untelligent »
Logged
The World Without Knifebear — A much safer world indeed.
regardless, the slime shooter will be completed, come hell or high water, which are both entirely plausible setbacks at this point.

Baneslave

  • Bay Watcher
  • Claymore Thrower Dwarf
    • View Profile
Re: Attribute tag rules file format
« Reply #2 on: August 29, 2008, 11:19:42 am »

...like the damblock (I think. I could be wrong about that.) to go into negatives, although I don't think there's any in the vanilla raws.

Actually, vanilla elves have damblock -1.
Logged
[BUTCHERABLE_SIGNATURE]

mizipzor

  • Bay Watcher
    • View Profile
    • Blog
Re: Attribute tag rules file format
« Reply #3 on: August 29, 2008, 11:34:09 am »

Hmm, it seems indeed that the digit parameters vary between unsigned int and a signed int. Thats bad, since you cant tell which one it is by just looking at the file (assuming its inside the 0-32767 range). Do you think there is any point to try to really build a database on what tokens there is and how they work? I mean on the technical side, not the effect of the token, like what the numbers range is.

Maybe thats already in the wiki in the token section, ill dig around some. Thanks for the comments by the way. :)
Logged

i2amroy

  • Bay Watcher
  • Cats, ruling the world one dwarf at a time
    • View Profile
Re: Attribute tag rules file format
« Reply #4 on: August 29, 2008, 07:44:57 pm »

so the absolute maximum digit range would be 0-65535. Actually, I think it would be more than that; it's possible for some parameters, like the damblock (I think. I could be wrong about that.) to go into negatives, although I don't think there's any in the vanilla raws.
You can technically set the damblock token to any number you want, one time for fun I gave a creature a damblock of over a million.
Logged
Quote from: PTTG
It would be brutally difficult and probably won't work. In other words, it's absolutely dwarven!
Cataclysm: Dark Days Ahead - A fun zombie survival rougelike that I'm dev-ing for.

mizipzor

  • Bay Watcher
    • View Profile
    • Blog
Re: Attribute tag rules file format
« Reply #5 on: August 30, 2008, 03:07:21 pm »

Im currently leaning to this:

<rule>
   TOKEN_NAME
   <str/>
   <byte/>
   <long/>
</rule>

Xml for the rule database file. This in turn implies, when parsed, that the token TOKEN_NAME needs three parameters, a string, a byte (0-255) and a long (like, a huge number).

How many tool coders are we in here? I would like to put something together that we all can use. If Im the first trying to do this or if no one else has any more comments/suggestions I just rampage on ahead!  ;D

edit: Just had a quick chat with TheSpaceMan. He reminded me that the body and attack doesnt have a fixed number of parameters. And the spontaneous response to the problem was to add a <unbound> tag to the rule. If it is present, the above parameters would be repeated over and over. I.e no "number of parameters" check, just type check.

For example, attack:
<rule>
   ATTACK
   <str/>
   <int/>
   <unbound/>
</rule>

Since I have so little experience in actual modding myself, I will probably do quite a few of these kind of mistakes, hehe.  ::)
« Last Edit: August 30, 2008, 03:22:19 pm by mizipzor »
Logged