[Script] Get difficulty settings from script

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: [Script] Get difficulty settings from script

Post by minmay »

Difficulty only seems to affect monsters' damage and the frequency of moves/attacks. It doesn't seem to affect the speed they move 1 square, so you can't measure it that way. You could look at how long it takes to move multiple squares, perhaps.
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
MasterJoe
Posts: 9
Joined: Fri Dec 21, 2012 7:26 pm

Re: [Script] Get difficulty settings from script

Post by MasterJoe »

Hmmm...
I've tried this:

Code: Select all

local df = getStatistic("difficulty_level")
hudPrint(df.." ")
and it crashes the editor.

In Error-Logfile:

Code: Select all

[string "Statistics.lua"]:0: attempt to index a nil value
stack traceback:
	[C]: in function 'error'
	[string "DungeonEditor.lua"]: in function 'handleError'
	[string "DungeonEditor.lua"]: in function 'playPreview'
	[string "DungeonEditor.lua"]: in function 'previewButtons'
	[string "DungeonEditor.lua"]: in function 'update'
	[string "Grimrock.lua"]: in main chunk
What does this say? Function doesn't exist?
I've tried various getStatistic("commands") and the editor never crashed. :?
I am a REAL 'Master of Disaster' `;.;´
User avatar
JohnWordsworth
Posts: 1397
Joined: Fri Sep 14, 2012 4:19 pm
Location: Devon, United Kingdom
Contact:

Re: [Script] Get difficulty settings from script

Post by JohnWordsworth »

If I put anything 'invalid' in getStatistic then it always crashes for me. Just for testing purposes I tried getStatistic("ABC"); getStatistic("Something"); and both crashed the editor instantly. It would be awesome if there were a 'difficulty' statistic for the getting, but I fear there is not :(.
My Grimrock Projects Page with links to the Grimrock Model Toolkit, GrimFBX, Atlas Toolkit, QuickBar, NoteBook and the Oriental Weapons Pack.
User avatar
MasterJoe
Posts: 9
Joined: Fri Dec 21, 2012 7:26 pm

Re: [Script] Get difficulty settings from script

Post by MasterJoe »

Thanks, but where is the "grimrock.lua"? In the Grimrock.dat?
If it so, can anybody extract me all LUA files from this file?

If you "Load" a savegame, the difficulty setting where displayed. Is there a way to "read" this entry in a script?

Srry for the questions^^
I am a REAL 'Master of Disaster' `;.;´
Post Reply