Page 1 of 1

ADGE: Bug report: Changing 'monster drops' causes error

Posted: Sun Apr 03, 2005 12:24 pm
by Gambit37
Changing the Monster Drops causes a crash: Setting any 'sometimes dropped' item to 'always dropped' (ie, untick the box for 'sometimes dropped') generates this error when you save the file:

"Run-time error '6' Overflow"

EDIT: Strange though. Sometimes the file saves and sometimes it doesn't -- seems dependent on the monster drop you've just edited but it's not consistent.

Posted: Mon Apr 04, 2005 4:32 am
by rain`
Monster drops are an interesting phenomenon, I'll make it clear how it works here.


Each monster has a specific 'starting point' on the monster drop chart. For instance, Dragon#1 is the first drop to check when a dragon dies, knight#1 is the first to check when a knight dies, etc. When a monster dies, it checks the list at the appropriate spot, if it is "sometimes drops", it will have (i believe this is accurate, but may be 25%...) 50% chance to drop that item. If it DOES pass the test and drops that item, it goes to the next item on the list. If it does not drop the item, it stops and ends the loop. If the item dropped is a 0, meaning the "----" selection, then the loop will end. It is extremely important that you end the entire list of monster drops with a 0, otherwise when a monster dies in the game, anything could happen (crash, infinite loop, bad memory checks, etc).

The neat thing about monster drops is you can have a 0 item drop at the end of the dragon's list, but not the end of a worms list, and the worm will drop items from another monsters designated list (perhaps... maybe only sometimes? :P). Think of it as a case statement, and having the 0 resembles a break.

I'll look into the saving problem, and does it crash in ADGE or in CSBWin?
-rain`

Posted: Sun Apr 10, 2005 8:07 am
by kentaro-k.21
about Overflow problem, following 2 parts should be fixed to avoid it.



original:

Code: Select all

Function write_word(ByVal num As Integer)
    Dim b1, b2 As Byte
    Dim l1 As Long
    l1 = num And &HFF00
    b1 = l1 / &H100
    b2 = num And &HFF
    write_byte (b2)
    write_byte (b1)
End Function
should be:

Code: Select all

Function write_word(ByVal num As Integer)
    Dim b1 As Byte, b2 As Byte
    Dim l1 As Long
    l1 = num And &HFF00
    b1 = (l1 / &H100) And &HFF
    b2 = num And &HFF
    write_byte (b2)
    write_byte (b1)
End Function


original:

Code: Select all

Function write_int(num As Long)
    Dim b1, b2 As Byte
    Dim l1 As Long
    l1 = num And &HFF00
    b1 = l1 / &H100
    b2 = num And &HFF
    write_byte (b1)
    write_byte (b2)
End Function
should be:

Code: Select all

Function write_int(num As Long)
    Dim b1 As Byte, b2 As Byte
    Dim l1 As Long
    l1 = num And &HFF00
    b1 = (l1 / &H100) And &HFF
    b2 = num And &HFF
    write_byte (b1)
    write_byte (b2)
End Function


a Byte variable cannot have neither negative value nor value greater than 255. e.g. if you give -1 or 256 to a Byte variable, Overflow causes.

Posted: Sat Jul 29, 2006 1:31 am
by TyGuy6
rain` wrote:The neat thing about monster drops is you can have a 0 item drop at the end of the dragon's list, but not the end of a worms list, and the worm will drop items from another monsters designated list (perhaps... maybe only sometimes? :P).
-rain`
Ohhhh. This explains why my worm was dropping 2 screamer slices along with everything else.

:?: But will someone please explain why my rockpile is dropping ra keys (weighing 8.6 kg each) instead of flasks? I'm pretty sure I haven't told any of my monsters to drop ra keys. I haven't even messed with ra keys in ADGE. Or with empty flasks. The rock monster's drop items (all without a check in the "sometimes dropped box") are as follows:
22 EMPTY FLASK
0 -
0 -
0 -
0 -

Posted: Sat Jul 29, 2006 1:20 pm
by Adamo
I noticed:
I have changed one important skeleton attribute in ADGE (in "monster drops" editor). This editor can change things, that certain monster drops every time you kill him. It has 3 slots in for skeletons(although skeleton drops only 2 things: sword and shield), so I tried to fill 3rd slot (marked as "0"). In that case skeleton would THEORETICLY drop: sword, shield and other thing, that have I choosen. But it doesn`t work. When you kill skeleton, the game crashes (BUT!!! maybe you have different experiences???).
It seems that every monster, (that drops items automaticly), have item slot(s), that shows a number of items that he drops + onother one slot, that allways have to be empty.
I think there should be some warning in ADGE not to fill the last slot in "monster drops" editor, because it may cause game problems!
Not a problem for me, because my skeletons are not generated by monster generator on that level, so I can add that thing I want to them manually and it should work fine.[/i]

Posted: Thu Aug 03, 2006 5:40 pm
by TyGuy6
I still want an answer to my question. Why do my rock monsters drop 8.6 kg Ra keys instead of flasks? Anyone know of a way to fix it? Or is it a bug in ADGE and I'll just have to use a different monster or a graphics file that hasn't been bugged?

Posted: Thu Aug 03, 2006 10:50 pm
by Adamo
weird. I tried to reproduce this bug. In my case rockpiles leaves nothing.
Monster drop editor (rock pile) is set on:
22 EMPTY FLASK
0 -
0 -
0 -
0 -


however, you can do it by monster dropping filter. It`s safer and all monsters can leave items, not only rockpiles, dragons etc., but also rives and oitus, etc.

Code: Select all

0S0: L8 L0 &PARAM@ L4 &@ ??{(3,C0)}

0C0: L0 &@ L10 L2 &MONSTER@ L0 L20 &! LA L11 &@ &+ L21 &! L1 &@ L32 &* L2 &@ &+ L32 &* L3 &@ &+ L22 &! JT0

0T0: L15 L22 &@ L20 &@ &DUP &1+ L20 &! L21 &@ L15 L65535 F &DUP L1 &NEG &= ?JT3 &%ADD JT0

0T3: N
it is described here:
http://www.dungeon-master.com/forum/vie ... 02&start=0

Posted: Fri Aug 04, 2006 2:52 am
by TyGuy6
Thanks a lot, Adamo. I think I'll use that filter.

It might be noteable that I changed the picture of the rock pile, as well as some of its stats.

I tried dropping a different item, a water flask, and got a samurai sword, and when I dropped a RA key, I got a RA key. It is interesting to note that a samurai sword (145) - a water flask (17) = 128, and a RA key (object 150) - an empty flask (22) = 128. 128 / 16 = 8, no remainder.

Posted: Fri Aug 04, 2006 2:58 am
by TyGuy6
Also, it seems that only dropping the items #1-32 will add 128 to the object number.

Posted: Fri Aug 04, 2006 12:03 pm
by Adamo
TyGuy6. Remember to put that filter on comnpletely empty 32x32 leve (except the tiles with objects of course) That`ll be saver, especially, if you have some other entries to monster death filter.

Posted: Fri Aug 04, 2006 1:19 pm
by beowuuf
Adamo, I still think you had an error that forced you to have to do this on a completely clear level. The filter as it stands should work when placed anywhere.