A couple of questions about asset definitions

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

A couple of questions about asset definitions

Post by Phitt »

I have a couple of questions about defining assets, couldn't find anything in the modding documentation (though maybe I only missed it).

1. Is there a list of editor icons and their icon number (the one you need when defining the asset) somewhere? So far I could only look at the ones used in the 'rotten place' mod, is there a complete list somewhere?

2. I can't find some asset types in the definition reference. For example how do I add a ceiling shaft I can place manually? I could define it as deco object, but there doesn't seem to be a 'replaces ceiling' boolean available. So how would I do that?

3. The syntax is sometimes a bit unclear to me. For example if I wanted to enable random floor facing in the wall_sets.lua, what do I have to type and where? Tried various combinations of randomFloorFacing = true, but either the editor spits out errors or it simply doesn't work.

I hope someone can help.

EDIT: Oh, and what about the scripting hooks? Do I need to define them somehow or are they just mentioned for scripting reference?
Last edited by Phitt on Sat Oct 13, 2012 1:29 am, edited 1 time in total.
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: A couple of questions about asset defiitions

Post by Grimwold »

Have you tried looking in the asset pack:
http://www.grimrock.net/modding/asset-pack/
There are definitions for pretty much everything... including which editorIcon is used for each object.

For the dungeon ceiling shaft (again from the asset pack) the definition is:
SpoilerShow

Code: Select all

defineObject{
	name = "dungeon_ceiling_shaft",
	class = "Decoration",
	model = "assets/models/env/dungeon_ceiling_pit.fbx",
	placement = "ceiling",
	editorIcon = 104,
}
So at a guess you just need class="Decoration" and placement="ceiling"


Regarding the random floor facing... It looks like when defining a wall set you place randomFloorFacing = true immediately after the name e.g.
SpoilerShow

Code: Select all

defineWallSet{
	name = "dungeon",
	randomFloorFacing = true,
	
	floors = {
		"assets/models/env/dungeon_floor_01.fbx", 5,
		"assets/models/env/dungeon_floor_02.fbx", 5,
		"assets/models/env/dungeon_floor_03.fbx", 5,
		"assets/models/env/dungeon_floor_04.fbx", 5,
		"assets/models/env/dungeon_floor_05.fbx", 5,
		"assets/models/env/dungeon_floor_06.fbx", 5,
		"assets/models/env/dungeon_floor_drainage.fbx", 1,
	},
	
	walls = {
		"assets/models/env/dungeon_wall_01.fbx", 50,
		"assets/models/env/dungeon_wall_drainage.fbx", 1,
	},
	
	pillars = {
		"assets/models/env/dungeon_pillar.fbx", 1,
	},

	ceilings = {
		"assets/models/env/dungeon_ceiling.fbx", 1,
	},
	
	ceilingShafts = {
		"assets/models/env/dungeon_ceiling_pit.fbx", 1,
	},

	floorDecorations = {
	},
	
	wallDecorations = {
		"assets/models/env/metal_hooks_wall.fbx", 1,
		"assets/models/env/metal_hooks_chain_wall.fbx", 1,
	},
	
	pillarDecorations = {
		"assets/models/env/metal_hook_pillar.fbx", 1,
		"assets/models/env/metal_hook_chain_pillar.fbx", 1,
		"assets/models/env/metal_ring_pillar.fbx", 1,
	},
}
User avatar
Grimwold
Posts: 511
Joined: Thu Sep 13, 2012 11:45 pm
Location: A Dungeon somewhere in the UK

Re: A couple of questions about asset defiitions

Post by Grimwold »

Regarding scripting hooks. If I understand what you're asking, you have to define the event that takes place.

e.g. to make use of the hook "onMove" by the party you would need to "modify" the entry for the party to point to a script and function which you could then add in the editor.

e.g. from my init.lua file

Code: Select all

cloneObject{
   name = "party",
   baseObject = "party",

   onMove = function(self, dir)
      return direction_script.moveCheck(dir)
   end,
}
so every time the party moves it runs the function moveCheck() which is defined in the direction_script script entity in my dungeon.
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: A couple of questions about asset defiitions

Post by Neikun »

It would appear that the string
placement = "ceiling",
does in fact act as replaceCeiling=true,
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: A couple of questions about asset defiitions

Post by Phitt »

Thanks, didn't know there were definitions in the asset pack. Didn't know about the ceiling either.

So I guess if I make a custom tile set I'll leave the script part out of the objects.lua so modders can fill it in themselves?
User avatar
Neikun
Posts: 2457
Joined: Thu Sep 13, 2012 1:06 pm
Location: New Brunswick, Canada
Contact:

Re: A couple of questions about asset defiitions

Post by Neikun »

I think the best way for modders to use bulk assets is to create a new .lua file and add it to the import file.
This way it's easier to keep track of custom assets that are all from the same source.

So whatever custom assets you bring, they can put it into their own files via good old copy&paste.
"I'm okay with being referred to as a goddess."
Community Model Request Thread
See what I'm working on right now: Neikun's Workshop
Lead Coordinator for Legends of the Northern Realms Project
  • Message me to join in!
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: A couple of questions about asset defiitions

Post by Phitt »

Neikun wrote:I think the best way for modders to use bulk assets is to create a new .lua file and add it to the import file.
This way it's easier to keep track of custom assets that are all from the same source.

So whatever custom assets you bring, they can put it into their own files via good old copy&paste.
That's what I planned, I want to copy the lua definitions for materials, objects and wall sets into a txt file so people can copy/paste them into their current project. The only question is whether I should define any scripting hooks or leave those out so modders can define them on their own. I guess I shouldn't add any scripting hooks, and that is my question.
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: A couple of questions about asset defiitions

Post by JohnWordsworth »

One suggestion is to have a subdirectory for a custom asset pack like so...

Code: Select all

mod_assets/mine_wallset/models/...
mod_assets/mine_wallset/textures/...
mod_assets/mine_wallset/scripts/materials.lua
mod_assets/mine_wallset/scripts/wallsets.lua
mod_assets/mine_wallset/scripts/init.lua
In your asset pack's init.lua, you could include the other lua files in your asset pack.

Pros
- Your entire pack of assets and scripts are in one folder.
- Including all of the scripts for that pack simply involves including mod_assets/mine_wallset/scripts/init.lua in mod_assets/scripts/init.lua

Cons
- Loads of extra includes will increase loading time, but I expect it will be a really tiny increase.
- It's harder to spot naming conflicts. Perhaps custom asset packs should use name prefixing (mine_something_01).

Install instructions would then just be 'extract files to right folder, add init include'.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
Komag
Posts: 3658
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: A couple of questions about asset defiitions

Post by Komag »

simplicity and clarity are KING! So this is a good approach
Finished Dungeons - complete mods to play
User avatar
Phitt
Posts: 442
Joined: Tue Aug 14, 2012 9:43 am

Re: A couple of questions about asset defiitions

Post by Phitt »

That's great, didn't know you could do that. Very clean and simple to use for modders utilizing my tileset. Thanks!
Post Reply