Ways to break a lance

Currently viewing this thread:


Ok, aside from the animations not being right yet, one of the last steps I have is to ahve the lances break when a strike is made.  My first idea is to use a particle system to spray some wood fragments.  I assume (haven't checked the code yet) that you can remove a weapon from an agent, so on the lowest level that's what I would do.  BUT if it's possible to replace the weapon in the agent's hand, I would make a broken lance object and place it there.

How possible is this?

Lord Shields

Sergeant at Arms
Can you not break it as a shield would break (only with this it's one hit and it's gone)? From your other posts I take it you're doing an arena type mod. But, if you were to get the coding right to break lances on impact, that might be good for other mods too. I could see using something like that for my shield walls with spears. Then, hopefully the AI switches to another weapon like a sheathed sword.


yup, this is for the jousting part of my new tournament.  I will release the code once it's in good enough shape.

As to breaking like a shield, that would work.  Unfortunately, I would have to use agent operations (troop ones might not work during a mission.  Does anyone know how the picking up of weapons on the field works?  I could hope to tap into this to change the lance.

I need to go look to see if the code for the shield breaking is accessible.  Really looking for a place to start.


OK, I saw a few things on this in some other posts, but I don't think any one looked at the item triggers.

Just looking at this:
["flintlock_pistol", "Flintlock Pistol", [("flintlock_pistol",0)], itp_type_pistol |itp_merchandise|itp_primary ,itcf_shoot_pistol|itcf_reload_pistol, 230 , weight(1.5)|difficulty(0)|spd_rtng(3:cool: | shoot_speed(160) | thrust_damage(41 ,pierce)|max_ammo(1)|accuracy(65),imodbits_none,
[(ti_on_weapon_attack, [(play_sound,"snd_pistol_shot"),(position_move_x, pos1,27),(position_move_y, pos1,36),(particle_system_burst, "psys_pistol_smoke", pos1, 15)])]],
["torch",        "Torch", [("club",0)], itp_type_one_handed_wpn|itp_primary, itc_scimitar, 11 , weight(2.5)|difficulty(0)|spd_rtng(95) | weapon_length(95)|swing_damage(11 , blunt) | thrust_damage(0 ,  pierce),imodbits_none,
[(ti_on_init_item, [(set_position_delta,0,60,0),(particle_system_add_new, "psys_torch_fire"),(particle_system_add_new, "psys_torch_smoke"),(set_current_color,150, 130, 70),(add_point_light, 10, 30),
gave me some ideas.  A lot of people were looking at managing this in the mission template alone, but I'm thinking some of it can be done in the item definition.  Making an item slot for it's damage level, and using the ti_on_weapon_attack trigger.  Thinking you might do some of this also for light sabers in the star wars mod (if it's not done already.  Like having the "blade disapear after a period of time if it's not used, or other cool stuff).

Ya, none of this has to do with what I was doing, but I was looking at using the particle burst and this is what my search brought up (I left the brackets in the strength def, and got errors).  So I will fiddle with this, possibly spawning the broken lance at the hand level and have it drop to the ground, while removing the weapon from your hand.


well, i saw that items have hitpoints and when i set them to 0 nothing happens, its like it was before.. do you have any like trigger if the  hitpoints go down it will fall off? or like check what the shields have, maybe that helps


Well for me, the item tuple won't work since I do a manual attack.  I can't see a way to actually tell the game I'm attacking without leaving it the way it should be.  I did a test with 2 different particle systems.  So now I'm stuck with doing it all in the triggers and called scripts for the mission_template.  Having trouble with the particle systems, can't seem to see the particle I created, but going back and seeing the settings in the BRF for the others.
Top Bottom