Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Can I put different [OBJECT] sections in one raw file?  (Read 935 times)

Foxite

  • Bay Watcher
    • View Profile
Can I put different [OBJECT] sections in one raw file?
« on: November 16, 2014, 10:26:29 am »

I'm trying my hand at modding for the first time without any kind of prior knowledge, preparation, or researching, except for the knowledge that raw files are made up of [TAGS]. And that [TAGS:CAN_HAVE_ARGUMENTS].

I'm making a mod that adds a magma cannon. I think I'm making some progress. I got the weapon made, not tested yet, and I'm making the ammo now. But I want to know if I can put multiple [OBJECT] sections in one file, like so:
Code: [Select]
[OBJECT:ITEM]

[ITEM_WEAPON:ITEM_WEAPON_LATI_MAGMACANNON]
...
[ITEM_AMMO:ITEM_AMMO_LATI_MAGMA]
...

[OBJECT:MATERIAL_TEMPLATE]

[MATERIAL_TEMPLATE:LATI_MAGMA_TEMPLATE]
...
Instead of having two files for each object. I want to know this so I can keep my raws centralized in one file, instead of making different custom raw files for each part of the mod. (Of course, I will use seperate files for seperate mods to keep it compatible. Using one file for each mod might decrease the rate of name conflicts.)

Is that possible?
Logged
The best way to demonstrate it to him is take a save of 40 year old fortress with 150 dwarves in it on a good sized embark with a volcano that just breached the circus and install it on his gaming rig and watch it bring his rig to its knees.

Illogical_Blox

  • Bay Watcher
    • View Profile
Re: Can I put different [OBJECT] sections in one raw file?
« Reply #1 on: November 16, 2014, 10:32:24 am »

I'm trying my hand at modding for the first time without any kind of prior knowledge, preparation, or researching, except for the knowledge that raw files are made up of [TAGS]. And that [TAGS:CAN_HAVE_ARGUMENTS].

I'm making a mod that adds a magma cannon. I think I'm making some progress. I got the weapon made, not tested yet, and I'm making the ammo now. But I want to know if I can put multiple [OBJECT] sections in one file, like so:
Code: [Select]
[OBJECT:ITEM]

[ITEM_WEAPON:ITEM_WEAPON_LATI_MAGMACANNON]
...
[ITEM_AMMO:ITEM_AMMO_LATI_MAGMA]
...

[OBJECT:MATERIAL_TEMPLATE]

[MATERIAL_TEMPLATE:LATI_MAGMA_TEMPLATE]
...
Instead of having two files for each object. I want to know this so I can keep my raws centralized in one file, instead of making different custom raw files for each part of the mod. (Of course, I will use seperate files for seperate mods to keep it compatible. Using one file for each mod might decrease the rate of name conflicts.)

Is that possible?
Yes, I believe so. Heck, I think its possible to condense every file in the game into one file.
Logged
Me: "Just imagine a load of dwarves sitting round a table, and one of them says, 'I like stranglers for... for their... their...'"
Brother: "SOFT HANDS!"

pisskop

  • Bay Watcher
  • Too old and stubborn to get a new avatar
    • View Profile
Re: Can I put different [OBJECT] sections in one raw file?
« Reply #2 on: November 16, 2014, 10:33:06 am »

???  You should keep them in separate files, just name them differently.

Here is an example.  I'm pretty positive* I don't even need to keep the naming convention for the file title, I just do for convenience.

item_armor_pisskop.txt - is its name
Code: [Select]
item_armor

[OBJECT:ITEM]

[ITEM_ARMOR:ITEM_ARMOR_FUSED_PLATE]
[NAME:fused plate:fused plates]
[ARMORLEVEL:3]
[UBSTEP:2]
[LBSTEP:1]
[SHAPED]
[LAYER:ARMOR]
[COVERAGE:100]
[LAYER_SIZE:30]
[LAYER_PERMIT:50]
[MATERIAL_SIZE:15]
[HARD]
[METAL]
[BARRED]
[SCALED]

item_armor is required, it would seem, and you need to define the file's contents (i.e. ITEM:OBJECT]) before you define IDs,
  but otherwise you can test it out, using multiple files definitions.  dont think its the best idea.


---

Look at masterwork.  I know for a fact those raws are super compressed, text-wise.
« Last Edit: November 16, 2014, 10:37:22 am by pisskop »
Logged
Pisskop's Reblancing Mod - A C:DDA Mod to make life a little (lot) more brutal!
drealmerz7 - pk was supreme pick for traitor too I think, and because of how it all is and pk is he is just feeding into the trollfucking so well.
PKs DF Mod!

Putnam

  • Bay Watcher
  • DAT WIZARD
    • View Profile
Re: Can I put different [OBJECT] sections in one raw file?
« Reply #3 on: November 17, 2014, 03:35:34 pm »

Yes, I believe so. Heck, I think its possible to condense every file in the game into one file.

I greatly doubt it; it's more likely that you'll get an "unknown item token: OBJECT" than anything.