Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Castes are confusing...  (Read 1083 times)

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Castes are confusing...
« on: June 01, 2011, 04:49:00 pm »

So, I used to mod a bit in 40d. It was a lot simpler back then, obviously.
Anyways, I figured I'd try to find my way around castes by...being incredibly lazy. Noticing that sites could now be hidden, I came up with an idea for an entity that lives in hidden camps and is composed of the four major races. I started by working on the creature file, and basically just took the creature tokens from the [SELECT_CASTE:ALL] and anything before the caste section of the humans and elves, threw them into their own castes, and then had the HUMANBASIC and ELFBASIC castes target specific HUMAN_MALE/FEMALE and ELF_MALE/FEMALE castes.
I then tested to see if this was even viable by altering the PLAINS entity so that the FREE_PEOPLE would populate it instead of the HUMANS.
When genning a world, there simply was no PLAINS entity.

I imagine I'm doing a lot of things wrong, but could anyone point those things out for me? I have a lot of ideas I'd like to try out, but I need to understand things first.

Spoiler (click to show/hide)
Logged
Fame is a vapor. The only earthly certainty is oblivion.

Kweri

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #1 on: June 01, 2011, 05:00:34 pm »

First of all, did you check your errorlog to see if the game gave you any hints about something being wrong in your raws?

I don't think the caste/select caste tokens work the way you think they do. You have:
Code: [Select]
  [CASTE:HUMANBASIC]
   [SELECT_CASTE:HUMAN_MALE]
   [SELECT_ADDITIONAL_CASTE:HUMAN_FEMALE]

What this does is create a caste - HUMANBASIC. Anything after that will modify the HUMANBASIC caste... except that your next line chooses a NEW caste to modify. The second line says "Forget about HUMANBASIC, now we're going to talk about HUMAN_MALE caste." The third line adds HUMAN_FEMALE to the list of castes you're talking about, which is fine. However, I get the impression you wanted to nestle castes, as in HUMAN_MALE and HUMAN_FEMALE are part of HUMANBASIC, but you can't do that.

I am not sure about this, but SELECT_CASTE says it loads up a previously defined caste, and you don't define HUMAN_MALE and HUMAN_FEMALE until later in the file. May want to move those up to above that point.

You do a similar thing later with
Code: [Select]
[CASTE:ELFBASIC]
   [SELECT_CASTE:ELF_MALE]
   [SELECT_CASTE:ELF_FEMALE]
Same issues as above, but this time also note you used SELECT_CASTE twice instead of SELECT_CASTE and then SELECT_ADDITIONAL_CASTE.
Logged

Talanic

  • Bay Watcher
  • Struggling author / pizza delivery guy.
    • View Profile
Re: Castes are confusing...
« Reply #2 on: June 01, 2011, 05:06:57 pm »

Kweri's right.  What you probably want to do is:

[CASTE:HUMAN_MALE]
[MALE]
[CASTE:HUMAN_FEMALE]
[FEMALE]

[SELECT_CASTE:HUMAN_MALE]
          [SELECT_ADDITIONAL_CASTE:HUMAN_FEMALE]
[...stuff...]

Because right now, your caste called [HUMANBASIC] has no features to it whatsoever, and the HUMAN_MALE and HUMAN_FEMALE are used without actually being declared to exist.
Logged
I'm an aspiring Science Fiction and Fantasy writer.  I'm telling the tale of a hapless cyborg everyman lost in a savage fantasy world.

My first review from a real magazine!

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: Castes are confusing...
« Reply #3 on: June 01, 2011, 05:09:38 pm »

I did check the errorlog, there wasn't any information on the issue at hand.

Alright. I guess I got a little confused on how the SELECT_CASTE function worked. Thanks for that :D

and thanks on that spot with the Elf thing, too. I probably wouldn't have even noticed it until I tried to play a female elf adventurer from that civilization.
Logged
Fame is a vapor. The only earthly certainty is oblivion.

Kweri

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #4 on: June 01, 2011, 05:10:58 pm »

Also note that while setting up something like this works great for having varied creaturetypes in one civ (rather than the animalmen civs which only ever spawn one creaturetype chosen randomly per civ) it also means you can have two married elves having a human baby. There's no way to have them "breed true" at the moment. :(
Logged

3

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #5 on: June 01, 2011, 05:11:38 pm »

To expand on the above: anything you add to a creature before declaring castes is applied to all castes. This is a good reason to declare castes as late as possible (in general, the more different from each other the castes are, the earlier you'll have to declare them).

There's another tag (USE_CASTE) which copies an existing caste and makes an identical new caste based on it.
Logged

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: Castes are confusing...
« Reply #6 on: June 01, 2011, 05:19:33 pm »

To expand on the above: anything you add to a creature before declaring castes is applied to all castes. This is a good reason to declare castes as late as possible (in general, the more different from each other the castes are, the earlier you'll have to declare them).

There's another tag (USE_CASTE) which copies an existing caste and makes an identical new caste based on it.
I didn't know about that tag. I think maybe I'll try using that instead, because on this go-around the civilization still isn't spawning.
I also planned on going in later (after I got it to work as is) and moving anything that's the same in every caste up above the caste section so that they all had it without needing the declare the same thing over and over.

Also note that while setting up something like this works great for having varied creaturetypes in one civ (rather than the animalmen civs which only ever spawn one creaturetype chosen randomly per civ) it also means you can have two married elves having a human baby. There's no way to have them "breed true" at the moment. :(
I saw that in the wiki's modding section. I'm OK with that sort of thing happening, since right now I'm just trying to get a hang of what can and cannot go into a caste section.
Logged
Fame is a vapor. The only earthly certainty is oblivion.

Kweri

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #7 on: June 01, 2011, 05:26:20 pm »

Can you get your creatures to show up in arena mode? You should have double entries for humans and elves since the names are the same. If they're not showing up in arena mode, it's likely something wrong with the creature file and not the entity file.
Logged

Kweri

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #8 on: June 01, 2011, 05:30:00 pm »

Hmm, you have CAST_NAME tokens for the castes, but no normal NAME token for the creature itself. Try adding [NAME:free person:free people:free person] at the top, perhaps? Then in the arena mode, your humans/elves would show up in the alphabetical list in the "f" section, I believe, so it'd be easier to distinguish them from "real" humans and elves.
Logged

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: Castes are confusing...
« Reply #9 on: June 01, 2011, 05:31:48 pm »

Can you get your creatures to show up in arena mode? You should have double entries for humans and elves since the names are the same. If they're not showing up in arena mode, it's likely something wrong with the creature file and not the entity file.
I think I may have bitten off more than I can chew since I've been away from modding DF for about a year or two now, so I may just decide to set this project aside and start with something a little smaller. But I'll try this. Just a moment...

EDIT: There is only one instance of elf and human for both genders. There wasn't really any reason to think it was the entity to begin with, since all I did was replace a race in a pre-existing proven-to-work entity. My current theory is that there is currently nothing between [CREATURE:FREE_PEOPLE] and the CASTE tokens (aside from a NAME token now). I'm just not sure what it could be, if that is the case.
« Last Edit: June 01, 2011, 05:38:19 pm by thatkid »
Logged
Fame is a vapor. The only earthly certainty is oblivion.

Kweri

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #10 on: June 01, 2011, 06:53:08 pm »

I got them working. They show up after "fox" in the unit list in the arena. I did 3 main things -
1) Fixed the caste stuff and added name.
2) Fixed a problem in the two CASTE_SOLDIER_TILE tags - there was a space before the colons. Thanks, errorlog! Note that they worked fine in the arena even with this messed up - I just make a habit of checking the error log any time I'm testing something in the arena.
3) Added [OBJECT:CREATURE] under the creature_testing line. Oops. :-X Pretty sure this is what was causing issues even after adding the name.

Spoiler: Fixed free people! (click to show/hide)
Logged

thatkid

  • Bay Watcher
  • <Servibot> thatkid, swag percentiles: 94
    • View Profile
Re: Castes are confusing...
« Reply #11 on: June 01, 2011, 07:01:12 pm »

-SNIP- (Awesomeness and etc)

Thanks a lot!

I'm actually a little embarrassed that I forgot the [OBJECT:CREATURE] part, since I should have at least known enough to do that. Thanks again. I can't give you a high-five over the internet, but if I could I would.
Logged
Fame is a vapor. The only earthly certainty is oblivion.

Kweri

  • Bay Watcher
    • View Profile
Re: Castes are confusing...
« Reply #12 on: June 01, 2011, 07:13:29 pm »

I've forgotten it enough myself to know that it's the first thing I should check in the case of a problem... no idea how I missed it the first time around!
Logged