(fixed) Methods bugs (renderer and throw method)

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.
Post Reply
User avatar
Joramun
Mon Master
Posts: 925
Joined: Thu May 25, 2006 7:05 pm
Location: The Universe

(fixed) Methods bugs (renderer and throw method)

Post by Joramun »

Method throw : (it was already there in DSB 0.22)
- Idle time for method throw is wrong or misplaced in the function :
the hand become available BEFORE the ammo is grabbed, so you can punch/kick/warcry while or after the ammo is grabbed, if you click fast.
I suggest to grab ammo instantly after having set the hand idle, or to get the idle time right if it's not.

Damage pop-up : (new renderer issue)
- After dealing damage, the name of the attacking character pops up for a fraction of a second in the method renderer (like when the method menu of the character is called). It's weird because it often happens when the player is already clicking on the other character's hand to call its attack menu, so you get a display like : damage / iaido (for a fraction of a second) / syra (method menu).
- It doesn't happen when the character deals no damage / attack fails.

Suggestion : aside from that, I would add a "miss" text when an attack fails. It would add some info and "even" the execution time of both failed and succeeded attack. Also, it could lead to new features like "critical miss" etc.
What Is Your Quest ?
Remy
Craftsman
Posts: 111
Joined: Wed Sep 05, 2007 5:24 pm
Contact:

Post by Remy »

Method throw : (it was already there in DSB 0.22)
- Idle time for method throw is wrong or misplaced in the function :
the hand become available BEFORE the ammo is grabbed
This is a result in what looks like a good idea on the surface, but creates this abnormality. The idea behind this setup, I think, is that if you have the ammo in your left hand, you can attack faster than if the champion has to go digging around in their quiver.

See, here's the code (from \base\methods.lua : method_throw_obj()

Code: Select all

869: dsb_set_idle(ppos, 5)
870:
871: look_for_more_throwing_ammo(who, 10)
Notice the delay is set to 5, but look_for_more_throwing_ammo uses a delay of 10.
In that function, we see:

Code: Select all

884: dsb_msg(delay/2, lhand, M_GRABMOREAMMO, who)
885: search_quiv_for_ammo(who, delay, INV_L_HAND, nil)
...
890: return(search_quiv_for_ammo(who, delay, INV_R_HAND, nil))

See, if it pulls ammo from the left hand, it sends a msg to pull the ammo in delay / 2 ticks (which is normally 5) - so that the idle time ends when the message arrives and the ammo is flipped.
But if there isn't ammo there (and for ammo pulled to replace that in the left hand), the delay isn't cut, so it's 10 - which means the ammo doesn't arrive until 5 ticks after the idle ends. What should happen is that if ammo isn't found is the left hand, another dsb_set_idle() should be called, to further extend the idle, like this:

Code: Select all

890:   dsb_set_idle(dsb_char_ppos(who), delay) --<< New line
891:   return(search_quiv_for_ammo(who, delay, INV_R_HAND, nil))
Normally, you should probably use dsb_get_idle to check if there's already been a tick, but since the search_quiv_for_ammo is called with the same 'delay' right after, the two might not match.
Suggestion : aside from that, I would add a "miss" text when an attack fails.
This isn't how FTL DM did it, so I understand why it's not done in the normal script. However, it's easy to create:

Code: Select all

old_failed_attack = failed_attack
function failed_attack(who, ppos, info)
   old_failed_attack(who, ppos, info)
   dsb_attack_text("MISS")
end
User avatar
Sophia
Concise and Honest
Posts: 4240
Joined: Thu Sep 12, 2002 9:50 pm
Location: Nowhere in particular
Contact:

Post by Sophia »

I've fixed the issue with the new renderer.

As for the thrown item bug, RemyR has proposed a good quick fix, but the real fix is rewriting the system for grabbing ammo, which I've done for 0.24. There were a lot of constants, and now that DSB allows the entire inventory to be rearranged and attack methods to be invoked from anywhere, some of those constants aren't so constant. :)
(In addition, I wanted to make it easier to create something like the DM2 quiver, if someone feels like doing that)
Post Reply