• The forum has been updated. For an explanation of some of the changes, head over here.

Help please: Adding more bot types to multiplayer

Currently viewing this thread:

Scarf Ace

Sergeant Knight at Arms
WBWF&SNWVCM&B
I'm trying to make a little mod for giggles and ****s that requires many bot types per faction. However, if I add more than 4 types, the ones past the 4th never spawn when ticked.
I found out the game clearly has variables for this:
g_multiplayer_bot_type_1_wanted
g_multiplayer_bot_type_2_wanted
g_multiplayer_bot_type_3_wanted
g_multiplayer_bot_type_4_wanted

What I want to know is can I somehow make more of these variables or something so that more bot types are selectable?
 

Somebody

Code Pope
Baron
WBWF&S
Yes, they're global variables which you can define yourself. Keep in mind you'll also want to define slot_player_bot_type_#_wanted sequentially (move slot_player_spawn_count up), so that they're stored properly.
 

Scarf Ace

Sergeant Knight at Arms
WBWF&SNWVCM&B
I'm very new to the module system, can you please explain it some more?
I did this in module_constants:
Code:
slot_player_last_bot_count                     = 34
slot_player_bot_type_1_wanted                  = 35
slot_player_bot_type_2_wanted                  = 36
slot_player_bot_type_3_wanted                  = 37
slot_player_bot_type_4_wanted                  = 38
slot_player_bot_type_5_wanted                  = 39
slot_player_bot_type_6_wanted                  = 40
slot_player_bot_type_7_wanted                  = 41
slot_player_bot_type_8_wanted                  = 42
slot_player_spawn_count                        = 43
and in pretty much every other module file where I found slot_player_bot_type_#_wanted I added ones for 5-8

It hasn't worked so far.
 

Somebody

Code Pope
Baron
WBWF&S
Now do the same for the global variables g_multiplayer_bot_type_#_wanted for 5-8 in module_presentations. For the presentation objects, use some unused globals like g_presentation_obj_custom_battle_designer_# or create your own after g_presentation_obj_item_select_#.
Code:
      (assign, "$g_presentation_obj_item_select_#", -1),
...
          (try_begin),
            (eq, ":cur_ai_troop_index", #),
            (overlay_set_val, reg0, "$g_multiplayer_bot_type_#_wanted"),
            (assign, "$g_presentation_obj_item_select_#", reg0),
...
        (else_try),
          (eq, ":object", "$g_presentation_obj_item_select_#"),
          (assign, "$g_multiplayer_bot_type_#_wanted", ":value"),
          (multiplayer_send_2_int_to_server, multiplayer_event_set_bot_selection, slot_player_bot_type_#_wanted, ":value"),
Make sure you modify g_multiplayer_bot_type_4_wanted to have a proper condition.
 
Top Bottom