(fixed) Pit damage Bug

This forum is for the Lua scriptable clone of DM/CSB called Dungeon Strikes Back by Sophia. Use DSB to build your own highly customised games.

Moderator: Sophia

Forum rules
Please read the Forum rules and policies before posting. You may Image to help finance the hosting costs of this forum.
Post Reply
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

(fixed) Pit damage Bug

Post by Sophia »

Paul Stevens (via PM) wrote:Downloaded dsbtest33.zip and the
CSB port.

Got fatal LUA ERROR

Lua function pit.on_trigger: base/triggers.lua;480 attempt to perform arithmetic on global 'damage_amount' (a nil value)

Happened only 30 seconds into the game after running
away from the opening worms.
Line 480 of base/triggers.lua looks something like:

Code: Select all

dsb_set_hp(what, dsb_get_hp(what) - damage_amount)
This bug can be fixed for the time being by adding

Code: Select all

local damage_amount = 20
just above the previous line. That will cause damage_amount to be defined and the game won't error out any more.

I'll have a better fix in DSB 0.34.
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

Hey, cool, someone is actually testing my conversions !

(I expect them to be bug-ridden,
especially the endgame mechanics !!)
What Is Your Quest ?
User avatar
Paul Stevens
CSBwin Guru
Posts: 4322
Joined: Sun Apr 08, 2001 6:00 pm
Location: Madison, Wisconsin, USA

Post by Paul Stevens »

J wrote:Hey, cool, someone is actually testing my conversions
OK. So it ain't been tested. So I
figures "What the Hell; I'll give it a whirl".
Got another solid 30 seconds of gametime
under my belt. Went upstairs and met
a mummy. Threw something at them.
This ain't exactly the end-game.
Guess I better save more often :wink:


Lua function sys_base_impact:base/system.lua:60
attempt to call global monster_took_damage (nil)
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

Erm, the mummy probably tried to play base-ball with you. :lol: :oops:
What Is Your Quest ?
User avatar
Sophia
Concise and Honest
Posts: 4307
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

None of this is Joramun's or CSB's fault. :P :)

It actually has to do with the new "hook" system, and not testing that enough. ;)

I renamed/moved around a bunch of functions and apparently forgot a couple. :oops:
User avatar
Joramun
Mon Master
Posts: 927
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

Post by Joramun »

Paul Stevens wrote: OK. So it ain't been tested.
Actually, I test almost everything EXCEPT the endgame mechanics of CSB. The DM one is ok.
What Is Your Quest ?
User avatar
ian_scho
High Lord
Posts: 2807
Joined: Fri Apr 07, 2006 8:30 am
Location: Zaragoza, Spain

Post by ian_scho »

Sophia wrote: It actually has to do with the new "hook" system, and not testing that enough. ;)

I renamed/moved around a bunch of functions and apparently forgot a couple. :oops:
Hi. Was function monster_took_damage(...) one of them? You need someone to write you some unit tests :wink:
Post Reply