Help with a script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
Post Reply
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Help with a script

Post by J. Trudel »

I am trying to make a script that destroy a cave_in when an ogre charge on it, in a corridor I have a hidden pressure plate that is triggered only by monsters just next to a cave_in. The plate trigger a LUA script that destroy both the ogre and the cave in. The problem I have is if I set the plate to be triggered by the party, it works very well. But when switching the plate to be triggered by monster, the script fail for unknown reasons. Below is my script :
SpoilerShow
-- opentheway script
function opentheway()
ogre_1:destroy()
dungeon_cave_in_1:destroy()
end
Last edited by J. Trudel on Fri Oct 05, 2012 6:37 am, edited 1 time in total.
The Lurker
User avatar
HaunterV
Posts: 676
Joined: Mon Apr 16, 2012 9:54 pm
Location: Barrie, Ontario, Canada

Re: Help with a script

Post by HaunterV »

move the plate further down the hall see if that works.
Grimrock Community 'FrankenDungeon 2012. Submit your entry now!: http://tinyurl.com/cnupr7h
SUBMIT YOUR ASSETS! Community Asset Pack (C.A.P.): http://tinyurl.com/bqvykrp
Behold! The HeroQuest Revival!: http://tinyurl.com/cu52ksc
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Re: Help with a script

Post by J. Trudel »

HaunterV wrote:move the plate further down the hall see if that works.
Same thing, this time the editor crashed.. maybe a bug triggered by a running ogre?

Edit : I tried with a snail and the script works fine, I get this error log :
SpoilerShow
[string "Monster.lua"]:0: attempt to index field 'animController' (a nil value)
stack traceback:
[string "Monster.lua"]: in function 'update'
[string "Monster.lua"]: in function 'update'
[string "Map.lua"]: in function 'updateEntities'
[string "Dungeon.lua"]: in function 'updateLevels'
[string "GameMode.lua"]: in function 'update'
[string "DungeonEditor.lua"]: in main chunk
[C]: in function 'xpcall'
[string "DungeonEditor.lua"]: in function 'preview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk
stack traceback:
[C]: in function 'error'
[string "DungeonEditor.lua"]: in function 'handleError'
[string "DungeonEditor.lua"]: in function 'preview'
[string "DungeonEditor.lua"]: in function 'update'
[string "Grimrock.lua"]: in main chunk

OS Version 6.0

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

Total memory: 1789 MB
Free memory: 634 MB

Display device 0:
Device name: \\.\DISPLAY1
Device string: NVIDIA GeForce 8200M G
State flags: 00000005

Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce 8200M G
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
The Lurker
User avatar
Crisim
Posts: 16
Joined: Wed Aug 29, 2012 2:28 pm

Re: Help with a script

Post by Crisim »

could you try to connect the plate to a timer and wait .5 sec before destroying the ogre?

hope this help...
User avatar
Komag
Posts: 3659
Joined: Sat Jul 28, 2012 4:55 pm
Location: Boston, USA

Re: Help with a script

Post by Komag »

or even just 0.1sec, to make it simply not instantaneous.
Finished Dungeons - complete mods to play
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Re: Help with a script

Post by J. Trudel »

I'll try tonight with a timer and let you know, I suspect that when the ogre charge, the script fail to detect it. The script worked out when the ogre walked on it so it.
The Lurker
Post Reply