OSP Code Combat [WIP] Auto-Firing weapons mod

Specialist

Master Knight
WB
Best answers
0
dezuman said:
dunde said:
Main reason that it needs WSE is spawn_missile operation. 1.153 has add_missile that do similar thing.
It does use other WSE features (e.g. agent_get_animation_progress for determining whether to fire or not), so porting it would probably take some rewriting...

On a positive note I just realized what opcodes ARE, and that is is the very agent_get_animation_progress (3303) operation that isn't working for me. Experimentation time!  :grin:
Edit: Seems like none of the WSE stuff is working at all ... meh.
Edit2: Because I'm using a cracked version for this? Damn you, steam!
Really? Reported

On the slight chance you aren't banned, you need to 1) Buy the stinking game. Find it at the right place and you can buy it for $2.50 (I actually got my copy for $1.75 at a half price books).
2) Start looking at native operations and scripting. You have to use quite a few different Native operations from 1.153 in order to replace the 1.143 WSE operations which no longer work, but it is indeed possible.
 

totallyNotSmurf

Recruit
Best answers
0
In case I wasn't clear enough, AFAIK since I got it on steam I can't legitly get any version but the most current. Therefore I cracked a downloaded 1.143. If I am wrong then yay, I won't have to the next time.

Now I got this script working like a charm with only a few quickly noticeable bugs on my 1.153 using only native operations, if anyone wants it I could post it. Unless I get banned again, that is  :roll:


Edit: What the hell. Excuses if it's not all nice and tidy, I started M&B modding 2 days ago  :smile:

In Mission templates I have replaced all WSE operations with native ones, exempt the ready-animation-check I couldn't (I think it might cause inconsistent firing speed)
####################################################################
################## CHECK IF BULLET CAN BE FIRED ####################
####################################################################
common_auto_fire = (
  0.1, 0, 0,
  [
      (assign, ":player_agent", -1),
      (try_begin),
        (game_in_multiplayer_mode),
        (multiplayer_get_my_player, ":player_no"),
        (player_is_active, ":player_no"),
        (neg|player_is_busy_with_menus, ":player_no"),
        (player_get_agent_id, ":player_agent", ":player_no"),
      (else_try),
        (neg|game_in_multiplayer_mode),
        (get_player_agent_no, ":player_agent"),
      (try_end),
 
################### START PRESENTATION IF NEEDED ###################
      (try_begin),
        (neq, ":player_agent", -1),
        (agent_get_wielded_item, ":cur_weapon", ":player_agent", 0),
        (is_between, ":cur_weapon", "itm_uzi", "itm_sevensixtwo_mm_rounds"),
        (neg|is_presentation_active, "prsnt_battle"),
        (neg|is_presentation_active, "prsnt_auto_weapon_reticle"),
        (start_presentation, "prsnt_auto_weapon_reticle"),
      (try_end),
 
      (this_or_next|multiplayer_is_server),
      (neg|game_in_multiplayer_mode),
  ],[
      (try_for_agents, ":shooter_agent"),
        (agent_is_alive, ":shooter_agent"),
        (try_begin),
########### CHECK IF AGENT IS IN READY WEAPON ANIMATION ############
            (agent_get_animation, ":shooter_stance", ":shooter_agent", 1),
            (this_or_next|eq, ":shooter_stance", "anim_ready_pistol"),
            (eq, ":shooter_stance", "anim_ready_musket"),

            (agent_get_wielded_item, ":cur_weapon", ":shooter_agent", 0),
            (is_between, ":cur_weapon", "itm_uzi", "itm_sevensixtwo_mm_rounds"),

#            (agent_get_animation_progress, ":anim_progress", ":shooter_agent", 1), #No native op to replace with AFAIK
#            (eq, ":anim_progress", 100),

############### FIND WEAPON, GET AMMO, SET AMMO TYPE ###############
            (try_for_range, ":cur_slot", 0, 4),
              (agent_get_item_slot, ":cur_item", ":shooter_agent", ":cur_slot"),
              (eq, ":cur_item", ":cur_weapon"),
              (assign, ":weapon_slot", ":cur_slot"),
            (try_end),
            (agent_get_ammo_for_slot, ":ammo", ":shooter_agent", ":weapon_slot"),

            (try_begin),
              (eq, ":cur_weapon", "itm_uzi"),
              (assign, ":ammo_item", "itm_nine_mm_rounds"),
            (else_try),
              (eq, ":cur_weapon", "itm_ak_47"),
              (assign, ":ammo_item", "itm_sevensixtwo_mm_rounds"),
            (else_try),
              (eq, ":cur_weapon", "itm_spas_12"),
              (assign, ":ammo_item", "itm_twelve_gauge_buckshot"),
            (try_end),

######### UNEQUIPS AMMO THAT IS UNUSABLE BY WIELDED WEAPON #########
            (try_for_range, ":cur_slot", 0, 4),
              (agent_get_item_slot, ":cur_item", ":shooter_agent", ":cur_slot"),
              (neq, ":cur_item", -1),
              (neq, ":cur_item", ":ammo_item"),
              (item_get_type, ":ammo_type", ":ammo_item"),
              (item_get_type, ":cur_type", ":cur_item"),
              (eq, ":cur_type", ":ammo_type"),
              (agent_unequip_item, ":shooter_agent", ":cur_item", -1, 1),
            (try_end),

########### EQUIPS AMMO THAT IS USABLE BY WIELDED WEAPON ###########
            (try_begin),
              (neg|agent_has_item_equipped, ":shooter_agent", ":ammo_item"),
              (agent_equip_item, ":shooter_agent", ":ammo_item"),
            (try_end),

############################ REDUCE AMMO ###########################
            (try_begin),
              (gt, ":ammo", 0),
              (val_sub, ":ammo", 1),
              (agent_set_ammo, ":shooter_agent", ":cur_weapon", ":ammo"),
              (try_begin),
                  (eq, ":cur_weapon", "itm_uzi"),
                  (agent_set_animation, ":shooter_agent", "anim_release_uzi", 1),
              (else_try),
                  (eq, ":cur_weapon", "itm_ak_47"),
                  (agent_set_animation, ":shooter_agent", "anim_release_ak_47", 1),
              (else_try),
                  (agent_set_animation, ":shooter_agent", "anim_release_spas_12", 1),
              (try_end),
              (call_script, "script_fire_auto_weapon", ":shooter_agent", ":cur_weapon", ":ammo_item"),
            (try_end),
            (agent_set_slot, ":shooter_agent", slot_agent_cool_time, 0),
        (else_try),
################## REDUCES RECOIL FOR ALL AGENTS ###################
            (agent_get_slot, ":cool_time", ":shooter_agent", slot_agent_cool_time),
            (agent_get_slot, ":wander", ":shooter_agent", slot_agent_spread),
            (assign, ":factor", 10),
            (val_mul, ":factor", ":cool_time"),
            (val_sub, ":wander", ":factor"),
            (val_max, ":wander", 10),
            (agent_set_slot, ":shooter_agent", slot_agent_spread, ":wander"),
            (val_add, ":cool_time", 1),
            (agent_set_slot, ":shooter_agent", slot_agent_cool_time, ":cool_time"),
        (try_end),
      (try_end),
  ])





In Scripts I have only replaced spawn_missile with add_missile in the firing script:
########################################################################
##################### FIRES WEAPON BASED ON STATS ######################
########################################################################
  ("fire_auto_weapon",[
      (this_or_next|multiplayer_is_server),
      (neg|game_in_multiplayer_mode),
      (store_script_param, ":shooter_agent", 1),
      (store_script_param, ":shooter_weapon", 2),
      (store_script_param, ":shooter_ammo", 3),

      (item_get_slot, ":auto_accuracy", ":shooter_weapon", slot_item_accuracy),
      (store_sub, ":inaccuracy", 100, ":auto_accuracy"),

###################### CALCULATE AGENT INACCURACY #######################
      (agent_get_troop_id, ":shooter_troop", ":shooter_agent"),
      (store_proficiency_level, ":firing_skill", ":shooter_troop", wpt_firearm),
      (store_sub, ":firing_disability", 500, ":firing_skill"),
      (val_div, ":firing_disability", 10),

############################# CALCULATE WANDER ##########################
      (item_get_slot, ":weapon_recoil", ":shooter_weapon", slot_item_auto_recoil),
      (val_mul, ":weapon_recoil", 5),
      (agent_get_slot, ":wander", ":shooter_agent", slot_agent_firearm_wander),
      (val_add, ":wander", ":weapon_recoil"),
      (store_mul, ":max_recoil", ":weapon_recoil", 10),
      (val_min, ":wander", ":max_recoil"),
      (agent_set_slot, ":shooter_agent", slot_agent_firearm_wander, ":wander"),

      (agent_get_animation, ":cur_anim", ":shooter_agent", 0),
################# INCREASE INACCURACY DUE TO MOVEMENT ###################
      (try_begin),
        (is_between, ":cur_anim", "anim_run_forward", "anim_stand_to_crouch"),
        (val_mul, ":wander", 2),
      (try_end),
################### INCREASE INACCURACY DUE TO JUMP #####################
      (try_begin),
        (is_between, ":cur_anim", "anim_jump", "anim_stand_unarmed"),
        (val_mul, ":wander", 3),
      (try_end),
################# DECREASE INACCURACY DUE TO CROUCH #####################
      # (try_begin),
        # (this_or_next|eq, ":cur_anim", "anim_crouch_to_stand"),
        # (eq, ":cur_anim", "anim_stand_to_crouch"),
        # (val_mul, ":wander", 2),
        # (val_div, ":wander", 3),
      # (try_end),
################## DECREASE INACCURACY DUE TO PRONE #####################
      # (try_begin),
        # (this_or_next|eq, ":cur_anim", "anim_stand_to_prone"),
        # (eq, ":cur_anim", "anim_prone_to_stand"),
        # (val_div, ":wander", 2),
      # (try_end),

      (val_mul, ":wander", ":firing_disability"),
      (val_div, ":wander", 1000),
      (store_add, ":slot_wander", ":inaccuracy", ":wander"),
      (agent_set_slot, ":shooter_agent", slot_agent_spread, ":slot_wander"),

################ SEND DATA NEEDED FOR PRSNT TO CLIENTS ##################
      (try_begin),
        (game_in_multiplayer_mode),
        (neg|agent_is_non_player, ":shooter_agent"),
        (agent_get_player_id, ":shooter_player", ":shooter_agent"),
        (multiplayer_send_int_to_player, ":shooter_player", multiplayer_event_autofire, ":slot_wander"),
      (try_end),

      (item_get_slot, ":velocity", ":shooter_weapon", slot_item_shoot_speed),
      (item_get_slot, ":shotgun", ":shooter_weapon", slot_item_auto_shotgun),
############# RAISE POS TO EYE LEVEL & MOVE TO END OF GUN ###############
      (agent_get_look_position, pos1, ":shooter_agent"),
      (position_move_z, pos1, 165, 0),
      (position_move_y, pos1, 50, 0),

#################### SOUNDS AND PARTICLES PLAY HERE #####################
      (item_get_slot, ":sound_id", ":shooter_weapon", slot_item_sound),
      (agent_play_sound, ":shooter_agent", ":sound_id"),
      #(particle_system_burst, "psys_gun_flash", pos1, 10),

############ GET INITIAL RANDOMIZED BULLET ANGLE ROTATION ###############
      (store_random_in_range, ":y_rotation", 0, 360),
      (position_rotate_y, pos1, ":y_rotation"),

      (try_begin),
############ IF NOT SHOTGUN SPAWN BULLET WITH INACCURACY ################
        (eq, ":shotgun", 0),
       
        (val_add, ":inaccuracy", ":wander"),
        (store_random_in_range, ":mad:_inaccuracy", 0, ":inaccuracy"),
        (set_fixed_point_multiplier, 10),
        (position_rotate_x_floating, pos1, ":mad:_inaccuracy"),

        (set_fixed_point_multiplier, 1),
        (add_missile, ":shooter_agent", pos1, ":velocity", ":shooter_weapon", ":shooter_ammo"),
      (else_try),
############## IF SHOTGUN ROTATE X WITH WITH INACCURACY #################
        (store_random_in_range, ":wander_movement", 0, ":wander"),
        (set_fixed_point_multiplier, 10),
        (position_rotate_x_floating, pos1, ":wander_movement"),

############# REPEAT FOR EACH PROJECTILE DEFINED BY ITEM ################
        (try_for_range, ":repeat", 0, ":shotgun"),
            (set_fixed_point_multiplier, 10),
            (copy_position, pos2, pos1),

################ ROTATES EACH PROJECTILE INTO SECTORS ###################
            (store_div, ":y_rotation", 360, ":shotgun"),
            (val_mul, ":y_rotation", ":repeat"),
            (position_rotate_y, pos2, ":y_rotation"),

############ SPAWN PROJECTILE WITH RANDOMIZED INACCURACY ################
            (store_random_in_range, ":mad:_inaccuracy", 0, ":inaccuracy"),
            (position_rotate_x_floating, pos2, ":mad:_inaccuracy"),

            (set_fixed_point_multiplier, 1),
            (add_missile, ":shooter_agent", pos2, ":velocity", ":shooter_weapon", ":shooter_ammo"),
        (try_end),
      (try_end),
  ]),

Free to use and redistribute as per OP, feedback appreciated.
 

Caba`drin

Count
M&BWBWF&SNWVC
Best answers
0
totallyNotSmurf said:
In case I wasn't clear enough, AFAIK since I got it on steam I can't legitly get any version but the most current. Therefore I cracked a downloaded 1.143. If I am wrong then yay, I won't have to the next time.
You are wrong and a simple search of these forums would have demonstrated that.
Caba`drin said:
You can get any version of Warband legitimately directly from Taleworlds.com
Caba`drin said:
Either explore the FTP directory ftp://anonymous:[email protected] to see a number of versions to download, or can simply change the url link on the mirror download server to any version number (going back at the very least to 1.113) by changing the XXs to the proper version number: http://download2.taleworlds.com/mb_warband_setup_11XX.exe  (the main download--without the 2--doesn't seem to have as many old versions).
 

ithilienranger

Knight at Arms
Best answers
0
totallyNotSmurf said:
In case I wasn't clear enough, AFAIK since I got it on steam I can't legitly get any version but the most current. Therefore I cracked a downloaded 1.143. If I am wrong then yay, I won't have to the next time.
If you have a game cd/dvd you should install it when steam is offline. Then, disable steam from auto-updating it. Finally, manually download and install the patch you want.

p.s. You could borrow someone else's disc if you don't have one, to install it; but you still need a legit key.
 

totallyNotSmurf

Recruit
Best answers
0
I'll do that the next time, thanks  :smile:

Now, isn't it silly that native has an operation to SET the animation progress but not to GET it? Looks bad to start firing before you have even raised the gun, and it only gets worse when shotgun pellets emit from the actual barrel of the wrong-directed gun model. Maybe it'll work if I keep poking it ...
 

Bloc

Duke
WB
Best answers
0
Why Im getting that error?
Code:
NameError : name ' spawn_missile ' is not defined
But that error means nothing on my modul because when I start the game after I complied the codes It gives me no error in gameplay and of course Auto-Fire not working too  :neutral:
 

Lumos

Section Moderator
WBWF&SNWM&BVC
Best answers
0
Spawn_missile is the old name for when the command was WSE only. Replace it with
Code:
add_missile
instead.
 

Bloc

Duke
WB
Best answers
0
Lumos said:
Spawn_missile is the old name for when the command was WSE only. Replace it with
Code:
add_missile
instead.
Ah thanks , okay now Im not getting errors but Im getting some WARNİNGS and Auto-fire still not working , I think Warnings arent a problem , are they?
 

ithilienranger

Knight at Arms
Best answers
0
What are the warnings? I have had some trouble implementing it on the latest version of Warband. I haven't had time to fully investigate the problem.
 

Bloc

Duke
WB
Best answers
0
Like
Code:
WARNING:Local variable never used : player_no , at : wse_multiplayer_message_received
WARNING:Local variable never used : event_no , at : wse_multiplayer_message_received
WARNING:Local variable never used : missile_item_no , at : misille_dives_into_water
bla bla. ..
 

Bloc

Duke
WB
Best answers
0
I think ıts relevant with that wse code
Code:
#script_wse_multiplayer_message_received
# Called each time a composite multiplayer message is received
# INPUT
# script param 1 = sender player no
# script param 2 = event no
("wse_multiplayer_message_received", [
	(store_script_param, ":player_no", 1),
	(store_script_param, ":event_no", 2),
]),

#script_wse_game_saved
# Called each time after game is saved successfully
("wse_game_saved", [
]),

#script_wse_chat_message_received
# Called each time a chat message is received (both for servers and clients)
# INPUT
# script param 1 = sender player no
# script param 2 = chat type (0 = global, 1 = team)
# s0 = message
# OUTPUT
# trigger result = anything non-zero suppresses default chat behavior. Server will not even broadcast messages to clients.
# result string = changes message text for default chat behavior (if not suppressed).
("wse_chat_message_received", [
	(store_script_param, ":player_no", 1),
	(store_script_param, ":chat_type", 2),
]),

#script_wse_console_command_received
# Called each time a command is typed on the dedicated server console (after parsing standard commands)
# INPUT
# s0 = text
# OUTPUT
# trigger result = anything non-zero if the command succeeded
# result string = message to display on success (if empty, default message will be used)
("wse_console_command_received", [
]),

#script_wse_get_agent_scale
# Called each time an agent is created
# INPUT
# script param 1 = troop no
# script param 2 = horse item no
# script param 3 = horse item modifier
# script param 4 = player no
# OUTPUT
# trigger result = agent scale (fixed point)
("wse_get_agent_scale", [
	(store_script_param, ":troop_no", 1),
	(store_script_param, ":horse_item_no", 2),
	(store_script_param, ":horse_item_modifier", 3),
	(store_script_param, ":player_no", 4),
]),

#script_wse_window_opened
# Called each time a window (party/inventory/character) is opened
# INPUT
# script param 1 = window no
# script param 2 = window param 1
# script param 3 = window param 2
# OUTPUT
# trigger result = presentation that replaces the window (if not set or negative, window will open normally)
("wse_window_opened", [
	(store_script_param, ":window_no", 1),
	(store_script_param, ":window_param_1", 2),
	(store_script_param, ":window_param_2", 3),
]),

#script_game_missile_dives_into_water
# Called each time a missile dives into water
# INPUT
# script param 1 = missile item no
# script param 2 = missile item modifier
# script param 3 = launcher item no
# script param 4 = launcher item modifier
# script param 5 = shooter agent no
# pos1 = water impact position and rotation
("game_missile_dives_into_water", [
	(store_script_param, ":missile_item_no", 1),
	(store_script_param, ":missile_item_modifier", 2),
	(store_script_param, ":launcher_item_no", 3),
	(store_script_param, ":launcher_item_modifier", 4),
	(store_script_param, ":shooter_agent_no", 5),
]),
But ıf ıts relevant with that , auto-fire still not working for me I dont know why  :neutral:
 

ithilienranger

Knight at Arms
Best answers
0
Those warnings will not effect the game. The obvious question for me to ask you is, did you add common_init_auto_fire, & common_auto_fire, inside all the mission templates that you want auto-fire in?
 

Bloc

Duke
WB
Best answers
0
Of course , Code is going like that
Code:
from header_common import *
from header_operations import *
from header_mission_templates import *
from header_animations import *
from header_sounds import *
from header_music import *
from header_items import *
from module_constants import *

####################################################################################################################
#   Each mission-template is a tuple that contains the following fields:
#  1) Mission-template id (string): used for referencing mission-templates in other files.
#     The prefix mt_ is automatically added before each mission-template id
#
#  2) Mission-template flags (int): See header_mission-templates.py for a list of available flags
#  3) Mission-type(int): Which mission types this mission template matches.
#     For mission-types to be used with the default party-meeting system,
#     this should be 'charge' or 'charge_with_ally' otherwise must be -1.
#     
#  4) Mission description text (string).
#  5) List of spawn records (list): Each spawn record is a tuple that contains the following fields:
#    5.1) entry-no: Troops spawned from this spawn record will use this entry
#    5.2) spawn flags.
#    5.3) alter flags. which equipment will be overriden
#    5.4) ai flags.
#    5.5) Number of troops to spawn.
#    5.6) list of equipment to add to troops spawned from here (maximum 8).
#  6) List of triggers (list).
#     See module_triggers.py for infomation about triggers.
#
#  Please note that mission templates is work in progress and can be changed in the future versions.
# 
####################################################################################################################

pilgrim_disguise = [itm_pilgrim_hood,itm_pilgrim_disguise,itm_practice_staff, itm_throwing_daggers]
af_castle_lord = af_override_horse | af_override_weapons| af_require_civilian

####################################################################
####################### INITIALIZE AUTOFIRE ########################
####################################################################
common_init_auto_fire = (
  ti_after_mission_start, 0, ti_once, [], [
         (this_or_next|multiplayer_is_server),
         (neg|game_in_multiplayer_mode),

######### NEEDED TO PREVENT UNINITIALIZE SLOTS FOR CLIENTS #########
############# ADD EACH SCRIPT CALL FROM AUTO ITEM HERE #############

BLA BLA BLA ............
Is that right?
 

Specialist

Master Knight
WB
Best answers
0
Bloc said:
Of course , Code is going like that
Code:
from header_common import *
from header_operations import *
from header_mission_templates import *
from header_animations import *
from header_sounds import *
from header_music import *
from header_items import *
from module_constants import *

####################################################################################################################
#   Each mission-template is a tuple that contains the following fields:
#  1) Mission-template id (string): used for referencing mission-templates in other files.
#     The prefix mt_ is automatically added before each mission-template id
#
#  2) Mission-template flags (int): See header_mission-templates.py for a list of available flags
#  3) Mission-type(int): Which mission types this mission template matches.
#     For mission-types to be used with the default party-meeting system,
#     this should be 'charge' or 'charge_with_ally' otherwise must be -1.
#     
#  4) Mission description text (string).
#  5) List of spawn records (list): Each spawn record is a tuple that contains the following fields:
#    5.1) entry-no: Troops spawned from this spawn record will use this entry
#    5.2) spawn flags.
#    5.3) alter flags. which equipment will be overriden
#    5.4) ai flags.
#    5.5) Number of troops to spawn.
#    5.6) list of equipment to add to troops spawned from here (maximum 8).
#  6) List of triggers (list).
#     See module_triggers.py for infomation about triggers.
#
#  Please note that mission templates is work in progress and can be changed in the future versions.
# 
####################################################################################################################

pilgrim_disguise = [itm_pilgrim_hood,itm_pilgrim_disguise,itm_practice_staff, itm_throwing_daggers]
af_castle_lord = af_override_horse | af_override_weapons| af_require_civilian

####################################################################
####################### INITIALIZE AUTOFIRE ########################
####################################################################
common_init_auto_fire = (
  ti_after_mission_start, 0, ti_once, [], [
         (this_or_next|multiplayer_is_server),
         (neg|game_in_multiplayer_mode),

######### NEEDED TO PREVENT UNINITIALIZE SLOTS FOR CLIENTS #########
############# ADD EACH SCRIPT CALL FROM AUTO ITEM HERE #############

BLA BLA BLA ............
Is that right?
Yes, but you have to put
Code:
common_init_auto_fire,
common_auto_fire,
In the trigger portion of each individual template that you want it to be used in. Eg: deathmatch, team deathmatch, ctf, whatever.

Look in the individual mission templates for something like common_*. Usually like common_banner or somthing similar, then put those two lines of code right underneath
 

Bloc

Duke
WB
Best answers
0
Specialist said:
Usually like common_banner or somthing similar, then put those two lines of code right underneath
In mission_templates? Because I couldnt find common_banner in mission_templates  :neutral:
@ithilienranger : Can you tell me what I suppose to do step-by-step?

EDIT : Okay I added these two lines under the "  common_battle_init_banner," , code goes like this
Code:
(
    "multiplayer_tdm",mtf_battle_mode,-1, #team_deathmatch mode
    "You lead your men to battle.",
    [
      (0,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
      (1,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
      (2,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
      (3,mtef_visitor_source|mtef_team_0,0,aif_start_alarmed,1,[]),
      BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA BLA
      (61,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
      (62,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
      (63,mtef_visitor_source|mtef_team_1,0,aif_start_alarmed,1,[]),
     ],
    [
      common_battle_init_banner,
	  common_init_auto_fire,
      common_auto_fire,

      multiplayer_server_check_polls,

      (ti_on_agent_spawn, 0, 0, [],
       [
         (store_trigger_param_1, ":agent_no"),
         (call_script, "script_multiplayer_server_on_agent_spawn_common", ":agent_no"),
         ]), 
BLA BLA BLA

Now ıt looks I made something right with making something wrong , crosshair appeared for the Ak-47 , but Its not auto-firing with lots of error ..  :roll:
 

Bloc

Duke
WB
Best answers
0
Lumos said:
I'm betting my ass on you not running WSE.
Oh damn ...

Okay , I used WSE now and Its nearly working.But when I firing slowly  Its giving me that error

And this thing
But this one probably because of WSE and me  , I'll delete that module and re-make it from my backup with auto-fire codes and WSE , If I got that problems again I'll post them or If I got success I'll post it too  :lol:
 

Jaakko

Marquis
M&BWB
Best answers
0
Slight bump...

I have a small problem, or two, apparently the second is same as Bloc had.


I've underlined the initial error which pops up right away.

Here is the code, same as OP:
Code:
   ("set_auto_weapon_stats",[
      (store_script_param, ":auto_item_id", 1),
      (store_script_param, ":auto_recoil", 2),
      (store_script_param, ":auto_shotgun", 3),
      (store_script_param, ":item_sound", 4),

      (item_set_slot, ":auto_item_id", slot_item_auto_recoil, ":auto_recoil"),
      (item_set_slot, ":auto_item_id", slot_item_auto_shotgun, ":auto_shotgun"),
      (item_set_slot, ":auto_item_id", slot_item_sound, ":item_sound"),
   ]),


If someone spots an error here I'd appreciate it.


Found it, missed oned parameter in mission_templates...



Also, why does it get Invalid Item Kind on add_missile? (OPCODE 1829)

I'm using the code on page 10. Also, it happens on 1.153 with and without WSE. Server is running WSE too...

Sorry for my noobish questions  :razz:


Edit:

Autofire works fine when there is no bots.
But when I add any bots, I start getting the Invalid Item error.

I will try with another player.


Edit2:
Anyone?  :sad:

Edit3:
It works fine with another player, not just with bots  :???:
 

ithilienranger

Knight at Arms
Best answers
0
Sorry for the absence. I have been busy finishing up my college degree and working. I will have a new version ready soon that doesn't need WSE since it is no longer in development. I just need to make some tweaks to timings and accuracy calculations. The new version is much leaner than the old one but I had to remove some of the old features to do that.