[Bug] Editor crash when placing item on pressure plate

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
Ixnatifual

[Bug] Editor crash when placing item on pressure plate

Post by Ixnatifual »

If you place an item on a pressure plate in the editor, it crashes. I discovered it by placing a Peasan't Cap on level 1 of my dungeon (using the dungeon tileset). I placed a few other items on some of the other plates in the level and got the same result.

Code: Select all

[string "Pit.lua"]:0: attempt to index field 'animController' (a nil value)
stack traceback:
	[string "Pit.lua"]: in function 'open'
	[string "Pit.lua"]: in main chunk
	[string "MessageSystem.lua"]: in function 'sendMessageToEntity'
	[string "TriggerEvents.lua"]: in function 'fire'
	[string "PressurePlate.lua"]: in function 'pressed'
	[string "PressurePlate.lua"]: in function 'updateState'
	[string "PressurePlate.lua"]: in main chunk
	[string "MessageSystem.lua"]: in function 'sendMessage'
	[string "Map.lua"]: in function 'addEntity'
	[string "Item.lua"]: in function 'spawn'
	[string "Arch.lua"]: in function 'spawn'
	[string "DungeonEditor.lua"]: in function 'addObjectTool'
	[string "DungeonEditor.lua"]: in function 'mapView'
	[string "DungeonEditor.lua"]: in function 'update'
	[string "Grimrock.lua"]: in main chunk

OS Version 6.1

OEM ID: 0
Number of processors: 8
Page size: 4096
Processor type: 586

Total memory: 4078 MB
Free memory: 1104 MB

Display device 0:
  Device name: \\.\DISPLAY1
  Device string: NVIDIA GeForce GTX 560 
  State flags: 00000005

Display device 1:
  Device name: \\.\DISPLAY2
  Device string: NVIDIA GeForce GTX 560 
  State flags: 00000000

Display device 2:
  Device name: \\.\DISPLAYV1
  Device string: RDPDD Chained DD
  State flags: 00000008

Display device 3:
  Device name: \\.\DISPLAYV2
  Device string: RDP Encoder Mirror Driver
  State flags: 00200008

Display device 4:
  Device name: \\.\DISPLAYV3
  Device string: RDP Reflector Display Driver
  State flags: 00200008
Possibly one could place an item there with a script as a workaround, but I haven't tried.

Example dungeon:
http://www22.zippyshare.com/v/16114734/file.html
Last edited by Ixnatifual on Sun Sep 16, 2012 1:02 pm, edited 1 time in total.
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: [Bug] Editor crash when placing item on pressure plate

Post by Magus »

I don't know how you guys do this. I can place items on pressure plate without getting any error :D

EDIT: can you upload the dungeon.lua so i can test it?
Ixnatifual

Re: [Bug] Editor crash when placing item on pressure plate

Post by Ixnatifual »

Where do you want me to upload it?
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: [Bug] Editor crash when placing item on pressure plate

Post by Magus »

uh dunno, maybe pastebin or so
Magus
Posts: 56
Joined: Wed Sep 12, 2012 6:05 pm

Re: [Bug] Editor crash when placing item on pressure plate

Post by Magus »

Okay now I get it to crash, I guess you need to use a script entity with the code

Code: Select all

spawn("peasant_cap", LEVEL, X, Y, 1, "peasant_cap1")
and insert the level and (X,Y) coordinates

and delete your old peasant_cap in the dungeon.lua
Ixnatifual

Re: [Bug] Editor crash when placing item on pressure plate

Post by Ixnatifual »

I found something called Zippyshare and uploaded it there: http://www22.zippyshare.com/v/16114734/file.html
Ixnatifual

Re: [Bug] Editor crash when placing item on pressure plate

Post by Ixnatifual »

Magus wrote:Okay now I get it to crash, I guess you need to use a script entity with the code

Code: Select all

spawn("peasant_cap", LEVEL, X, Y, 1, "peasant_cap1")
and insert the level and (X,Y) coordinates

and delete your old peasant_cap in the dungeon.lua
Your script is a solid workaround, no doubt about it.
User avatar
spectre900
Posts: 124
Joined: Fri Sep 14, 2012 1:47 am

Re: [Bug] Editor crash when placing item on pressure plate

Post by spectre900 »

I made one type of work around for that by placing an item in an unused square and place a teleporter over it so it get teleported to the pressure plate when the game starts.

don't know how to use scripts yet so that way works best for me.
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: [Bug] Editor crash when placing item on pressure plate

Post by Komag »

placing that script is much better than using an empty room with a teleporter. All you need to do is:

- create the item "script_entity" (looks like a little "Lua") anywhere in your map
- select the "Lua" and in the Inspector window, below the line, type in:

Code: Select all

spawn("peasant_cap", LEVEL, X, Y, 1, "peasant_cap1")
(you change the LEVEL and X and Y, such as 1, 23, 17, so that line would read:

Code: Select all

spawn("peasant_cap", 1, 23, 17, 1, "peasant_cap1")
That's it! It will run the script when the map starts, instantly spawning the peasant cap to the coordinates you chose

Here is the note again from the scripting reference document:
spawn(object, level, x, y, facing, [id])
Spawns a new object at given position on a dungeon level where x and y specify the x- and y-coordinates on the map and level is a level index. facing must be a number between 0 and 3 and it indicates the following directions: 0=north, 1=east, 2=south, 3=west. id parameter is optional. If given it must be an unique id in the context of the dungeon. If not given an unique id is automatically generated.
Finished Dungeons - complete mods to play
Post Reply