New Jousting (just need animation!)

Users who are viewing this thread

jik

Knight
I already have my lances that don't crouch, and the scene.  Now I have to work the machanics. 

1 pass should be easy, I'll see if I can start a timer once one jouster passes the middle line.  If the other jouster didn't pass a marker, then it's counted as a forfit.  If niether strike, it's a missed pass. 

On striking, I need to be able to check if it was a head hit or not.  Also hits to the horse need to be recorded.  Can I adjust the damage done at the point in time that there is a head or horse hit?  Can any one tell me if that is possible?  Right now it will be hard because you will have to time your thrust.  Not sure how I will work unhorsing someone with a proper strike.  Any ideas?  Can I time from when the swing is called to when contact takes place?  I could do it based on good timing...

In most cases it will be 3 passes, most lances broken wins.  But in some cases (horse strike, head strike, or unhorsed) it could end in one pass.  Due to the nature of the sport, head strikes and horse strikes are frowned uppon, but stuff happens.  In some cases you will lose honor and renown if it was thought of as on purpose (chance based on relation with the target and frequency).

My biggest issue may be the AI.  Could I tell it to strike the horse or attempt a head shot? 
 
I'm rather new at the combat stuff and what can be pulled (information wise) from what is happening.  I'm going to go through a bit of the spear brace code, as it should be calling on some of the stuff I need to check (such as hitting the horse, possibly?). 

Any help from combat code vetrans would be a great help!
 
Jik, I'd love to help you, but I have nothing to offer!  Sorry.  Hopefully some of those "vets" you're talking about will chime in.
 
Something else to note. That even without the couched lance, it is relatively easy, or even easier, to land a hit with a lance. Once extended, the lance will do couched damage and you have more control over direction.
 
Septa Scarabae said:
Something else to note. That even without the couched lance, it is relatively easy, or even easier, to land a hit with a lance. Once extended, the lance will do couched damage and you have more control over direction.

That's only if you are running straight at the enemy, and it is too easy that way.  In my joust you will have to thrust the attack (I got the weapon ready so it only has a thrust action, and no couch) so timing will be a part of it.  Just hope the AI can handle the action.  I'll check his code and see what I can do with it.
 
OK, the AI is not co-operating...  I need them to run down the line.  So I am trying to tell them where to go with a trigger.  So I set this up:

(1,0, ti_once, [],  ###Make AI go to a specific entry point (charging along the list)
[(get_player_agent_no,":p_agent"),
(try_for_agents, ":cur_agent"),
(neg, ":cur_agent", ":p_agent"),                ##Player should know what to do them selves
(agent_get_team, ":cur_team",":cur_agent"),    ##Get the team.  Team one moves to entry point 50, team two moves to entry point 51
(try_begin),
(eq,":cur_team",0),
(entry_point_get_position,pos1,50),        ##team 0 goes from entry point 0 to entry point 50
(else_try),
(entry_point_get_position,pos1,51),        ##team 1 goes from entry point 1 to entry point 51
(try_end),
(agent_set_scripted_destination,":cur_agent",pos1,1), ##Tell AI agent to go to entry point at pos1
(try_end),
]
),

But when the trigger activates, I get an error that crashes the game.  Am I using the operations wrong here?
 
one thing i noticed (not sure if im right),  the blue! it says from pos1 to 50 and the other one says from pos1 to 51 (so wouldnt that be spawning in the same position?) not sure...maybe im mistaken.

  (1,0, ti_once, [],  ###Make AI go to a specific entry point (charging along the list)
        [(get_player_agent_no,":p_agent"),
          (try_for_agents, ":cur_agent"),
            (neg, ":cur_agent", ":p_agent"),                ##Player should know what to do them selves
            (agent_get_team, ":cur_team",":cur_agent"),    ##Get the team.  Team one moves to entry point 50, team two moves to entry point 51
            (try_begin),
              (eq,":cur_team",0),
              (entry_point_get_position,pos1,50),        ##team 0 goes from entry point 0 to entry point 50
            (else_try),
              (entry_point_get_position,pos1,51),        ##team 1 goes from entry point 1 to entry point 51
            (try_end),
            (agent_set_scripted_destination,":cur_agent",pos1,1), ##Tell AI agent to go to entry point at pos1
          (try_end),
        ]
      ),


Edit: shouldn't it be like this?

(entry_point_get_position,pos0,50),        ##team 0 goes from entry point 0 to entry point 50
 
They won't charge if you force them to move in a certain direction. Janus just let them do their thing, they couch by default.
 
fisheye said:
They won't charge if you force them to move in a certain direction. Janus just let them do their thing, they couch by default.

Ah well, I guess then guide them with AI mesh?  They don't always co-operate.  Well, OK leave them to move on their own.  Can I at least force them to strike at a specific time/range with a melee weapon?




MISHO, no I need them both to be pos1.  I was checking where the agent was starting from.  In either case I would want it to be marked by pos1, but that code is now scrapped.
 
No need to guide them. If you're the only troop on the field, and they're on horse with a sharp pointy stick some distance away, they will always gallop straight towards you and try to couch you on the first attack. After the first attack fails, then they might do the hokey ride-in-circles-and-poke bull****... that's why Janus ended the match after about 10 seconds. On the whole it worked really well, the only problem being that couching is ridiculously easy in M&B so the player almost always wins. You should download it and check it out. Septa has uploaded a version of Arenamod for 1.01.

For the melee weapon thing, dudes with a polearm and a melee weapon will take out the melee weapon if unhorsed or at a standstill (totally not moving on horse). Other than that, can't control it. Janus made a separate mission for the melee phase. Again, highly recommended you check it out.
 
fisheye said:
No need to guide them. If you're the only troop on the field, and they're on horse with a sharp pointy stick some distance away, they will always gallop straight towards you and try to couch you on the first attack. After the first attack fails, then they might do the hokey ride-in-circles-and-poke bull****... that's why Janus ended the match after about 10 seconds. On the whole it worked really well, the only problem being that couching is ridiculously easy in M&B so the player almost always wins. You should download it and check it out. Septa has uploaded a version of Arenamod for 1.01.

For the melee weapon thing, dudes with a polearm and a melee weapon will take out the melee weapon if unhorsed or at a standstill (totally not moving on horse). Other than that, can't control it. Janus made a separate mission for the melee phase. Again, highly recommended you check it out.

I have, and I am trying to avoid the couch lance attack.  I have made a lance that won't couch, and can only thrust, and on tests the AI sometimes takes a poke at me.  The thing is it doesn't always happen.

If I can force the AI to strike at a specific distance (or range of distance - say with a 210 range weapon, swing at 210(+/- 30), then I can possible work the idea I have...
 
Ok,

New strategy.  I decided that since I will control the AI I will make him charge to the end.  That is working.
I will force him to ready, and release the thrust at a varied time.  Seems to be working, though I still cannot get the thrust to be on horseback...
With the above I will use the AI's polearm skill to better time the attack. 

Now I need to cause damage from the strike.  This needs to be based off of timing.  I will be working that out.  I have an "optimum" distance defined for a "perfect" hit.  If the release finishes at that time, and you are facing your opponent, he will be unhorsed.  After that if will be a percentage chance, which will also be increased by the polearm skill.

I'm hoping that I can change the lance to a broken lance and have a nice particle affect on the hit.  I'm sure I can do the latter, and just remove the item if needed.

What I need to know is does anyone know how to tell if a hit is a head hit (high) or a horse hit (low). 

I'm having an error pop up, so I will post the code once I get that cleared...  I'm not sure where it is happening...
 
Ya, well, I'm still working out some of the bugs and all the numbers are test numbers but here:

##AI triggers 
(0.1,0,0, [],  ##Attempt to force strike animation  Range of lance is 210
[(get_player_agent_no,":player"),
#(assign,":stop_trig",0),              ##this is my stop the trigger variable.
(assign, ":striker",-1),
(try_for_agents,":cur_agent"),
(agent_is_alive,":cur_agent"),
(agent_is_human,":cur_agent"),
(neq, ":cur_agent",":player"),    ##do not force the player
(assign,":striker",":cur_agent"),  ##this is an AI Jouster
(try_end),
(gt,":striker",-1),                                      ##FAILSAFE : if you have not found one, exit out.
(neg|agent_slot_eq,":striker",slot_agent_jousting,-1),  ##FAILSAFE : They have not already thrusted and passed by
(agent_get_slot,":victim",":striker",slot_agent_joust_victim),
(gt,":victim",-1),                  ##FAILSAFE : need a victim too, or exit out.           
(agent_get_position,pos1,":striker"),
(agent_get_position,pos2,":victim"),
(get_distance_between_positions,":strike_range",pos1,pos2),
(neg|position_is_behind_position,pos1,pos2),
(le,":strike_range",1201),          ##FAILSAFE : no need for actions too far away
(assign, reg6, ":strike_range"),
(display_message,"@Current range is {reg6}"),
(try_begin),
(is_between,":strike_range",301, 1200),                  ##ready range, should be something like 300, 1200
(agent_set_animation, ":striker", "anim_ready_thrust_onehanded_lance"),
(try_end),
(le,":strike_range",300),          ##FAILSAFE : only need to strike at the right distance
#(assign,":strike_release",-1),
(display_message,"@TEST - UNDER 300 cm!"),
(agent_get_slot,":strike_release",":cur_agent",slot_agent_jousting), 
(assign,reg5,":strike_release"),
(display_message,"@AI PREPARING STRIKE at range {reg5}"),
(try_begin),
(le,":strike_range",":strike_release"),      ##release range should be between 210 and 300.
(agent_set_animation, ":striker", "anim_release_thrust_onehanded_lance"),
(agent_set_slot,":striker",slot_agent_jousting,-1),      ##they have thrusted, no more chances
(display_message,"@AI struck at {reg5} cm."),
(try_end)
]
),

I think I need to make the release range further back, would be nice to test with the proper animation, but I can't seem to get this down...  How the hell do I call the horseback thrust animation so that the body doesn't move down to the ground without creating a new animation?  Is there a hidden flag with animations?
 
Mordachai said:
Jik, sounds like you're making awesome progress (I figured you for tilting at windmills on this one!) :wink:

Call me Don quotie (or how ever it's spelled)

Still need help with the animations...  Dain Ironfoot started to help me in the right direction, but I'm still stuck with my below question:

I will force him to ready, and release the thrust at a varied time.  Seems to be working, though I still cannot get the thrust to be on horseback...

I also get an error in the above listed trigger.  Still working that out, though all else seems to work...
 
jik said:
Call me Don quotie (or how ever it's spelled)

Don Quixote. If you give them a shield, and they try to thrust, is the timing too far off? I ran into a problem in the Arena Expansion, where when the troop at a shield, they always tried to poke instead of couch.
 
Back
Top Bottom