Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identify fields related to adventurer creation #190

Merged
merged 2 commits into from May 20, 2017

Conversation

dscorbett
Copy link
Contributor

No description provided.

<enum base-type='int16_t' name='status'>
<enum-item name='Peasant'/>
<enum-item name='Hero'/>
<enum-item name='Demigod'/>
</enum>

<int32_t name='unk_v40_1a' init-value='-1' since='v0.40.01'/>
<enum name='background_type' base-type='int32_t' since='v0.40.01'>
<enum-item name='Peasant' value='-1'/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this compile? There's a Peasant in the status enum above too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t know if it compiles: I haven’t got everything set up for compiling on Windows so I make these pull requests blind. It’s worked so far. I would not expect the duplication to be a problem: the two enums in question have different types (viewscreen_setupadventurest.T_adventurer.T_status and viewscreen_setupadventurest.T_adventurer.T_background_type) and different enums may have values with the same name.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't work because they're in the same class and C++ is annoying when it comes to this (I vaguely remember running into this myself in viewscreen_titlest).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does PeasantBackground sound okay for this one, or do you have a better suggestion?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather keep the current name to match the other field called background_type on line 1837. Would it work to define this enum as an enum-type outside this class-type definition?

Copy link
Member

@lethosor lethosor May 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be fine, although it's annoying that they don't have the same values for Peasant, so the enum can't be reused.

Also, where are you seeing this one changing? On the "create your character" screen (page==7, or Background), and the next screen, it's always -1 for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see it when page == 7. Pressing + or - swaps between 0 and -1, except for human outsiders, which always get -1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And two seconds after I posted that last comment, I found a case where it swaps between 8 and -1. I’ll have to look into this more.

Copy link
Member

@lethosor lethosor May 18, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I'm only seeing it change for humans (dwarves always give -1, and elves are missing that menu entirely). Perhaps it's something world-specific?

Edit: I wasn't seeing your last comment somehow, sorry.

@lethosor
Copy link
Member

Nice! Glad to know the viewscreen fields were mostly the right types.

@lethosor lethosor self-assigned this May 17, 2017
In the "Create Your Character" screen of adventurer creation, you can
choose "Locally Important" or "Peasant". "Locally Important" means the
chosen site has a captain of the guard position (or equivalent).
`commander_id` is the index of the position assignment of the captain of
the guard for the site's group. If position is vacant, the "Locally
Important" option is available, but the adventurer is still a peasant
and `commander_id` is -1.
@dscorbett
Copy link
Contributor Author

I discovered the true meaning of unk_v40_1a: it is not an enum value but an index.

@lethosor
Copy link
Member

Makes sense. Thanks!

<pointer name='unk_15_b'/>
<int16_t name='color_gene_count'/>

<stl-vector name='color_modifiers' type-name='int32_t' index-refers-to='(find-creature $$._parent.race).caste[$$._parent.caste].color_modifiers[$]/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a missing quote at the end of this line, by the way. It looks like I forgot to mention it earlier, but I had to fix it to test this, so no need to change it here.

@lethosor lethosor merged commit 433d21c into DFHack:master May 20, 2017
lethosor added a commit that referenced this pull request May 20, 2017
lethosor added a commit to DFHack/scripts that referenced this pull request May 20, 2017
@dscorbett dscorbett deleted the adventurer branch May 20, 2017 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants