Author Topic: [WB, SP, Code] Order: Volley Fire! (Open Source)  (Read 17600 times)

0 Members and 1 Guest are viewing this topic.

Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
[WB, SP, Code] Order: Volley Fire! (Open Source)
« on: March 06, 2011, 07:08:46 PM »
The following code allows the player to order their archers and crossbow men to synchronize their shots into volleys. (The general principle could be applied to AIs as well, but has not been here. Similarly, the item type checks could be extended to pistols or muskets, but again, are not marked as such below.) Archers fire a shot every 3 seconds and crossbowmen get a shot off every 5 seconds...given this adds some delay to archers, this could be useful for preservation of arrows, but in my tests crossbowmen find it much more effective.

The order is given to divisions/groups of troops as Native orders and will scroll on screen as native orders do. (This has not, however been worked into the panel with the map.) Give the volley order once and your selected divisions will be ordered to "Prepare to Volley". Tap the key again with groups already ordered to volley will be ordered to "End their Volley". Giving the volley order to a mixed set of groups (some ordered to volley, others not) will order all selected groups to volley fire. Only troops currently ordered to hold position or stand ground can respond to a volley command.

This should be compatible with most any other code bits/mods/what have you, as it does not add any globals nor does it monkey with the original source code. (It uses team slots--see the Constants code--to track orders to battle divisions; as these are unused in single player, there is no conflict.) Two possible compatibility issues to pay attention to: one will be to find a suitable, unused key for the order. Currently, it is set to use F8. Second, ensure that the agent slot is unused elsewhere in constants. (For a more elegant integration with my other order codes, see the source for Pre-Battle Orders & Deployment.)

EXAMPLE VIDEOS

Without further ado, the code:
(click to show/hide)
Two scripts: the check for an active order and code for actually giving the order to begin/stop volley fire and display the appropriate text on screen. Place where ever within scripts = [... The beginning works just fine.

(click to show/hide)
Stick them in each of the actual mission templates you want to be able to give the order without the "order_skirmish_triggers" title and brackets, or stick them toward the top of the file (I put them after the multiplayer_* and before the common_* around line 630) and then just include the "order_volley_triggers" title in the actual mission templates. I tend to install extra triggers as follows:

(click to show/hide)

(click to show/hide)
Add to bottom of module_constants.py, after customizing the key used to your taste and ensuring no conflicts.

This has been tested and is working as described.

Comments and suggestions, etc, are--as always--welcome.
« Last Edit: March 07, 2011, 04:36:53 AM by Caba`drin »



Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #1 on: March 06, 2011, 07:09:33 PM »
Reserved...with high hopes of eventually adding code for a ranked-based rolling volley.



Sayd Ûthman

  • Language Moderator
  • *
  • Tamazgha tga win Imazighen
    • View Profile
  • Faction: Neutral
  • MP nick: Sayd_uthman
  • WB
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #2 on: March 06, 2011, 07:17:10 PM »
Wonderful :D good work

Comrade Temuzu

  • Grandmaster Knight
  • *
  • Remove smelly Kolechian from premises.
    • Steam - Temuzu
    • YouTube - Temekin
    • View Profile
  • Faction: Rhodok
  • MP nick: ComradeTemuzu
  • M&BWBWF&SNW
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #3 on: March 06, 2011, 07:36:20 PM »
Excellent work!

theAthenian

  • Guest
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #4 on: March 06, 2011, 09:06:07 PM »
Sounds awesome. Can someone plz make a vid out of it?

Sahran

  • Grandmaster Knight
  • *
  • B-E-N-D-E-R! BEEEENNNDER! B-E-N-D-E-R!
    • View Profile
  • Faction: Sarranid
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #5 on: March 06, 2011, 10:31:59 PM »
Caba`drin seems to be the saint of ranged scripting!


Caba`drin

  • Administrator
  • *
  • It's time to toss the dice.
    • View Profile
  • Faction: Nord
  • MP nick: Caba_drin
  • M&BWBWF&SNW
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #6 on: March 07, 2011, 04:37:36 AM »
Sounds awesome. Can someone plz make a vid out of it?
Ah heck, had some time, didn't feel like coding or actually playing, so two videos added to the OP.



Rigadoon

  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Neutral
  • MP nick: Rigadoon
  • M&BWBWF&SNW
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #7 on: March 07, 2011, 04:39:54 AM »
Vid looks great, nice job on this!

Lumos

  • Probably Not a Help Desk
  • Grandmaster Knight
  • *
  • Mens INsana in corpore sano
    • YouTube - LumosX
    • View Profile
  • Faction: Nord
  • M&BWBWF&SNW
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #8 on: March 07, 2011, 06:50:41 AM »
You are sick. Another good one. Definitely going in TBS. :)

Cromcrom

  • Guest
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #9 on: March 07, 2011, 08:40:39 AM »
This and skirmishing, among others, are gorgeous. I will definitely add it to rigale, sooner than late. Thank you so much for sharing :)

Idibil

  • Grandmaster Knight
  • *
    • View Profile
    • Nova Regula
  • Faction: Nord
  • MP nick: CeltíberoIdibil
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #10 on: March 07, 2011, 09:29:02 AM »
Nice Idea Caba'Drin  :)

I want read it more slowly late.
Thank you.

theAthenian

  • Guest
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #11 on: March 07, 2011, 12:46:41 PM »
(click to show/hide)

Thnx Caba'Drin. You did a very nice job. I was looking for something like this for a very long time.

Belendor

  • Grandmaster Knight
  • *
  • When it doesn't feel right, go left.
    • Steam - Belendor
    • Twitch.tv - Belendorr
    • YouTube - Belendor
    • View Profile
    • Olympus Studios
  • Faction: Swadian
  • MP nick: WTF_Belendor
  • WBWF&SNW
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #12 on: March 07, 2011, 08:49:56 PM »
Damn it, another immpressive one from you! :shock:

Cromcrom

  • Guest
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #13 on: March 09, 2011, 11:32:20 PM »
Caba'drin, it seems the volley firing is automatic. Do you think it could be tied to a key, so that the player orders the fire ? (SteaaaaaaaadyyyyyyyyyyyyyyyyyySHOOT)  :twisted:

Llew

  • Cheap ass bum
  • Grandmaster Knight
  • *
    • View Profile
  • Faction: Vaegir
  • MP nick: nK_Llew
  • M&BWB
Re: [WB, SP, Code] Order: Volley Fire! (Open Source)
« Reply #14 on: March 09, 2011, 11:42:28 PM »
Very nice indeed! Would go well in HYW. Also, it looks easy to change the volley timing; I think 2 or 2.5 seconds would be better for the archers.