OSP Code Combat Spear Bracing Kit (Updated)

Users who are viewing this thread

hey jik,

when you say the predefined triggers do you mean the pilgrim_disguise trigger and the af_castle_lord trigger so the code goes right below those two?
I'm not a very experienced coder what are the agent_slots slot definitions and where would they go? I understand what you are saying about only needing to list the nine triggers in the separte mt battle tuples though.
 
Berserker Pride said:
hey jik,

when you say the predefined triggers do you mean the pilgrim_disguise trigger and the af_castle_lord trigger so the code goes right below those two?
I'm not a very experienced coder what are the agent_slots slot definitions and where would they go? I understand what you are saying about only needing to list the nine triggers in the separte mt battle tuples though.

Yup, right there would work.  Anywhere between there and above:

mission_templates = [

then in the templates you want to be able to use it (such as with the charge mission_template) you need to add the constant names with the other triggers.

The agent slots go in the module_constants.py.  Search for agents, the area is clearly marked.
 
is there any way to know how to put it to a specific unit (or item and then assign the item to that unit? and make it unique?)
 
You could make the item unique to a specific troop which would mean that only a specific troop can use the option...

If you look at the code, they check for the weapon(s) allowed to be used.  Adjust that to only be the weapon(s) you want to use the spear brace, such as pikes.
 
Ummm define brace please?
I don't see what bracing a weapon would look like (and its utility) :roll:

sorry, sometimes i just don't understand...
 
Leopardo said:
Ummm define brace please?
I don't see what bracing a weapon would look like (and its utility) :roll:

sorry, sometimes i just don't understand...
Bracing a polearm is an infantry tactic to prevent cavalry from crashing into their lines.  You basically take a reasonably long weapon, stick it in the ground and raise it at an angle toward the charging horsies.  If braced well, the horse and often rider will impale themselves on the weapons and have a generally bad day. 
 
Code:
get_player_agent_no                    = 1700	# (get_player_agent_no,<destination>),
get_player_agent_kill_count            = 1701	# (get_player_agent_kill_count,<destination>,[get_wounded]), #Set second value to non-zero to get wounded count. returns lifetime kill counts
agent_is_alive                         = 1702	# (agent_is_alive,<agent_id>),
agent_is_wounded                       = 1703	# (agent_is_wounded,<agent_id>),
agent_is_human                         = 1704	# (agent_is_human,<agent_id>),
get_player_agent_own_troop_kill_count  = 1705   # (get_player_agent_own_troop_kill_count,<destination>,[get_wounded]), #Set second value to non-zero to get wounded count
agent_is_ally                          = 1706	# (agent_is_ally,<agent_id>),
agent_is_defender                      = 1708	# (agent_is_defender,<agent_id>),
agent_get_look_position                = 1709   # (agent_get_look_position, <position_no>, <agent_id>),
agent_get_position                     = 1710	# (agent_get_position,<position_no>,<agent_id>),
agent_set_position                     = 1711	# (agent_set_position,<agent_id>,<position_no>),
agent_get_horse                        = 1714	# (agent_get_horse,<destination>,<agent_id>),
agent_get_rider                        = 1715	# (agent_get_rider,<destination>,<agent_id>),
agent_get_party_id                     = 1716	# (agent_get_party_id,<destination>,<agent_id>),
agent_get_entry_no                     = 1717	# (agent_get_entry_no,<destination>,<agent_id>),
agent_get_troop_id                     = 1718	# (agent_get_troop_id,<destination>, <agent_id>),
agent_get_item_id                      = 1719	# (agent_get_item_id,<destination>, <agent_id>), (works only for horses, returns -1 otherwise)

store_agent_hit_points                 = 1720	# set absolute to 1 to retrieve actual hps, otherwise will return relative hp in range [0..100]
						# (store_agent_hit_points,<destination>,<agent_id>,[absolute]),
agent_set_hit_points                   = 1721	# set absolute to 1 if value is absolute, otherwise value will be treated as relative number in range [0..100]
						# (agent_set_hit_points,<agent_id>,<value>,[absolute]),
agent_deliver_damage_to_agent          = 1722	# (agent_deliver_damage_to_agent,<agent_id_deliverer>,<agent_id>),
agent_get_kill_count                   = 1723   # (agent_get_kill_count,<destination>,<agent_id>,[get_wounded]), #Set second value to non-zero to get wounded count
agent_get_wielded_item                 = 1726	# (agent_get_wielded_item,<destination>,<agent_id>,<hand_no>),
agent_get_ammo                         = 1727	# (agent_get_ammo,<destination>,<agent_id>),
agent_refill_ammo                      = 1728	# (agent_refill_ammo,<agent_id>),
agent_has_item_equipped                = 1729	# (agent_has_item_equipped,<agent_id>,<item_id>),

Basically the agents. You need the deliver damage to agent, get wielded item, has item equipped...umm, just stick them all in. Override the agents with it.
 
The Mercenary said:
Code:
get_player_agent_no                    = 1700	# (get_player_agent_no,<destination>),
get_player_agent_kill_count            = 1701	# (get_player_agent_kill_count,<destination>,[get_wounded]), #Set second value to non-zero to get wounded count. returns lifetime kill counts
agent_is_alive                         = 1702	# (agent_is_alive,<agent_id>),
agent_is_wounded                       = 1703	# (agent_is_wounded,<agent_id>),
agent_is_human                         = 1704	# (agent_is_human,<agent_id>),
get_player_agent_own_troop_kill_count  = 1705   # (get_player_agent_own_troop_kill_count,<destination>,[get_wounded]), #Set second value to non-zero to get wounded count
agent_is_ally                          = 1706	# (agent_is_ally,<agent_id>),
agent_is_defender                      = 1708	# (agent_is_defender,<agent_id>),
agent_get_look_position                = 1709   # (agent_get_look_position, <position_no>, <agent_id>),
agent_get_position                     = 1710	# (agent_get_position,<position_no>,<agent_id>),
agent_set_position                     = 1711	# (agent_set_position,<agent_id>,<position_no>),
agent_get_horse                        = 1714	# (agent_get_horse,<destination>,<agent_id>),
agent_get_rider                        = 1715	# (agent_get_rider,<destination>,<agent_id>),
agent_get_party_id                     = 1716	# (agent_get_party_id,<destination>,<agent_id>),
agent_get_entry_no                     = 1717	# (agent_get_entry_no,<destination>,<agent_id>),
agent_get_troop_id                     = 1718	# (agent_get_troop_id,<destination>, <agent_id>),
agent_get_item_id                      = 1719	# (agent_get_item_id,<destination>, <agent_id>), (works only for horses, returns -1 otherwise)

store_agent_hit_points                 = 1720	# set absolute to 1 to retrieve actual hps, otherwise will return relative hp in range [0..100]
						# (store_agent_hit_points,<destination>,<agent_id>,[absolute]),
agent_set_hit_points                   = 1721	# set absolute to 1 if value is absolute, otherwise value will be treated as relative number in range [0..100]
						# (agent_set_hit_points,<agent_id>,<value>,[absolute]),
agent_deliver_damage_to_agent          = 1722	# (agent_deliver_damage_to_agent,<agent_id_deliverer>,<agent_id>),
agent_get_kill_count                   = 1723   # (agent_get_kill_count,<destination>,<agent_id>,[get_wounded]), #Set second value to non-zero to get wounded count
agent_get_wielded_item                 = 1726	# (agent_get_wielded_item,<destination>,<agent_id>,<hand_no>),
agent_get_ammo                         = 1727	# (agent_get_ammo,<destination>,<agent_id>),
agent_refill_ammo                      = 1728	# (agent_refill_ammo,<agent_id>),
agent_has_item_equipped                = 1729	# (agent_has_item_equipped,<agent_id>,<item_id>),
Basically the agents. You need the deliver damage to agent, get wielded item, has item equipped...umm, just stick them all in. Override the agents with it.

I think you miss understood my initial request.  You must have defined some new slots, because you call a few that don't exist in native.  Those who try to add this with out basic knowledge of slots will never get it to work...
 
the header_operations stuff is not necessary as I'm fairly sure you guys didn't change anything there since that would pretty much be impossible and wouldn't accomplish anything.

The stuff you want is in module_constants.py and it's the extra slots which you're using.

Haven't tried the code but it looks very cool. Thanks for sharing!
 
slot_agent_spearwall = 142
slot_agent_x = 143
slot_agent_y = 144
slot_agent_z = 145
slot_agent_speed = 146

Stick that in somewhere in module_constants.
 
Awesome TheMercenary thanks for the update.  I just have a couple questions.  I had to tab out global variables $rout and $airout because they weren't defined anywhere. I also assigned $setting_use_spearwall to 1 in the first trigger so that it was defined.  The last problem I have is that anim_spearwall_hold is not defined anywhere.  How do I add that to brf's?
 
Berserker Pride said:
Awesome TheMercenary thanks for the update.  I just have a couple questions.  I had to tab out global variables $rout and $airout because they weren't defined anywhere. I also assigned $setting_use_spearwall to 1 in the first trigger so that it was defined.  The last problem I have is that anim_spearwall_hold is not defined anywhere.  How do I add that to brf's?

Ya I PMed him on the animation thing, but I guess he didn't get it in time. 

the $rout and $airout look to be from chel's moral mod, though I'd have to go over the 2 kits to see for sure.
 
jik said:
the $rout and $airout look to be from chel's moral mod, though I'd have to go over the 2 kits to see for sure.

I can confirm that.  If you're not using Che's morale kit, then you can just comment out those parts that relate to morale.
 
jik said:
Berserker Pride said:
Awesome TheMercenary thanks for the update.  I just have a couple questions.  I had to tab out global variables $rout and $airout because they weren't defined anywhere. I also assigned $setting_use_spearwall to 1 in the first trigger so that it was defined.  The last problem I have is that anim_spearwall_hold is not defined anywhere.  How do I add that to brf's?

Ya I PMed him on the animation thing, but I guess he didn't get it in time. 

the $rout and $airout look to be from chel's moral mod, though I'd have to go over the 2 kits to see for sure.

You PMed "him"?

Check the OP for animations. It's been there since I made the last post.
 
Back
Top Bottom