Random barrel drops sound like donkey kongSpacialKatana wrote:I'm going to use that code for my random barrel drops.
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
(I know what you mean with that but still
![Wink ;)](./images/smilies/icon_e_wink.gif)
Random barrel drops sound like donkey kongSpacialKatana wrote:I'm going to use that code for my random barrel drops.
Is this a reference to the Tarahumaras?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.
Code: Select all
onDie = function(self)
barreldrop.randomdrop()
end
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
Code: Select all
function randomdrop()
spawn(global_functions.getrandomdrop(),self.level,self.x,self.y,self.facing)
end
Yeah. And the vague comment on the writer is a reference to this dude.J. Trudel wrote:Is this a reference to the Tarahumaras?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.I really like all the tomes descriptions.
okay so I know what I did wrong....I was asking how to fix it....not drink more Jack Danielspetri wrote:You're spawning in the cell where the script entity is. Perhaps you wanted to pass the self parameter to randomdrop?
Code: Select all
onDie = function(object)
barreldrop.randomdrop(object.level, object.x, object.y, object.facing)
end
Code: Select all
function randomdrop(level, x, y, facing)
spawn(global_functions.getrandomdrop(), level, x, y, facing)
end
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.Ixnatifual wrote:Yeah. And the vague comment on the writer is a reference to this dude.J. Trudel wrote:Is this a reference to the Tarahumaras?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.I really like all the tomes descriptions.
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.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.