Page 1 of 1

Copy/Paste Editor Crash

Posted: Fri Feb 17, 2017 10:01 pm
by CainOrdamoth
Hi all. Got an issue blocking my progress on my mod. I was building away on one of my dungeon floors, but I tried copying a particular object but it wouldn't happen. No matter how many times I pressed ctrl+c/ctrl+v nothing happened. But then the editor crashed. I tried a few more times, and the same bug keeps happening, but it only happens with a few custom assets. The assets have no issues with them, I've used them many times in other parts of the dungeon, but suddenly they started causing this crash when I try to copy/paste them. It only happens on that one specific floor with that one specific object. When it crashes I get this message:
SpoilerShow
=== Software Failure ===

[string "GameObject.lua"]:0: attempt to index field 'map' (a nil value)
stack traceback:
[string "GameObject.lua"]: in function 'destroy'
[string "Map.lua"]: in function 'removeWall'
[string "Arch.lua"]: in function 'spawn'
[string "DungeonEditor.lua"]: in function 'spawn'
clipboard:1: in main chunk
[string "DungeonEditor.lua"]: in function 'pasteEntities'
[string "DungeonEditor.lua"]: in function 'mapView'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk
What causes this? I've not had this happen before. I even checked the dungeon file for any 'phantom' objects or something, lol. Should I just scrap the dungeon floor and make it afresh, or is there a fix? Cheers, guys.

Re: Copy/Paste Editor Crash

Posted: Fri Feb 17, 2017 10:24 pm
by zimberzimber
Can we get a definition of the object you are talking about?

Re: Copy/Paste Editor Crash

Posted: Fri Feb 17, 2017 10:34 pm
by CainOrdamoth
Sure, its a simple wall object. I've been experimenting on a different level but can't seem to replicate it. It happens with both of the walls, and seems to be some conflict with my custom tiles I've set up. Once I deleted the tiles the walls seemed to copy/paste correctly, but I can't pinpoint the issue with the tiles themselves. I just tried placing each tile in the map in turn to see if I can find out what one is causingg the issue, but the problem only started when I started using the tiles below, so they must be the cause. I'm so confused, lol. :(

Wall objects

Code: Select all

defineObject{
	name = "realm_wall_01",
	baseObject = "base_wall",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/realm/realm_wall_01.fbx",
			staticShadow = true,
		},
		{
			class = "Occluder",
			model = "assets/models/env/dungeon_wall_01_occluder.fbx",
		},
	},
	minimalSaveState = true,
}

defineObject{
	name = "realm_wall_02",
	baseObject = "base_wall",
	components = {
		{
			class = "Model",
			model = "mod_assets/models/realm/realm_wall_02.fbx",
			staticShadow = true,
		},
		{
			class = "Occluder",
			model = "assets/models/env/dungeon_wall_01_occluder.fbx",
		},
	},
	minimalSaveState = true,
}
Tiles

Code: Select all

defineTile{
	name = "realm_garden_brickwall_mud",
	editorIcon = 192,
	color = {130,70,150,255},
	builder = "dungeon",
	diggable = true,
	floor = {
		"realm_garden_floor_mud", 1,
	},
	ceiling = {
		"realm_rock_ceiling_01", 50,
		"realm_rock_ceiling_02", 50,
	},
	wall = {
		"realm_wall_01", 35,
		"realm_wall_02", 35,
	},
	pillar = {
		"realm_pillar", 1,
	},
	ceilingShaft = "realm_rock_ceiling_shaft",
}

defineTile{
	name = "realm_garden_cobblestone_walkway",
	editorIcon = 192,
	color = {100,70,120,255},
	builder = "dungeon",
	diggable = true,
	floor = {
		"realm_floor_cobblestone", 1,
	},
	ceiling = {
		"realm_rock_ceiling_01", 50,
		"realm_rock_ceiling_02", 50,
	},
	wall = {
		"realm_wall_01", 35,
		"realm_wall_02", 35,
	},
	pillar = {
		"realm_pillar", 1,
	},
	ceilingShaft = "realm_rock_ceiling_shaft",
}

Re: Copy/Paste Editor Crash

Posted: Sat Feb 18, 2017 12:14 am
by minmay
Pasting works by calling spawn() and component methods the same way dungeon.lua would. This can result in pasting replacesWall/replacesFloor/replacesCeiling objects making other objects disappear, which can result in the crash you encountered. I recommend saving your dungeon before pasting those so that you can reload it if the paste does something bad.

Re: Copy/Paste Editor Crash

Posted: Sat Feb 18, 2017 12:26 am
by CainOrdamoth
I see. It only seemed to start crashing when using my custom assets so I figured it was an issue with them. I just tried it on the default dungeon assets and the same problem occurs which is kinda weird because I've not encountered it before, I feel like I've done this a thousand times already, but I guess not, lol. I guess as a work-around I can just place the objects elsewhere and move them into position, but it would mean a lot of extra work. I'm hesitant to disable replacesWall on my custom assets as that would probably bring up a ton of other issues instead. I guess as long as the dungeon runs when its all finished its not much of an issue. Probably my fault for doing what I am doing, lol. Thanks for the replies, guys.

Not gonna lie, I started sh*tting myself that I'd broken my mod and would have to start from scratch XD.

Re: Copy/Paste Editor Crash

Posted: Thu Mar 23, 2017 2:56 am
by akroma222
CainOrdamoth wrote:Not gonna lie, I started sh*tting myself that I'd broken my mod and would have to start from scratch XD.
Hey CainOrdamoth!
Ive had that happen (LoG1 mod) - lost a few months worth of work. There were big Minotaur tears, I can tell you!
I now keep multiple backups (rotationally & periodically saving):
1)- on my computer
2)- on 3 other friends computers
3)- on both of my external hard drives
4)- dropbox
5)- inside a safe in a fallout/bomb shelter
6)- other secret places no one knows about

How goes the level building??
Akroma

Re: Copy/Paste Editor Crash

Posted: Tue Apr 11, 2017 9:24 pm
by CainOrdamoth
It goes well, tyvm for asking. :) Now I know the cause for the issue I've not had any problems with it... until I suffer a slight mental lapse and forget about it and lose a day's worth of stuff. I've got in the habit of saving after nearly every object I place. I think I spend more time saving than actually editing. I just finished Breath of the Wild so I can return to modding semi-full-time. Got a LOAD of kinks to work out (as I am sure you are aware, lol). As of right now I've put off actually progressing the mod until I get all that juicy feedback so I can focus on fixes full-time without adding even more guff to sift through.
Cheers :)