[Solved] Trouble using defineTile

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

[Solved] Trouble using defineTile

Post by MrChoke »

I am trying to do a quick test of defineTile now that we have doco on it. I cannot seem to get anything with a floor or ceiling to work when I start Preview. I always get this error and the editor closes:

[string "Arch.lua"]:0: invalid arch
stack traceback:
[C]: in function 'assert'
[string "Arch.lua"]: in function 'findArch'
[string "Arch.lua"]: in function 'spawn'
[string "DungeonBuilder.lua"]: in function 'buildLevel'
[string "Map.lua"]: in function 'loadLayer'
[string "Dungeon.lua"]: in function 'loadLayer'
preview:97: in main chunk
[string "Dungeon.lua"]: in function 'loadDungeonFile'
[string "DungeonEditor.lua"]: in function 'playPreview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk

My code is:

Code: Select all

defineTile {
	name = "custom_tile1",
	editorIcon = 200,
	color = {255,255,255,255},
	randomFloorFacing = true,
	solid = false,
	diggable = false,
	underwater = false,
	builder = "dungeon",	
	wall = {	
		dungeon_wall_01, 10
	},
	floor = {
		dungeon_floor_01, 10
	},
	ceiling = {
		dungeon_ceiling, 10
	},
	automapTile = "trees"
}
I have tried many different models. They all seem to give the same error. I must be missing something....
Last edited by MrChoke on Thu Nov 06, 2014 4:26 pm, edited 1 time in total.
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: Trouble using defineTile

Post by Doridion »

Actually on it too, and if I can give you tricks ^^

LoG1 wallset system was simple ( giving path/name of the model, and go ). For LoG2, you must define in the object.lua all parts of your walls/floors/ceilings/etc like that :

Code: Select all

defineObject{
	name = "user_wall_stone",
	components = {
    {
      class = "Model",
      model = "mod_assets/models/env/user_wall_stone.fbx",
    },
  },
  placement = "wall",
  replacesWall = true,
}
When done, in the wall conponent, you call for your object definition ( there "user_wall_stone" ) like that :

Code: Select all

defineTile{
  name = "user_wall",
  editorIcon = 196,
  color = {110,130,110,255},
  solid = true,
  builder = "dungeon",
	wall = {
		"user_wall_stone", 50,
	},
	automapTile = “rocky_wall”,
}
Take care about the textures, i'm actually having issues for the texture ( defining them is easy, but seems not displayed, think to use that thread from leki to correct it )

For the randomFloorFacing = true, I didn't tested yet, so can't help you for that ((

Hope it can helps you.
Last edited by Doridion on Thu Nov 06, 2014 4:16 pm, edited 1 time in total.
User avatar
Prozail
Posts: 158
Joined: Mon Oct 27, 2014 3:36 pm

Re: Trouble using defineTile

Post by Prozail »

MrChoke wrote:

Code: Select all

	wall = {	
		dungeon_wall_01, 10
	},
I must be missing something....
Yes.. you are missing some "quotes" around "dungeon_wall_01"

other than that.. what doridion said :) gl!
MrChoke
Posts: 324
Joined: Sat Oct 25, 2014 7:20 pm

Re: Trouble using defineTile

Post by MrChoke »

Prozail wrote:
MrChoke wrote:

Code: Select all

	wall = {	
		dungeon_wall_01, 10
	},
I must be missing something....
Yes.. you are missing some "quotes" around "dungeon_wall_01"

other than that.. what doridion said :) gl!
Burned by the missing quotes. That was it. Thanks!
User avatar
Doridion
Posts: 256
Joined: Tue Jun 10, 2014 9:23 pm

Re: [Solved] Trouble using defineTile

Post by Doridion »

Done it ! YEAH ! ( MrChoke, as a trick, you'll have to modify your normal maps, use the leki's tutorial to do )
Post Reply