OSP Code Combat Deployable Pavise Shield (Multiplayer 6/6/2010)

Users who are viewing this thread

grailknighthero said:
Nice work!  And it may be possible for npcs to deploy them, just getting them to stand behind them will be a problem.
He could extend the "move here", "stand ground" and "follow me" orders to make the NPCs deploy/collect the pavise shields. I don't know if the movement commands are hard coded, though.
 
grailknighthero said:
Nice work!  And it may be possible for npcs to deploy them, just getting them to stand behind them will be a problem.

As I was saying... You could easily code a AI behavior to "press h" but getting them to use cover :shock:
 
Thanks some more guys.  It still only works for the player in Warband.  I'll work on getting it destructable.

GetAssista said:
Cartread said:
I'll test it for M&B ...
Don't bother. This does not work in 1.011: (spawn_scene_prop, "spr_pavise"),#pavise spawn
Ah, it is still commented out.  I was waiting for it back at .808; however, it can be worked around if the scene prop is always in the scene.
If anyone really needs it for M&B rather than Warband, tell me.

Austupaio said:
Galtran has a good point, if your shield takes a good hit, and let's say only takes 99% damage, you can pick it up, drop it again and it'll be restored.

If you ask me, the shield should just be dropped once in multiplayer. This would be an easy fix, and for one battle, people don't need to be carrying the shield and dropping it all about.
Good points.  Making the scene prop damaged is easy enough because of scene_prop_set_hit_points.
I don't see an easy way to set item (shield) damage, but it is possible to spawn modified shields or different shields depending on damage.
Having it only deployable once may be the best way if there are complications getting it to work in multiplayer.
 
Just pure awesomeness!
Few suggestions:
-change un-deploying from area effect to "use", like with doors, and allow everyone to do it (and if possible add kicking animation while doing it :grin:). Or just make it that every kick, weapon hit (except projectiles) or horse bump change its status to normal item.
-we have 4 pavaises (board shields) in mp, so maybe copypaste code so all of them can work like "pavise"
 
CalenLoki said:
-change un-deploying from area effect to "use", like with doors, and allow everyone to do it (and if possible add kicking animation while doing it :grin:). Or just make it that every kick, weapon hit (except projectiles) or horse bump change its status to normal item.
Na, bad idea. I'd rather have it a much more permanent item that can only be destroyed by weapons.
 
But pavise is not designed as close combat barrier. If you want some anti inf/cav protection, better to add either stakes (deploying take time, like opening portcullis) or basket with stones (take even more to deploy). Making pavise magically glued to ground and allowing only owner to pick it up is a bit... weird.
 
Cartread said:
however, it can be worked around if the scene prop is always in the scene.
Yeah, and you have to place that prop in ALL the scenes where the battle can take place in MB. Amount of work hardly worth it for a pavise that only player can deploy. And you can't place enough props for AI anyway (well, maybe 200 will do), not to mention coding the AI part, which should have its own problems. It you ever want to code AI to use it, that is :smile:
 
Awesome stuff! How do the AI fare with this? Are they able to also deploy their pavise shields or is this only compatible with a human player?
 
GetAssista said:
Cartread said:
however, it can be worked around if the scene prop is always in the scene.
Yeah, and you have to place that prop in ALL the scenes where the battle can take place in MB. Amount of work hardly worth it for a pavise that only player can deploy. And you can't place enough props for AI anyway (well, maybe 200 will do), not to mention coding the AI part, which should have its own problems. It you ever want to code AI to use it, that is :smile:

What's more there is no operation to make the shield disappear from players hands...
 
Works fine in MP! Just one thing, a player can only deploy one shield. I'm not sure if it's possible to have more than one player deploying it. Hopefully you can.

Thanks Cartread!
 
Slawomir of Aaarrghh said:
GetAssista said:
Cartread said:
however, it can be worked around if the scene prop is always in the scene.
Yeah, and you have to place that prop in ALL the scenes where the battle can take place in MB. Amount of work hardly worth it for a pavise that only player can deploy. And you can't place enough props for AI anyway (well, maybe 200 will do), not to mention coding the AI part, which should have its own problems. It you ever want to code AI to use it, that is :smile:

What's more there is no operation to make the shield disappear from players hands...

Wouldn't agent_unequip_item remove the item from their inventory? I know that in the tavern fights, the game would switch your item to the next non-ranged weapon. Unequiping it after, or directly set the weapon slot to -1 to make the script a one-time check on shield prop destruction instead of a constant check.
Code:
(get_player_agent_no, ":player_agent"),
(assign, ":default_item", -1),
    (agent_get_wielded_item, ":wielded_item", ":player_agent", 0),
    ...
    (assign, ":default_item", -1),
    (troop_get_inventory_capacity, ":end_cond", "trp_player"), 
    (try_for_range, ":i_slot", 0, ":end_cond"),
      (troop_get_inventory_slot, ":item_id", "trp_player", ":i_slot"),
      
      (is_between, ":item_id", weapons_begin, weapons_end),
      (neg|is_between, ":item_id", ranged_weapons_begin, ranged_weapons_end),
      
      (assign, ":default_item", ":item_id"),
      (assign, ":end_cond", 0), #break
    (try_end),
    
    (agent_set_wielded_item, ":player_agent", ":default_item"),
Not sure if this would apply to multiplayer.
 
Updated 6/2/2010: now unlimited pavise can be spawned Singleplayer Warband (code on 1st post updated)

Alec: I noticed that and fixed it :smile:

-change un-deploying from area effect to "use", like with doors, and allow everyone to do it (and if possible add kicking animation while doing it :grin:). Or just make it that every kick, weapon hit (except projectiles) or horse bump change its status to normal item.
CalenLoki: I believe all that the F key does is hardcoded (talking, opening doors).

Somebody: they are talking about the problems of getting it to work for normal M&B.

GetAssista & Slawomir of Aaarrghh: not looking good for normal M&B.
The extent that is reasonable for the pavise in M&B would be the player being able to deploy 1.
 
Just a small note, if you have 2/3 Pavise shields on you, when you press G, it drops all three shields into the one scene prop. A nice punishment for using more than one shield, but still a weird issue. :grin:
 
You can replace the 2
(agent_unequip_item, ":player_agent", "itm_pavise"),
with
(agent_set_wielded_item, ":player_agent", 0, 1),
but this drops AND props one...
I'm sticking with what I have. :smile:
 
Back
Top Bottom