Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1] 2 3 ... 19

Author Topic: Modding questions thread.  (Read 20010 times)

Kilowatt

  • Bay Watcher
  • I wonder what this does...
    • View Profile
Modding questions thread.
« on: May 31, 2008, 11:23:00 pm »

Here you may ask questions about modding, instead of creating a new topic to answer one or two questions. I created this thread with that in mind. Now, do you mind if I ask a question (or two) of my own?

1.Is it possible to have vermin die and drop a creature?
2.Can you set a lifespan shorter than a year? (A few seconds real-time?)
3. Is it possible to create vermin in a smelter?

Thank you.

(Yes, that was three questions)

Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Modding questions thread.
« Reply #1 on: June 01, 2008, 01:50:00 am »

Answer to first and second is no, third is yes.
Not a very detailed answer, but it works.  :)

To make vermin, you'd have to use the workaround way. The reaction line is [PRODUCT:PET:NO_SUBTYPE:<something>:NO_MATGLOSS]. The <something> part is one of the material types, like STONE, WOOD, PLANT, etc. There're about 30 of them. This means you can only get the first 30 or so creatures from the raws using the reaction. To make matters easier for you, make the new vermin you want to make, and add them to a file that will, alphabetically, be before all other creature files. Like "creature_aaa.txt" or something. This will make the index of your vermin be within the scope.

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

SHAD0Wdump

  • Bay Watcher
  • Hiding in SPAAACE!!!
    • View Profile
Re: Modding questions thread.
« Reply #2 on: June 01, 2008, 02:27:00 am »

Wow,nothing like home made puppies.

This will be great for my dwarven mechs... wait,did I just let that out?

Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding questions thread.
« Reply #3 on: June 01, 2008, 03:12:00 am »

No =).

And Sean is right, there's the same issue as with plants.
I use this to simulate a worm-carrier which upon death drops egg which can be incubated in smelter to transform into a few purring maggots.

Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Kilowatt

  • Bay Watcher
  • I wonder what this does...
    • View Profile
Re: Modding questions thread.
« Reply #4 on: June 01, 2008, 06:53:00 am »

^%$*
Well, time for plan B...

But, wait...
Can a creature drop a creature?

[ June 01, 2008: Message edited by: Kilowatt ]

Yet another question-

code:
 [BODY:HUMANOID_4ARMS]
[BP:UB:upper body][UPPERBODY]
[BP:LB:lower body][CON:UB][LOWERBODY]
[BP:HD:head][CON:UB][HEAD]
[BP:RUA1:first right upper arm][CON:UB][LIMB]

[BP:LUA1:first left upper arm][CON:UB][LIMB]

[BP:RLA1:first right lower arm][CON:RUA1][LIMB]

[BP:LLA1:first left lower arm][CON:LUA1][LIMB]

[BP:RH1:first right hand][CON:RLA1][GRASP]

[BP:LH1:first left hand][CON:LLA1][GRASP]

[BP:RUA2:second right upper arm][CON:UB][LIMB]

[BP:LUA2:second left upper arm][CON:UB][LIMB]

[BP:RLA2:second right lower arm][CON:RUA2][LIMB]

[BP:LLA2:second left lower arm][CON:LUA2][LIMB]

[BP:RH2:second right hand][CON:RLA2][GRASP]

[BP:LH2:second left hand][CON:LLA2][GRASP]

[BP:RUL:right upper leg][CON:LB][LIMB]

[BP:LUL:left upper leg][CON:LB][LIMB]

[BP:RLL:right lower leg][CON:RUL][LIMB]

[BP:LLL:left lower leg][CON:LUL][LIMB]

[BP:RF:right foot][CON:RLL][STANCE]

[BP:LF:left foot][CON:LLL][STANCE]

Would I just ahve to put the body type where it belongs, or do I have to place each individual part in there? If so, can someone identify what I have to put?

[ June 01, 2008: Message edited by: Kilowatt ]

Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding questions thread.
« Reply #5 on: June 01, 2008, 08:32:00 am »

Your first question about creature dropping creature is already answered.

About bodies.
wiki helps. THere you'll find any tokens you need for bodyparts.
What "body type" do you mean?
There's no body type.
Under [BODY:NAME] you define NAME which is  one of the  body templates which you assign inside [BODY:] token of the creature.

[BP] means bodypart and it's part of the template.

And it means that you need only to put [BODY:BASIC_2PARTBODY:HUMANOID_4ARMS: ... ] in your creature description and it will include all bodyparts listed.

Also note that I've put the main body before arms in the body token: if you defined a bodypart which connects to something make sure that "something" is listed before because in opposite situation the game won't be able to join the bodypart and it will be lost.

[ June 01, 2008: Message edited by: Deon ]

Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Kilowatt

  • Bay Watcher
  • I wonder what this does...
    • View Profile
Re: Modding questions thread.
« Reply #6 on: June 01, 2008, 10:22:00 am »

#1- I said can a VERMIN drop a creature!
#2- Oh, but it is not very helpful- it gives an example but never really tells you what does what.

Also, ANYONE may ask questions in this thread.

Another question- could external be used for, say, and appendage that only pops out when where it is gets injured- for example, You have Creature A and Creature B, A has a second set of arms concealed using the exxternal command- B attacks, hitting A in where the second (concealed) arm is- could it appear and be used as another appendage?

Thank you.


[ June 01, 2008: Message edited by: Kilowatt ]

[ June 01, 2008: Message edited by: Kilowatt ]

Logged

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding questions thread.
« Reply #7 on: June 01, 2008, 10:28:00 am »

Anyone also can ask questions in the main modding forum =).

VERMIN is a creature tag thus vermin IS a creature.

What's wrong with my 2nd answer? I showed you explanation of all tokens and how to use template. Please be more specific, what do you need to do but can't do?

Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Kilowatt

  • Bay Watcher
  • I wonder what this does...
    • View Profile
Re: Modding questions thread.
« Reply #8 on: June 01, 2008, 10:33:00 am »

Ooops, d'oh!
Sorry `bout that.

The wiki never really gives a step-by-step way to create a new body type and explain what each part does. Even the modding guide just throws a bunch of unintelligable garbage (well, to new people.) out and never explains how it got what it got.


No, I was creating this topic to cut down on the threads that are always cropping up that ask a few questions. This thread that we can use to centralize the overall asking of questions in.

Also, reread my post before.

Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Modding questions thread.
« Reply #9 on: June 01, 2008, 10:41:00 am »

I'd get a comprehensive body modding guide together, but it's really so simple explaining frustrates me.

Basically, a part is, by default, "large, external". You can specify SMALL - this will make it a small attached item, like an ear. It will be regularly damaged together with the part it's attached to. You can then specify INTERNAL - this will mean that only critical damage to the parent part will cause this part to be damaged. The other tags are pretty self-explanatory and have specific predefined effects.

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

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding questions thread.
« Reply #10 on: June 01, 2008, 11:31:00 am »

Wow, wow... You ask fantastic things which can't be done, the body system is very simple for now.
There's no external tag. Every bodypart is considered external unless it has "internal" tag and what internal does is only makes the bodypart to be the part of the bodypart it connects to.
So, if you set internal on heart it will be internal for upperbody (because it connects to it) and thus it won't be chopped off by axeman and also when someone damages upperbody the heart have a chance to be damaged too because it's an internal part of upperbody.
If you know the theory of multitudes: if the part is internal the part it is connected to includes it.

And as I understood you don't know how to make body right.
OK, let's start from basics.

1) You have a creature you want to make a body for.
2) You look in the creature file (creature_***.txt) which includes the creature info.
3) You look at the [BODY: ***] token. Under *** are body templates of the creature which are separated by ":" symbols. The templates are descripted in the body file (body_default.txt for basic bodies, you can add your body templates there).
4) Let's edit the [BODY:***]

Case 1:

You want your creature to consist of already pre-defined body templates.
Body templates are connected to other body templates/bodyparts in body templates, generally by type ([UPPERBODY], [LOWERBODY], [HEAD] etc).
Some bodyparts are not connected to anything and they serve as "core" of your creature, usually it's an upperbody.
The general rule: if the bodypart/template was connected to something, its carrier should be defined before it for game to know where to connect this bodypart.
Let's make a human from basic components.
So, your first intention should be to find a "core" body template.
There're some basic ones: BASIC_1PARTBODY and BASIC_2PARTBODY. They differ only by contents: 1st consists of 1 bodypart (upper and lowerbody at the same time, i.e. for small creatures or creatures which doesn't have waist), 2nd one consists of "torso+abdomen" 2 bodyparts which are linked together. These bodies have [UPPERBODY] and [LOWERBODY] included thus we try to make it first because other bodyparts are connected to UPPERBODY/LOWERBODY and their branch parts.

***At this point we have [BODY:BASIC_2PARTBODY] in ur creature file.

Then we want our creature to have limbs.
We have BASIC_3PARTARMS and BASIC_3PARTLEGS. The both templates have main bodyparts connected to UPPERBODY and LOWERBODY respectfully. Thus we can join them to our BASIC_2PARTBODY which has these tokens.

***Now we have [BODY:BASIC_2PARTBODY:BASIC_3PARTARMS:BASIC_3PARTLEGS]

The order of limb templates is not important since they don't linked together in anyway, the only rule is to list them after main body which they are joined to.

Then we want to add head (BASIC_HEAD template), which is connected to UPPERBODY too.
*** [BODY:BASIC_2PARTBODY:BASIC_3PARTARMS:BASIC_3PARTLEGS:BASIC_HEAD]

Now we have body-arms-legs-head human frame without any "contents".
You can stay with this if you want a golem (but make sure it has [NOTHOUGHT] in creature info since it doesn't have a brain and [NOBREATHE] because it has no lungs).

If you want to make fully functional humanoid (like human/elf/dwarf) you will add internal and external organs.

Standard internal organs are BRAIN (well, brain...), GUTS (they are slashed out when someone critical hits you in the lowerbody), 2LUNGS (breathing organs), HEART (heart circulation controller), ORGANS (standard abdomen organs like stomach).
Standard external organs are 2EYES, 2EARS, NOSE, MOUTH.

There're more details like NECK, HUMANOID_JOINTS (joints which can be broken by wrestling), THROAT (can be strangled for creature to suffocate), SPINE and fingers (5FINGERS, 5TOES).

If you add them all you get standard human body.
[BODY:HUMANOID:2EYES:2EARS:NOSE:2LUNGS:HEART:GUTS:ORGANS:HUMANOID_JOINTS:THROAT:NECK:SPINE:BRAIN:5FINGERS:5TOES:MOUTH]

Case 2:
You want to go with your custom bodyparts.

You start with adding your custom body template.
Open the body_default.txt and write a new line:
[BODY:MYBODYPART] <- MYBODYPART = your ID for body template, not displayed in-game
[BP:BP1:bodypart1] <- This section lists all bodyparts in this template
[BP:BP2:bodypart2] <- BP1, BP2 and further are bodypart IDs, also call them
[BP:BP3:bodypart3] <- as you want, they're not displayed.
[BP:BP4:bodypart4] <-  bodypart1 etc. are names for your bodyparts which are
[BP:BP5:bodypart5] <- displayed in game (like "right upper arm").

The general "grammar" is next:

[BODY:CUSTOMBODY]
[BP:BP1:body part which connects to upperbody][CONTYPE:UPPERBODY]
[BP:BP2:body part which connects to BP1][CON:BP1]
[BP:BP3:bodypart which is internal part of BP2][CON:BP2][INTERNAL]
[BP:BP4:bodypart which is internal part of upperbody][CONTYPE:UPPERBODY][INTERNAL]

Note that you use [CONTYPE: ] when you connect the BP to bodypart with specific token (like UPPERBODY, LOWERBODY, HEAD etc.) so if you have multiple bodyparts with these tokens your new one will multiply and connect to every specified type,
And you use [CON: ] when you connect BP npt to the bodypart with token but with specific name, like [CON:RUA] (RUA usually stands for right upper arm).

Thus you can have multiple bodytypes with the same token (like HEAD for ettin) but every bodypart has specific UNIQUE name (like [BP:RLA:right lower arm], id RLA should be used once in the whole body), so if you have CONTYPE this bodypart may multiply and join for every specific bodypart but if you use CON the bodypart will join to only one bodypart which has specified unique id.

Also try to remember all the time you work on your body that the rule is still here: IF YOU HAVE ANYTHING JOINED TO SOMETHING, THE SOMETHING SHOULD BE DEFINED BEFORE THE ANYTHING.

You can read bodypart tokens and their meaning if you click the link to the wiki I gave you before.

Sorry if my answer is too shor or I didn't touch details but it's all I can tell for now. Ask more specific questions. But the first suggestion: try to maka a simple body, like bird, and see if it works. The best way to learn is to practice and you can't learn by just asking.

Good luck with your bird    :).

[ June 01, 2008: Message edited by: Deon ]

Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding questions thread.
« Reply #11 on: June 01, 2008, 11:32:00 am »

Ouch, Sean, you posted while I typed my answer. I begin ti think I type too slowly.
Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository

Kilowatt

  • Bay Watcher
  • I wonder what this does...
    • View Profile
Re: Modding questions thread.
« Reply #12 on: June 01, 2008, 01:31:00 pm »

Thank you. This has helped quite a bit.
So... wait... The body type(like 'HUMANOID') determines what can be attached to it?

[ June 01, 2008: Message edited by: Kilowatt ]

Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Modding questions thread.
« Reply #13 on: June 01, 2008, 01:57:00 pm »

In a way, yes. If a body has no legs, for example, attaching toes to it won't work.
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

Deon

  • Bay Watcher
  • 💀 💀 💀 💀 💀
    • View Profile
Re: Modding questions thread.
« Reply #14 on: June 01, 2008, 02:14:00 pm »

HUMANOID is not a body type, it's template. Types are [UPPERBODY], [LOWERBODY] etc..
But it determines what can be connected to it by bodyparts it is constructed from because they have types like HEAD, UPPERBODY and IDs too (like RUA or UB).

The template is determined in body_default.txt in the way I described earlier.

And there's no need to ask us to wait, we're not hurrrying anywhere. Be more patient and the knowledge will come down on you =).

[ June 01, 2008: Message edited by: Deon ]

Logged
▬(ஜ۩۞۩ஜ)▬
✫ DF Wanderer ✫ - the adventure mode crafting and tweaks
✫ Cartographer's Lounge ✫ - a custom worldgen repository
Pages: [1] 2 3 ... 19