OSP Code Combat [WB, SP] Order: Volley Fire!

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
King85 said:
Caba`drin said:
King85 said:
is there any way to change which keys are associated with the order(s)?
In the version of the code that is in the OP, change the section in the spoiler marked module_constants to point to a different key.
is there any way to do it without python? just to give you an understanding of my situation, im playing the 1776 mod and it has volley fire incorporated into it but when i try to use the order through the function keys, it doesn't work. so i'm basically trying to change the orders from being used by the function keys to some other key on my keyboard.
Ah, I see. If they are using this version of the code, then we'll need to edit mission_templates.txt
1. Make a backup of the file
2. Open it (preferably in something like Notepad++, but notepad works fine)
3. Find the section that beings mst_lead_charge
4. Find the line that begins
Code:
0.000000 0.000000 1.000000  1 71 1 66
That '66' says the key is F8.
5. Pick a new key from the key list and plug the hex number into this converter: http://www.binaryhexconverter.com/hex-to-decimal-converter
Code:
key_1 = 0x02
key_2 = 0x03
key_3 = 0x04
key_4 = 0x05
key_5 = 0x06
key_6 = 0x07
key_7 = 0x08
key_8 = 0x09
key_9 = 0x0a
key_0 = 0x0b
key_a = 0x1e
key_b = 0x30
key_c = 0x2e
key_d = 0x20
key_e = 0x12
key_f = 0x21
key_g = 0x22
key_h = 0x23
key_i = 0x17
key_j = 0x24
key_k = 0x25
key_l = 0x26
key_m = 0x32
key_n = 0x31
key_o = 0x18
key_p = 0x19
key_q = 0x10
key_r = 0x13
key_s = 0x1f
key_t = 0x14
key_u = 0x16
key_v = 0x2f
key_w = 0x11
key_x = 0x2d
key_y = 0x15
key_z = 0x2c
key_numpad_0 = 0x52
key_numpad_1 = 0x4f
key_numpad_2 = 0x50
key_numpad_3 = 0x51
key_numpad_4 = 0x4b
key_numpad_5 = 0x4c
key_numpad_6 = 0x4d
key_numpad_7 = 0x47
key_numpad_8 = 0x48
key_numpad_9 = 0x49
key_num_lock        = 0x45
key_numpad_slash    = 0xb5
key_numpad_multiply = 0x37
key_numpad_minus    = 0x4a
key_numpad_plus     = 0x4e
key_numpad_enter    = 0x9c
key_numpad_period   = 0x53
key_insert    = 0xd2
key_delete    = 0xd3
key_home      = 0xc7
key_end       = 0xcf
key_page_up   = 0xc9
key_page_down = 0xd1
key_up      = 0xc8
key_down    = 0xd0
key_left    = 0xcb
key_right   = 0xcd
key_f1  = 0x3b
key_f2  = 0x3c
key_f3  = 0x3d
key_f4  = 0x3e
key_f5  = 0x3f
key_f6  = 0x40
key_f7  = 0x41
key_f8  = 0x42
key_f9  = 0x43
key_f10 = 0x44
key_f11 = 0x57
key_f12 = 0x58
key_space         = 0x39
key_escape        = 0x01
key_enter         = 0x1c
key_tab           = 0x0f
key_back_space    = 0x0e
key_open_braces   = 0x1a
key_close_braces  = 0x1b
key_comma         = 0x33
key_period        = 0x34
key_slash         = 0x35
key_back_slash    = 0x2b
key_equals        = 0x0d
key_minus         = 0x0c
key_semicolon     = 0x27
key_apostrophe    = 0x28
key_tilde         = 0x29
key_caps_lock     = 0x3a
key_left_shift     = 0x2a
key_right_shift    = 0x36
key_left_control   = 0x1d
key_right_control  = 0x9d
key_left_alt       = 0x38
key_right_alt      = 0xb8
key_left_mouse_button   = 0xe0
key_right_mouse_button  = 0xe1
key_middle_mouse_button = 0xe2
key_mouse_button_4      = 0xe3
key_mouse_button_5      = 0xe4
key_mouse_button_6      = 0xe5
key_mouse_button_7      = 0xe6
key_mouse_button_8      = 0xe7
key_mouse_scroll_up     = 0xee
key_mouse_scroll_down   = 0xef
6.  Replace the 66 with the appropriate number (for instance, for "i" or  0x17, change 66 to 23
7. Save. Play.


You should suggest that they update to the code in the current version of PBOD as that includes a Key Configuration menu within mod options so you can do this in game (you might want to check camp->mod options to be sure that there isn't one already).
 

CUNGAWDZ

Recruit
Best answers
0
Is there any way of making this non .py? I would like to implement this into the age of change mod with text only... I have a feeling that will not happen though.
 

Lup_Alb

Sergeant at Arms
Best answers
0
I am trying to implement volley fire to my mod. How can I add the order "Volley!" to the fire orders menu (the one opened  with the F3 key in battle)? It is working but it doesn't appear in the menu and when I order my archers to start voley, the menu remains opened on screen.
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
CUNGAWDZ said:
Is there any way of making this non .py? I would like to implement this into the age of change mod with text only... I have a feeling that will not happen though.
No, unfortunately there is not.

Lup_Alb said:
I am trying to implement volley fire to my mod. How can I add the order "Volley!" to the fire orders menu (the one opened  with the F3 key in battle)? It is working but it doesn't appear in the menu and when I order my archers to start voley, the menu remains opened on screen.
The code here doesn't do this, but if you look at the open source of the full/more integrated implementation of volley fire within my mod Pre-Battle Orders & Deployment (&Positioning) linked below you'll find how I accomplish it there.

In particular, note the presentation "caba_order_display" that creates the new framed order boxes, and the numerous mission template triggers in the list "caba_order_triggers" that track which orders are being given to display (or not) the additional orders appropriately.

There's no direct way to edit the order menu--or to suppress the menu from showing after giving an order that has been modded in--but what you'll find in the PBOD source is the current extent of what is possible.
 

mauromagno

Knight at Arms
WBNW
Best answers
0
Hi Caba`drin,

I did not understand, how to put this:    :roll:

Code:
(
    "lead_charge",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [ 
     // bunch of stuff...all the way to the very end
          ] + order_volley_triggers,
  ),
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
mauromagno said:
I did not understand, how to put this:
Code:
(
    "lead_charge",mtf_battle_mode,charge,
    "You lead your men to battle.",
    [ 
     // bunch of stuff...all the way to the very end
          ] + order_volley_triggers,
  ),
I have re-explained that just above in an exchange with Crossbow Joe. Check there and see if his additional information is useful. It should be pretty straightforward when you are looking at a mission template in the module_mission_templates file. If the above doesn't help, something more specific about what you don't understand or what you've tried would be helpful for me to know where to start.
 

mauromagno

Knight at Arms
WBNW
Best answers
0
sorry, I speak Spanish and use the google translator, but this is not 100% effective.

will review the post of crossbow joe  :wink:
 

mauromagno

Knight at Arms
WBNW
Best answers
0
oohh yeah,  :razz:
works, but,
1. - No panel displays the orders that I saw in the video.
2. - Could be done for multiplayer? (playing with bots).

thanks in advance  :cool:
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
mauromagno said:
1. - No panel displays the orders that I saw in the video.
Caba`drin said:
Lup_Alb said:
I am trying to implement volley fire to my mod. How can I add the order "Volley!" to the fire orders menu (the one opened  with the F3 key in battle)? It is working but it doesn't appear in the menu and when I order my archers to start voley, the menu remains opened on screen.
The code here doesn't do this, but if you look at the open source of the full/more integrated implementation of volley fire within my mod Pre-Battle Orders & Deployment (&Positioning) linked below you'll find how I accomplish it there.

In particular, note the presentation "caba_order_display" that creates the new framed order boxes, and the numerous mission template triggers in the list "caba_order_triggers" that track which orders are being given to display (or not) the additional orders appropriately.

There's no direct way to edit the order menu--or to suppress the menu from showing after giving an order that has been modded in--but what you'll find in the PBOD source is the current extent of what is possible.
mauromagno said:
2. - Could be done for multiplayer? (playing with bots).
Yes, I'm sure it could. I however, am not versed in MP coding and have not yet ventured to get my various battle orders to work there. I hope to in the future, given the existence of Battle Time! so folks could use these features cooperatively, but it is not high on my "to do" list.
 

Rangerplus10

Sergeant
Best answers
0
Why can't python use C/Java Syntax, I can't understand this code!!!!! :cry:

And, is this in floris 2.5, if so, how do I access it?.
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
Rangerplus10 said:
Why can't python use C/Java Syntax, I can't understand this code!!!!! :cry:
The syntax is quite simple--and it isn't Python, but a unique language for modding M&B. Check out the syntax link in my sig.

Rangerplus10 said:
And, is this in floris 2.5, if so, how do I access it?.
Yes, by way of Pre-Battle Orders & Deployment: it is under the special attack orders menu F7 - F6 should start a volley.
 

Patta

Sergeant Knight at Arms
Best answers
0
Any chance to make this mp compatible? Would it be that hard?

edit: Found this in the thread:
Code:
Since it uses team_slots to track things, it could be made compatible with multiplayer. The tricky part that would need to be changed would be getting the order given to the correct team. I've not done any MP coding, but it should definitely be possible.
OKay, that helps me a bit. But I still got no real Idea on how to do it :wink:
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
Patta said:
Any chance to make this mp compatible? Would it be that hard?
Caba`drin said:
mauromagno said:
2. - Could be done for multiplayer? (playing with bots).
Yes, I'm sure it could. I however, am not versed in MP coding and have not yet ventured to get my various battle orders to work there. I hope to in the future, given the existence of Battle Time! so folks could use these features cooperatively, but it is not high on my "to do" list.
Many of the agent_get_team calls would need to be changed to agent_get_group (I believe), which should be pretty straightforward. I'm not positive that (class_is_listening_order, <GROUP>, <class>) works in MP, but I would suspect that it does.

However, I'm not sure which of the calculations need to be done server side versus client-side. I'm guessing most everything should be server, but I don't know that for sure...working that out and creating the necessary events is what I am clueless about and would need to work through. But this isn't high on my priority list, as mentioned above...would love it if another puzzled it out though, and I'm sure others would be interested.
 

Patta

Sergeant Knight at Arms
Best answers
0
If I can do it, I will post it here. But I don't think I can do it, we will see. Btw, I was about to ask the same question for PBOD, as e.g. the formations would be really useful for me. To explain it more precisely, I am making some kind of a forum RPG atm with my Clan Members, and the battles take place in Warband with Armies of Bots. And well, Warband could use some more orders...
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
Patta said:
If I can do it, I will post it here. But I don't think I can do it, we will see. Btw, I was about to ask the same question for PBOD, as e.g. the formations would be really useful for me. To explain it more precisely, I am making some kind of a forum RPG atm with my Clan Members, and the battles take place in Warband with Armies of Bots. And well, Warband could use some more orders...
I'd love to have them working, but they present the same problems as this and my other orders. Stuff referring to teams needs to be changed to groups (which throws a bigger mess for formations since there are so many team slots used) and then the client/server divide would need to be addressed. Not something I'm looking forward to tackling.
 

Patta

Sergeant Knight at Arms
Best answers
0
Yea, I got my biggest problem with server/client side stuff too. I really hate it. But anyways, I will surely try to do it, At least I'll take a look at it.
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
Lup_Alb said:
This code works with Mount&Blade standard v1.011 too?
I doubt it, but it would be worth checking. (The WB in the tag implies it needs at least Warband.)
You'd need to go through and be sure all of the operations used here are present in original M&B--I don't think all the order-related ones are.
 

Lup_Alb

Sergeant at Arms
Best answers
0
It doesn't work with M&B Classic. I have tried but it seems that M&B Classic handles the items wielded by NPC's in a different way.