Author Topic: [Kit] Fancy Damage Systems (OSP)  (Read 35750 times)

0 Members and 1 Guest are viewing this topic.

MadocComadrin

  • Water-Borne Annelid
  • Count
  • *
  • My legend begins in the 12th Century...
    • Steam - MadocComadrin
    • View Profile
  • Faction: Neutral
  • MP nick: TMW_MadocComadrin
  • M&BWBWF&S
Re: Fancy Damage Systems (OSP)
« Reply #15 on: January 01, 2011, 02:25:47 AM »
Do you know what we can finally do with this? Two words-GAUNTLET WEAPONS! Yes, all those wrist blades, patas, brass knuckles and more can all be done now with two simple item checks!
(⊙︿⊙✿)

xenoargh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Fancy Damage Systems (OSP)
« Reply #16 on: January 01, 2011, 02:39:51 AM »
Dual-wielding, in general, can also now be done, and single bladed gauntlets... heck, even katars that actually work. 

"Shield" that is a weapon mesh, custom animation on strike, some extra random damage... meh, basically, this trigger fixes a lot of stuff, now that it works.

I'll go ahead and do that gauntlet stuff, and spears vs. horses (since that's something that's never ever worked right, imo).  I'll let somebody else figure out dragging people off of horses with polearms (yup) and the other crazy stuff that's possible with this.

dunde

  • Count
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: Fancy Damage Systems (OSP)
« Reply #17 on: January 01, 2011, 02:41:25 AM »
Yes, it works perfectly that way. One more suggestion from me, for troop ID that being played by player is not always trp_player (eg : on custom battle or on rubik's custom commander battles), I think we can use :
(get_player_agent_no":player_agent"),
at beginning and use it as comparation :
(eq, ":troop", "trp_player"), -> (eq, ":agent", ":player_agent"),
(eq, ":attacker_troop", "trp_player"), -> (eq, ":attacker", ":player_agent"),


Oh, and yes, pos0 is absolute.  If you were hoping we'd finally get access to hitbox results... sorry.
I hope we'll get hitbox access on the next patch.

xenoargh

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
Re: Fancy Damage Systems (OSP)
« Reply #18 on: January 01, 2011, 02:46:57 AM »
Glad to hear it's working for you, I was pretty embarrassed that it didn't work right out of the box  :oops:

OK, gotta go party like it's 2011.  I'll do the other stuff I want to get done (gauntlets, spears-vs-horses, oh and stabbing daggers) tomorrow.  It's worth holding off my release another day or two to get the kinks out.

mr.master

  • Count
  • *
  • A Proud Christian, A Member of Knights Of WEe, 6-1
    • View Profile
  • Faction: Neutral
  • MP nick: WEe
Re: Fancy Damage Systems (OSP)
« Reply #19 on: January 01, 2011, 03:40:28 AM »
Dual wielding you say? Interesting.



WookieWarlord

  • Master Knight
  • *
    • View Profile
  • Faction: Nord
  • MP nick: WookieWarlord
  • WBNW
Re: Fancy Damage Systems (OSP)
« Reply #20 on: January 01, 2011, 04:07:44 AM »
When you say critical hits, you must mean a random chance of doing extra damage, not actually hitting an enemy in a critical spot for extra damage.
Because we can't find out what body part we hit, right?

dunde

  • Count
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: Fancy Damage Systems (OSP)
« Reply #21 on: January 01, 2011, 04:18:02 AM »
When you say critical hits, you must mean a random chance of doing extra damage, not actually hitting an enemy in a critical spot for extra damage.
Because we can't find out what body part we hit, right?

Yes, we can. Not so precisely but we can use pos0 to determine what body part hit. I'm doing test on it with this code :
Code: [Select]
test_on_hit = (
  ti_on_agent_hit, 0, 0, [], [
   (store_trigger_param_1, ":agent"),
   (store_trigger_param_2, ":attacker"),
   (store_trigger_param_3, ":damage"),
   (agent_get_troop_id, ":troop", ":agent"),
   (agent_get_troop_id, ":troop_attacker", ":attacker"),
   (str_store_troop_name, s1,":troop"),
   (str_store_troop_name, s2,":troop_attacker"),
   (try_begin),
      (ge, reg0, 0),
      (str_store_item_name, s3, reg0),
   (else_try),
       (str_store_string, s3, '@NO ITEM'),
   (try_end),
   (set_fixed_point_multiplier, 100),
   (position_get_x, reg2, pos0),
   (position_get_y, reg3, pos0),
   (position_get_z, reg4, pos0),
   (assign, reg18, ":damage"),
   (position_get_rotation_around_x, reg5, pos0),
   (position_get_rotation_around_y, reg6, pos0),
   (position_get_rotation_around_z, reg7, pos0),
   (display_message, "@{s1}'s hit by {s2} using {s3} on ({reg2}, {reg3}, {reg4}) angle ({reg5}, {reg6}, {reg7}) resulting {reg18} damage"),
   (agent_get_position,pos1,":agent"),
   (position_transform_position_to_local, pos3, pos1, pos0),
   (position_get_x, reg2, pos3),
   (position_get_y, reg3, pos3),
   (position_get_z, reg4, pos3),
   (position_get_rotation_around_x, reg5, pos3),
   (position_get_rotation_around_y, reg6, pos3),
   (position_get_rotation_around_z, reg7, pos3),
   (display_message, "@transforming to local  ({reg2}, {reg3}, {reg4}) angle ({reg5}, {reg6}, {reg7})"),
])
Hoping anybody help me to find the pos3 relation with bodypart. As body and head dont not move so much  compared to hand, then I think we can easily detect chest and head hit somehow.

Somebody

  • Code Pope
  • Baron
  • *
    • View Profile
  • Faction: Bandit
  • WBWF&S
Re: Fancy Damage Systems (OSP)
« Reply #22 on: January 01, 2011, 05:32:41 AM »
Use position_get_distance_to_ground_level, which should return a reliable height between 0 and 175?
I was already trying to get dual-wielding to work with agent_un/equip_item, but that didn't work well due to the slots filling up, etc. I already have a rudimentary blunderbuss (sort of) working, and unique weapons which track damage and amount of kills (playing particle effects with burst strength depending on amount of overkill), which can probably be made upgradeable or something. Also working on a lance breaking script, now that agent_get_speed is also available.

rabican

  • Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WB
Re: Fancy Damage Systems (OSP)
« Reply #23 on: January 01, 2011, 06:27:13 AM »
agent_deliver_damage_to_Agent
triggers on_agent_hit  trigger.
if you use agent_deliver_damage_to_agent  in on_agent_hit it will deal exactly same damage as the original hit. it will also crash the game if you don't do anythjinga about the endless loop it would create

agent_set_hit_points operation will actually kill the agent properly if used in on_agent_hit  trigger. if hps are set to 0 that is. usually  it wont kill but it will kill in this  trigger


on_agent_hit param 3(damge) seems to call damage delivered, not damage received.damage before it got reduced by armor.


suprising things i found out while testing m&b module system  on new years eve.

Somebody

  • Code Pope
  • Baron
  • *
    • View Profile
  • Faction: Bandit
  • WBWF&S
Re: Fancy Damage Systems (OSP)
« Reply #24 on: January 01, 2011, 06:46:06 AM »
We already found most of those out. The reason using agent_set_hit_points to 0 will work in this trigger is because it fires and intercepts the hit before any damage is inflicted by the game engine to the agent. However, we cannot influence the results via set_trigger_result or manipulating the values of reg0/pos0. If you output parameter three, it will display before the hardcoded damage notification (albeit the value is truncated instead of rounded).

dunde

  • Count
  • *
  • Curious Coder of The Vision
    • View Profile
  • Faction: Swadian
  • WB
Re: Fancy Damage Systems (OSP)
« Reply #25 on: January 01, 2011, 06:49:51 AM »
it will display before the hardcoded damage notification (albeit the value is truncated instead of rounded).

Yes, you're right. It's not about armor nor speed bonus. It's just about truncated and rounded things. The hardcoded damage display is always the same or 1 above the 3rd trigger parameter.

rabican

  • Knight at Arms
  • *
    • View Profile
  • Faction: Neutral
  • WB
Re: Fancy Damage Systems (OSP)
« Reply #26 on: January 01, 2011, 07:10:10 AM »
ah sorry, my english isn't too good, and i didn't understand what you said about hardcoded  damage notifaction. could you rephrase that in idiot-talk (sorry). edit: ah yeah srry, upon further testing i sort of get it now! yeah nothing to do with armor values, i stupidly assumed because the hardcoded damage display didn't match the param 3 1:1 . thanks for correcting

i wish there was some more indepth descriptions about the triggers/operations somewhere in these forums(or somwhere, i'm pretty blind so i probaly just missed them posts ) . i just spent ~5 hours testing these things :)     (

The reason using agent_set_hit_points to 0 will work in this trigger is because it fires and intercepts the hit before any damage is inflicted by the game engine to the agent.

Humm... this means that i could use it to  sort of increase agent hit points beyond the normal limits pretty easily, right? With 1 agent slot, and agent_set_hit_points..  would agent still die if it died in one hit? don't think there is way to negate the damage done even with this? 

sorry for not being  coherent
« Last Edit: January 01, 2011, 07:26:16 AM by rabican »

MadocComadrin

  • Water-Borne Annelid
  • Count
  • *
  • My legend begins in the 12th Century...
    • Steam - MadocComadrin
    • View Profile
  • Faction: Neutral
  • MP nick: TMW_MadocComadrin
  • M&BWBWF&S
Re: Fancy Damage Systems (OSP)
« Reply #27 on: January 01, 2011, 08:23:22 AM »
i wish there was some more indepth descriptions about the triggers/operations somewhere in these forums(or somwhere, i'm pretty blind so i probaly just missed them posts ) . i just spent ~5 hours testing these things :)     (

I agree, we could use a collective community documentation of the system. Unfortunately, people have made wikis before and all of them have flopped. We could also use some more developer documentation.
(⊙︿⊙✿)

Lumos

  • Probably Not a Help Desk
  • Moderator
  • *
  • Mens INsana in corpore sano
    • Steam - lumosx
    • YouTube - LumosX
    • View Profile
  • Faction: Nord
  • WBWF&SNWM&BVC
Re: Fancy Damage Systems (OSP)
« Reply #28 on: January 01, 2011, 11:07:33 AM »
I agree, we could use a collective community documentation of the system. Unfortunately, people have made wikis before and all of them have flopped. We could also use some more developer documentation.
I've been thinking about a wiki for a while now... We have a lot of modders (as we can see from this single thread) that are able to contribute, but still it'll require maintenance, etc. = free time, which I believe that few of us have to spare. It'd be awesome if we had one, though. :)

About dual wielding I've always had ideas, and now this trigger presents the possiblity... My Old Tzardom's Dual Swordsmen would behave like they should.

Use position_get_distance_to_ground_level, which should return a reliable height between 0 and 175?
Why only to 175 and what happens when the agent is underwater? We could also make water soften hits (the lack of this is one thing I hate in Warband) when you're not falling on it from 15 m or something.

Urist

  • Master Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Urist
  • M&BWB
Re: Fancy Damage Systems (OSP)
« Reply #29 on: January 01, 2011, 11:15:04 AM »
With comparing the hit location/rotation with the victim's location/rotation one can even make a (guess based) script that finds out which body part was hit. Probably useful for critical hits, allowing to bring damage simulation one step closer to the level of Dwarf Fortress.

In my crappy test script every hit higher than 1.5m was declared as a head hit.

(click to show/hide)


Do you know what we can finally do with this? Two words-GAUNTLET WEAPONS! Yes, all those wrist blades, patas, brass knuckles and more can all be done now with two simple item checks!

The problem is that kicks and punches have the same source number: -1. So punches and kicks can't be discerned easily. Maybe checking the inflictor's current animation (if possible) may help here though.
« Last Edit: January 01, 2011, 11:43:32 AM by Urist »