Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: [DFHack] Making a wound gui and global_layer_idx meaning?  (Read 435 times)

SlimeOfSteel

  • Bay Watcher
  • Novice Programmer
    • View Profile
[DFHack] Making a wound gui and global_layer_idx meaning?
« on: April 09, 2018, 09:12:45 am »

A bit of a foreword: I'm new to the forums, so it's nice to meet you.

Anyways, while messing around with DFHack and touturing units for no reason, I had an idea to make a script that allows you to edit a unit's wound status. Only problem is that I have no surefire way of telling what id number corresponds to which body part. What confuses me even more is that in each of the wound part tabes, there's a variable called global_layer_idx. I'm not entirely sure what it does, but sometimes if you enter a wrong number, the game crashes.

TL;DR how do I tell what part id correpsonds to which part and what does global_layer_idx do?
Logged
It works, but I don't know why.

SlimeOfSteel

  • Bay Watcher
  • Novice Programmer
    • View Profile
Re: [DFHack] Making a wound gui and global_layer_idx meaning?
« Reply #1 on: April 09, 2018, 09:48:44 am »

Nevermind, I figured out the solution to my own question.

You have to analyze the body plan to see what goes where. Still unsure what global_layer_idx means, though.
Logged
It works, but I don't know why.

bloop_bleep

  • Bay Watcher
    • View Profile
Re: [DFHack] Making a wound gui and global_layer_idx meaning?
« Reply #2 on: April 09, 2018, 01:23:02 pm »

I seem to remember that variable names that end in "idx" mean "next id", i.e. the id that will be assigned to the next object that is added to the list.

Might be completely wrong though.
Logged
Quote from: KittyTac
The closest thing Bay12 has to a flamewar is an argument over philosophy that slowly transitioned to an argument about quantum mechanics.
Quote from: thefriendlyhacker
The trick is to only make predictions semi-seriously.  That way, I don't have a 98% failure rate. I have a 98% sarcasm rate.

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: [DFHack] Making a wound gui and global_layer_idx meaning?
« Reply #3 on: April 14, 2018, 01:37:05 am »

no, that's ones that are next_id, idx just means "index"