Tome Library

Talk about creating Grimrock 1 levels and mods here. Warning: forum contains spoilers!
User avatar
Montis
Posts: 340
Joined: Sun Apr 15, 2012 1:25 am
Location: Grimrock II 2nd playthrough (hard/oldschool)

Re: Tome Library

Post by Montis »

SpacialKatana wrote:I'm going to use that code for my random barrel drops.
Random barrel drops sound like donkey kong :D
(I know what you mean with that but still ;))
When destiny calls, the chosen have no choice.

My completed dungeon (LoG1): Hypercube
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Re: Tome Library

Post by J. Trudel »

Ixnatifual wrote:Written by a man whose name bears an odd resemblance to a toxic beverage, this book's pages detail how men of the enigmatic tribes of the south have learned to run for days without tiring.
Is this a reference to the Tarahumaras? :) I really like all the tomes descriptions.
The Lurker
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: Tome Library

Post by SpacialKatana »

Hmmm having a spot of bother

Barrel object has hook:-

Code: Select all

onDie = function(self)
barreldrop.randomdrop()
end
Entity called global_functions has code:-

Code: Select all

function getrandomdrop()
local item = {"arrow", "cold_arrow", "fire_arrow",
      "poison_arrow", "shock_arrow", "baked_maggot", "boiled_beetle",
      "cave_nettle", "grim_cap", "milkreed", "blooddrop_blossom",
      "pitroot_bread", "poison_bomb", "fire_bomb", "frost_bomb",
      "shock_bomb", "sandals", "slime_bell",
      "tar_bead","throwing_dagger"}   
   return item[math.random(1, table.getn(item))]
end
Entity called barreldrop with code:-

Code: Select all

function randomdrop()
spawn(global_functions.getrandomdrop(),self.level,self.x,self.y,self.facing)
end
The barrel breaks fine but nothing drops....prolly the self.x,self.y etc

What have I done wrong???
User avatar
petri
Posts: 1917
Joined: Thu Mar 01, 2012 4:58 pm
Location: Finland

Re: Tome Library

Post by petri »

You're spawning in the cell where the script entity is. Perhaps you wanted to pass the self parameter to randomdrop?
Ixnatifual

Re: Tome Library

Post by Ixnatifual »

J. Trudel wrote:
Ixnatifual wrote:Written by a man whose name bears an odd resemblance to a toxic beverage, this book's pages detail how men of the enigmatic tribes of the south have learned to run for days without tiring.
Is this a reference to the Tarahumaras? :) I really like all the tomes descriptions.
Yeah. And the vague comment on the writer is a reference to this dude.
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: Tome Library

Post by SpacialKatana »

petri wrote:You're spawning in the cell where the script entity is. Perhaps you wanted to pass the self parameter to randomdrop?
okay so I know what I did wrong....I was asking how to fix it....not drink more Jack Daniels :evil:

Help? pretty please, I'm new to lua
SpacialKatana
Posts: 163
Joined: Fri Sep 14, 2012 6:20 pm

Re: Tome Library

Post by SpacialKatana »

Okay so I kind of figured it out eventually:-

Code: Select all

onDie = function(object)
barreldrop.randomdrop(object.level, object.x, object.y, object.facing)
end
Entity called barreldrop with code:-

Code: Select all

function randomdrop(level, x, y, facing)
spawn(global_functions.getrandomdrop(), level, x, y, facing)
end
The loot drops where the barrel was broken but when exiting the preview the editor crashes:-

[string "Map.lua"]:0: table index is nil
stack traceback:
[string "Map.lua"]: in function 'registerNode'
[string "Blockage.lua"]: in function 'entityRemovedFromMap'
[string "Map.lua"]: in function 'removeEntity'
[string "Map.lua"]: in function 'destroy'
[string "Dungeon.lua"]: in function 'unload'
[string "DungeonEditor.lua"]: in function 'stopPreview'
[string "DungeonEditor.lua"]: in function 'previewButtons'
[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: 8147 MB
Free memory: 5804 MB

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

Display device 1:
Device name: \\.\DISPLAY2
Device string: NVIDIA GeForce GTX 570
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
User avatar
J. Trudel
Posts: 117
Joined: Tue Aug 28, 2012 3:05 pm
Location: Montreal, Canada

Re: Tome Library

Post by J. Trudel »

Ixnatifual wrote:
J. Trudel wrote:
Ixnatifual wrote:Written by a man whose name bears an odd resemblance to a toxic beverage, this book's pages detail how men of the enigmatic tribes of the south have learned to run for days without tiring.
Is this a reference to the Tarahumaras? :) I really like all the tomes descriptions.
Yeah. And the vague comment on the writer is a reference to this dude.
I was actually quite surprised (and pleased) to see this reference, I'll have a look at this dude he seems to know his stuff. :)
The Lurker
Ixnatifual

Re: Tome Library

Post by Ixnatifual »

J. Trudel wrote:I was actually quite surprised (and pleased) to see this reference, I'll have a look at this dude he seems to know his stuff. :)
Daniel's Running Formula is a very informative read, although it is most certainly overkill for someone like me who just runs casually now and then. Now if I was coaching a team of runners it'd probably be an amazing resource.
User avatar
Emciel
Posts: 34
Joined: Fri Sep 14, 2012 2:19 am

Re: Tome Library

Post by Emciel »

very nicely done ixnatifual.
the randomtome table is a very appealing way of dealing with random loot, i might make use of it in a dungeon or two =)
although i guess it'd require a bit more work to make some items more likely than others.
Post Reply