Page 1 of 1

[Solved] Trouble using defineTile

Posted: Thu Nov 06, 2014 3:35 pm
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....

Re: Trouble using defineTile

Posted: Thu Nov 06, 2014 3:51 pm
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.

Re: Trouble using defineTile

Posted: Thu Nov 06, 2014 3:57 pm
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!

Re: Trouble using defineTile

Posted: Thu Nov 06, 2014 4:25 pm
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!

Re: [Solved] Trouble using defineTile

Posted: Thu Nov 06, 2014 6:53 pm
by Doridion
Done it ! YEAH ! ( MrChoke, as a trick, you'll have to modify your normal maps, use the leki's tutorial to do )