Post tutorial Report RSS Weapon Jamming Tutorial(7/28)

This tutorial will give your soldiers weapon jamming, they will try to repair their weapon in the midst of battle. 7/28 fixed units from freezing on death while unjamming their weapon.

Posted by on - Intermediate Other

WEAPON JAMMING SYSTEM.

Works with all MOW/AS/AS2


Weapon Jamming - Mod DB



(7/28)

-fixed units freezing when killed while unjamming the weapon

-fixed some delay errors

-some other fixes

If you encounter any bugs please comment about it, this is still abit new, started on the 15th.


By copying the altered code below for human.inc

overwriting

{on "link_weapon"

{on fire "hand_right"

{on "spawn_shell" (only if you did the previous 3d shell tutorial)

You and ai weapons will jam 0.0005% of the time. Giving them some time to fix the jams. Anything above that will be immersion breaking O_o.

At the very top of the script is "jam_enable" ,

where you can turn on and turn off weapon jamming by setting

{set "gun_jamming_enabled" 1} to {set "gun_jamming_enabled" 0}

Also by searching for weapon_type you can change which type of weapons will jam more often, like smgs can jam more than rifles.

EXAMPLE(do not copy): when you find it in the script by searching weapon_type, change the "if rand" values for any of these weapons to .

{on "pistoljam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}} 
{on "smgjam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "riflejam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "sniperjam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "shotgunjam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "mgunjam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}

Whenever the gun jams, the shell does not eject from the ejection port, it is rather stuck in the gun and the soldier has to take some time to get it out. While that is happening you will hear reload sounds and the sound of the soldier trying to pull the trigger (AS1/2). No download is required for these sounds, they're already in your game.

There are 3 steps to getting it installed,
1.Copying the Human.inc file to your mod directory(skippable if you already have it.)
2.Overwriting on fire "hand_right", "link_weapon" and(if you did the 3d shell tutorial only) "spawn_shell" with this code in human.inc
3.Setting up your mod and activating it.(Skippable if your pasting it into an existing mod)

if you know what you are doing and are an elite modder(lol) you can just go onto step 2, and your done.

1. Copying the Human.inc file to your mod directory(skippable if you already have it.)

Installation: If you don't have a human.inc go to men of war/game.pak or gamelogic.pak set/interaction_entity/human.inc

make this directory men of war/mods/yourmod/resource/set/interaction_entity/
or men of war assault squad/mods/yourmod/resource/set/interaction_entity/

and drag human.inc to the interaction_entity folder you just created.

right-click the Human.inc you dragged and uncheck the read-only checkbox so it can be edited.

2.Overwriting "on link_weapon" "on fire hand_right" (and if you did the 3d shell tutorial : "on spawn_shell") with the code below the tutorial in human.inc

Now lets open up human.inc

overwrite all the code you see here with the code that is below this tutorial. If spawn_shell isn't there don't worry that's from the 3d shell tutorial.

{on "link_weapon"
{if stuff "pistol"
{add_view "pistol_gilz" "shell" "fxshell"}
; {add_view "shell_smg" "shell" "foresight3"} ;as2
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
else stuff "shotgun"
{add_view "flash_shotgun" "flashbarrel" "foresight3"}
{add_view "shell_shotgun" "shell" "foresight3"} ;as2
else stuff "m12_shotgun"
{add_view "flash_shotgun" "flashbarrel" "foresight3"}
; {add_view "shell_shotgun" "shell" "foresight3"} ;as2
else stuff "rifle"
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
{add_view "gun_gilz" "shell" "fxshell"}
; {add_view "shell_mgun" "shell" "foresight3"} ;as2
else stuff "sniper"
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
{add_view "gun_gilz" "shell" "fxshell"}
; {add_view "shell_mgun" "shell" "foresight3"} ;as2
{delay 0.8 {start_sound "weapon/sniper_far"}}
else stuff "smg"
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
; {add_view "shell_smg" "shell" "foresight3"} ;as2
{add_view "gun_gilz" "shell" "fxshell"}
else stuff "mgun"
{add_view "flash_gun_big" "flashbarrel" "foresight3"}
; {add_view "shell_mgun" "shell" "foresight3"} ;as2
{add_view "gun_gilz" "shell" "fxshell"}
else stuff "sword"
; {add_view "shell_mgun" "shell" "foresight3"}
else stuff "flame_thrower"
{add_view "flamer_fire" "flame" "foresight3"}
{add_view "flamer_fire_barrel" "fire" "foresight3"}
{view show "fire"}
{view start "fire"}
else
{view hide "flashbarrel"}
{view pause "flashbarrel"}
{view pause "flame"}
}
}
{on fire "hand_right"
{call "veteran_start"}
{view show "flashbarrel"}
{view start "flashbarrel"}
{view start "shell"}
{delay 0.8 {start_sound "weapon/shell_drop"}}
{view start "flame"}
{kill_delay "fire"}
{delay 0.1 "shell"
{view pause "shell"}
}
{delay 0.4 "fire"
{view hide "flashbarrel"}
{view pause "flashbarrel"}
{view pause "flame"}
}
{spawn "bazooka_shot" "fxshot" x}
{call "spawn_shell"}
}
{on "spawn_shell" ;only present if you did the 3d shell tutorial
{if bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "fxshell" x scale 0.020
{impulse up 1.5 0.5 dir 1.0 0.7 fy 2.2 1.1 cy 4.2 0.1 cz 0.2 0.1 com}
{delay_effect 17 1 "stop"}
}}}
{if not bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "foresight3" x scale 0.020
{impulse up 1.5 0.5 dir 1.0 0.7 fy 2.2 1.1 cy 4.2 0.1 cz 0.2 0.1 com}
{delay_effect 17 1 "stop"}
}}}
}

select all of the above and replace it with the human.inc code below this tutorial.

I've checked MOW/MOWAS2 to see if MOW works with this and it does!

3.Setting up your mod and activating it.(Skippable if your pasting it into an existing mod)

now to finish creating your mod go to men of war/mods/yourmod/
create a file call it mod.info

paste this into mod.info

AS1/MOW:

{mod
{name "yourmod"} ;Must be the same name as folder name.
{desc "Shell Mod"}
}

AS2:

{mod
{name "yourmod"} ;Must be the same name as folder name.
{desc "Shell Mod"}
{minGameVersion "3.001"}
; latest game version your mod has been tested on and is compatible with
{maxGameVersion "3.201.1"}
}

start up men of war and activate the mod, play some battles for a while, and you'll see some of your units and ai units get their weapons jammed after some time in battle, which is rare but adds to the immersion.

CODE:


;SONNE2 JAM BEGIN;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;MAIN_MENU BEGIN ;to change jam ratio for different weapon types such as smg mgun search set_weapontype
{on "jam_enable"
{set "gun_jamming_enabled" 1} ;Disable/Enable Gun Jamming.
}
{on "gun_jam_mod_menu"
{set "ingame_jam_modifiers" 1} ;randomly gives decreased or increased proabability of jamming after it is fixed.
;Winter Season Modifiers, prevented both from being enabled so you don't get rekt.
{set "winter_season" 0} ;makes all guns jam +.0065% more. ;\
{if not "winter_season" ;siberia_winter_season can be enabled if winter_season is disabled ; \
{set "siberia_winter_season" 0}} ;makes all guns jam +.0155% more. must have Winter_Season disabled for it to work. ; \ ;wait ;Did you see that? ;look closer ^ ; ITS THE ILLUMINATII OH MY F"KING GOD NOO! ;-SONNE2 1994-2015 REKT.
{set "winter_sound" 1} ;winter sound misc. if winter_season's is enabled ;

;Terrain Influence
{set "terrain_influence" 1} ;when soldiers are LYING DOWN >:D, on snow or swamps,sand,mud, and shallow water they will be more at risk of jamming until they squat or stand up. TAKE THAT LYING UNITS!!! lol sorry I just couldn't help myself, this thingamajig had to be done, I hate it when the units just lie their and do nothing camp, shoot and kill my soldiers, this is a nice present to those bastards! SAY HAELLO TO MY LITTLE SCRIPT! |'_'|

{set "random_fix_timer" 1} ;Random jam fix timers disable to set to manual timer search for set_manualtimer

;HangFire
{set "hangfire" 1} ;randomly forces a delay to gunfire, could be potentially dangerous, as the surplus ammo could damage the barrel doing damage to the soldier's hands.
{set "cant_move" 1} ;stops the unit from moving to prevent the animation from conflicting with the movement. I MUST FIX THIS X_x.
{set "jam_fix_animations" 1} ;units get a reloading animation when trying to fix the weapon jam.
{if "winter_season" {if rand 0.0065 {tags add "js"}{tags add "winterjam"} }}
{if "siberia_winter_season" {if rand 0.0155 {tags add "js"}{tags add "winterjam"} }}
}
{on "jam_modifiers_menu"
{if "ingame_jam_modifiers" {if tagged "jamca" {if tagged "js" {if rand 0.7 {tags remove "js"}{tags remove "winterjam"}{delay 0.2{damage_report "body" "<c(00ff18)>."}}}}}} ;decrease jam
{if "ingame_jam_modifiers" {if tagged "jamre" {if tagged "js" {if rand 0.0055 {tags add "js"}{delay 0.2{damage_report "body" "<c(ff0000)>."}}}}}} ;increase jam
}
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;MAIN MENU END

;TERRAIN JAM INFLUENCE WHILE LYING;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;

{on "terrain_influence_1"
{if "terrain_influence"
{if lying ;don't lie down on these terrain types or else you run the risk of jamming your gun!!! @@ you can turn it off in the menu, but I'd leave it on as it will balance the game, lying units will no longer be invincible camping schallywags.
{if terrain_fx "snow" {if rand 0.0055 {tags add "js"}{start_sound "human/move/snow"} {damage_report "body" "<c(9e8af6)>snow jammed the gun"}}}
{if terrain_fx "sand" {if rand 0.0045 {tags add "js"} {start_sound "human/move/sand"}{damage_report "body" "<c(e5c200)>sand fell into the ejection port"}}}
{if terrain_fx "shallow_water" {if rand 0.0025 {tags add "js"} {start_sound "human/move/swim"}{damage_report "body" "<c(bdbdbd)>water fell into the ejection port"}}}
{if terrain_fx "swamp" {if rand 0.0045 {tags add "js"}{start_sound "human/move/swim"} {damage_report "body" "<c(5d4e00)>water and dirt fell into the ejection port"}}}
{if terrain_fx "mud" {if rand 0.0045 {tags add "js"}{start_sound "human/move/snow"} {damage_report "body" "<c(ff892a)>mud fell into the ejection port"}}}
}}}

;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;


(define "tags_remove" ; so weapons switch their jamming data on weapon switch.
{if tagged %iftag
{tags remove %tagrem
}})


{on "link_weapon"

{if stuff "pistol" ;pistol
{tags add "pistolw"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"};;;;;;;;;;;JAMMABLE;;;;;;;;;;;
("tags_remove" iftag("pistolw") tagrem("smgw riflew sniperw shotgunw mgunw"))
{add_view "pistol_gilz" "shell" "fxshell"}
{add_view "flash_gun_small" "flashbarrel" "foresight3"}

else stuff "smg" ;smg
{tags add "smgw"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"};;;;;;;;;;;JAMMABLE;;;;;;;;;;;
("tags_remove" iftag("smgw") tagrem("pistolw mgunw riflew shotgunw sniperw"))
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
{add_view "gun_gilz" "shell" "fxshell"}

else stuff "rifle" ;rifle
{tags add "riflew"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
{add_view "gun_gilz" "shell" "fxshell"}
("tags_remove" iftag("riflew") tagrem("pistolw mgunw smgw shotgunw sniperw"))
else stuff "ptr" ;rifle
{tags add "ptrw"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
("tags_remove" iftag("ptrw") tagrem("pistolw riflew jammable mgunw smgw shotgunw sniperw"))

else stuff "sniper" ;sniper
{tags add "riflew"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{add_view "flash_gun_small" "flashbarrel" "foresight3"}
{add_view "gun_gilz" "shell" "fxshell"}
("tags_remove" iftag("riflew") tagrem("pistolw mgunw smgw shotgunw sniperw"))
else stuff "shotgun" ;shotgun
{tags add "shotgunw"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
("tags_remove" iftag("shotgunw") tagrem("pistolw mgunw smgw riflew sniperw"))
{add_view "flash_shotgun" "flashbarrel" "foresight3"}
{add_view "shell_shotgun" "shell" "foresight3"}

else stuff "m12_shotgun" ;shotgun
{tags add "shotgunw"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
("tags_remove" iftag("shotgunw") tagrem("pistolw mgunw smgw riflew sniperw"))
{add_view "flash_shotgun" "flashbarrel" "foresight3"}

else stuff "mgun" ;mgun
{tags add "mgunw"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
{tags add "jammable"} ;;;;;;;;;;;JAMMABLE;;;;;;;;;;;
("tags_remove" iftag("mgunw") tagrem("pistolw smgw riflew sniperw shotgunw"))
{add_view "flash_gun_big" "flashbarrel" "foresight3"}
{add_view "gun_gilz" "shell" "fxshell"}

else stuff "flame_thrower"
{tags add "mgunw"} ("tags_remove" iftag("flamew") tagrem("mgunw pistolw smgw riflew sniperw shotgunw")) ;;;;;;;;;;;NOTJAMMABLE;;;;;;;;;;;
{add_view "flamer_fire" "flame" "foresight3"}
{add_view "flamer_fire_barrel" "fire" "foresight3"}
{view show "fire"}
{view start "fire"}
else
{view hide "flashbarrel"}
{view pause "flashbarrel"}
{view pause "flame"}

} }






;WEAPON TYPE JAM WHICH WEAPON TYPE WILL JAM MORE OFTEN?;;;;;;;;;;;;;;;;;;;;;;;
;weapon_type;;;;;;;jam_type;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;
;set how often certain types of weapons will jam set_weapontype (0.0001)) ;.001% chance (0.0005)) ;.005% chance{on "pistoljam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}} ; the tag js pulls the weapon into the jamming proccess. EG. Narrator:FINISH HIM! Weapon:X_x-*pierce*-------{on "smgjam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "riflejam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "sniperjam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "shotgunjam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "mgunjam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;
{on "manual_fix_timer" ;minimum 3.7 max:mugen(infinity) set_manualtimer ;MANUAL TIMER
{if not "random_fix_timer" {delay 15 {tags add "fixed"}{call "jam_fix"}}}}

{on "jam_fix" ;FIXING THE JAM
{if tagged "fixed"
{if tagged "jam"
{tags remove "jam"}
{tags remove "fixed"}
{call "spawn_shell"}{start_sound "weapon/reload"} {delay 0.8 {start_sound "weapon/shell_drop"}} ;the evil shell has been removed.
{weapon_work "hand_right" 1}{if "cant_move"{chassis_work 1}} ;reenables the weapon
{if not dead {if able "select" {if not senseless ;so the knocked out and dead wont be able to fix it they will restart
{damage_report "body" "<c(00ff00)>jam fixed"}}}} ;just think about it, it doesn't make sense lol.
{talk "jubilation"} ;soldier "get ready for medals!"
{ani_stop "squat_reload_piat"}{ani_stop "lie_reload_piat"}
{if "cant_move"{chassis_work 1}}
{if not dead {if able "select" {if not senseless
{if "ingame_jam_modifiers"
{if rand 0.1
{attack_save}{damage_report "body" "<c(00ff00)>gun fixed: less jam"}{tags add "jamca"} ;jamca as in cautious
else rand 0.1
{attack_load}{damage_report "body" "<c(dd0000)>gun damaged: increased jam"}{tags add "jamre"} ;jamre as in reckless,
else rand 0.05
{attack_save}{damage_report "body" "<c(00ff00)>gun repaired: no more jamming at all"}{tags add "jamfi"} ;yay no more jamming!
}}}}} }}}
{on "hangfire" ;zik
{tags add "hangfire"}
{if rand 0.5 {weapon_work "hand_right" 0}} ;due to surplus ammo the gun will click but have a delay before firing, this could be potentially dangerous
{if not tagged "jamre"{damage_report "body" "<c(dd0000)>hangfire"}}
{if tagged "jamre"{damage_report "body" "<c(dd0000)>hangfire caused by damaged gun"}}
{start_sound "gui/misc_gui_select"}
{call "hangfire_chance"}
}
{on "hangfire_pt2"
{if rand 0.2 ("health_damage" c(50)) } ;hangfire damage to hands
{delay 0.3 {talk "injuring"}}
{if tagged "hfixed"
{tags remove "hangfire"}
{tags remove "hfixed"}
{weapon_work "hand_right" 1}
{call "hand_right"} }
}
{on "hangfire_chance"
{if rand 0.1
{delay 0.2 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.3 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.4 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.1 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.2 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.3 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.5 {tags add "hfixed"}{call "hangfire_pt2"}}
else rand 0.1
{delay 0.3 {tags add "hfixed"}{call "hangfire_pt2"}}
else
{delay 0.4 {tags add "hfixed"}{call "hangfire_pt2"}}
}}

{on fire "hand_right"

{if tagged "jam" {start_sound "gui/misc_gui_select"}}
{if tagged "jammable" ;only jammable weapons are to be jammed.


{call "jam_enable"} ;checks whether gun jamming is enabled or not.



{if "gun_jamming_enabled"

{call "gun_jam_mod_menu"} ;to configure jamming options
{if tagged "smgw" {call "smgjam"}}
{if tagged "riflew" {call "riflejam"}}
{if tagged "pistolw" {call "pistoljam"}}
{if tagged "mgunw" {call "mgunjam"}}
{if tagged "shotgunw" {call "shotgunjam"}}
{call "terrain_influence_1"} ;to check the other jam values
{call "jam_modifiers_menu"} ;to check the other jam values

{if "hangfire"
{if not tagged "jamre"{if rand 0.0002 {call"hangfire"}}} ;HANGFIRE 0.0002 chance
{if tagged "jamre"{if rand 0.0021 {call"hangfire"}}} ;damaged gun
}}
;LET THE RUSTLING BEGIN JAMMING BEGINS HERE
;{delay 0.0001
{if not tagged "hangfire"
{if not tagged "jamfi" {if not tagged "fixed" {if tagged "js"
{tags remove "js"} ;so the weapon can be jammed again some time later if not tagged jamfi
{weapon_work "hand_right" 0} ;stops the weapon from firing
{if "cant_move"{chassis_work 0}} ;stops the soldier from moving while fixing the jam
{tags add "jam"}
{delay 0.3 {if able "select" {if rand 0.5 {start_sound "gui/misc_gui_select"}}}} ;Put able select so the dead won't try to fix their pb and jam in the morning, ahem I meant weapon jam.
{delay 0.6 {if able "select" {if rand 0.5 {start_sound "gui/misc_gui_select"}}}} ;also the sound is the soldier trying to pull the trigger and failing to shoot. For AS1 and 2, for mow you'll have to make your own trigger sound.
{delay 0.8 {if able "select" {if rand 0.5 {start_sound "gui/misc_gui_select"}}}} ;the soldier repeats pulling the trigger, thinking he/she may have a fatigued finger, giving as much force the next time.
{delay 1.4 {if able "select" {if rand 0.5 {start_sound "gui/misc_gui_select"}}}}
{delay 1.6 {damage_report "body" "<c(9e8af6)>jammed"}{delay 5 1 {if tagged "jamca" {if rand 0.1 {damage_report "body" "<c(9e8af6)>it still jammed!?"}} {tags remove "jamca"}}{if tagged "jamre" {if rand 0.1 {damage_report "body" "<c(9e8af6)>jammed again huh"}} {tags remove "jamre"}}}}
{delay 2.0 {talk "injuring"}} ;Jimmies have been rustled.
{delay 2.1 {if able "select" {if rand 0.8 {start_sound "gui/misc_gui_select"}}}}
{delay 2.2 {if able "select" {if rand 0.7 {start_sound "gui/misc_gui_select"}}}}
{delay 2.3 {if able "select" {if rand 0.6 {start_sound "gui/misc_gui_select"}}}}
{delay 2.4 {if able "select" {if rand 1.0 {if tagged "winterjam" {damage_report "body" "<c(9eccff)>by the winter"}{talk "injuring"}{if "winter_sound" {start_sound "world/winter/04"}{tags remove "winterjam"}}}}}}
{delay 3.4 {if able "select" {if rand 0.5 {start_sound "gui/misc_gui_select"}{delay 3.5 {talk "things_look_blue"}}}}} ;RUSTLED JIMMIES CONFIRMED
{delay 3.5 {if "jam_fix_animations"{if able "select" {tags add "jam"} {if rand 0.7 {ani_play "squat_reload_piat" 1.0 loop} else {ani_play "lie_reload_piat" 1.0 loop}}}}} ;animations of fixing the weapon}
;Fixing the Jam ;get rid of the shell that jammed your weapon, the immersion is real.
{delay 3.6 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 3.51 {if tagged "jam"{if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>halp"}{delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }{delay 3.61 {if tagged "jam"{if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>halp"}{delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 3.7 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 3.71{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>agh"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 3.8 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 3.81{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>no "} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 4.4 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 4.41{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>ugh"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 5.3 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 5.31{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>why"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 6.6 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 6.61{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>omg"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 7.8 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 7.81{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>X_x"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 8.4 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 8.41{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>X_X"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 9.3 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 9.31{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>x-x"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 10.6 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 10.61{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>-_-"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 11.8 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 11.81{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>X_-"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 12.4 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 12.41{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>-_X"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 13.4 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 13.41{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>x-X"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 14.4 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 14.41{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>X-x"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }
{delay 15.4 {if able "select" {if rand 0.3 {if tagged "jam" {start_sound "weapon/reload"}}}}}{delay 15.41{if tagged "jam" {if not able "select" {tags remove "jam"}{throw_on_ground}{damage_report "body" "<c(f9d800)>@_@"} {delay 0.01 {ani_stop "squat_reload_piat"}{delay 0.012{ani_stop "lie_reload_piat"}}} }} }


{if "random_fix_timer" ;Random Jam fix timers
{if rand 0.1
{delay 15 {tags add "fixed"}{call "jam_fix"}}
else rand 0.2
{delay 6 {tags add "fixed"}{call "jam_fix"}}
else rand 0.3
{delay 7 {tags add "fixed"}{call "jam_fix"}}
else rand 0.4
{delay 8 {tags add "fixed"}{call "jam_fix"}}
else rand 0.5
{delay 9 {tags add "fixed"}{call "jam_fix"}}
else rand 0.6
{delay 10 {tags add "fixed"}{call "jam_fix"}}
else rand 0.3
{delay 3.7 {tags add "fixed"}{call "jam_fix"}}
else rand 0.2
{delay 4 {tags add "fixed"}{call "jam_fix"}}
else
{delay 15 {tags add "fixed"}{call "jam_fix"} }}
else
{call "manual_fix_timer"} ;Manually set timer (go to menu to change)
}


}} } }};}

;{call "veteran_start"} {tags add "onward"}{delay 70 5 {tags remove "onward"}} ;thats for the veterancy script I'm foolishly trying to get to work mow and as1, I mean theres only so much you can do without the actual code for it. :( ...... X_x
{view show "flashbarrel"}
{view start "flashbarrel"}
{view start "shell"}
{if not tagged "jam"{if bone "foresight3"{if tagged "smgw"{delay 0.8 {start_sound "weapon/shell_drop"}}} {if tagged "mgunw"{delay 0.8 {start_sound "weapon/shell_drop"}}} {if tagged "riflew"{delay 0.8 {start_sound "weapon/shell_drop"}}} {if tagged "pistolw"{delay 0.8 {start_sound "weapon/shell_drop"}}} {if tagged "sniperw"{delay 0.8 {start_sound "weapon/shell_drop"}}} {if tagged "shotgunw"{delay 0.8 {start_sound "weapon/shell_drop"}}}}}
{view start "flame"}
{kill_delay "fire"}
{delay 0.1 "shell"
{view pause "shell"}
}
{delay 0.4 "fire"
{view hide "flashbarrel"}
{view pause "flashbarrel"}
{view pause "flame"}
}
{spawn "bazooka_shot" "fxshot" x}
{if not tagged "ptrw" {if bone "foresight3" {if not tagged "jam"{if tagged "smgw"{call "spawn_shell"}} {if tagged "mgunw"{call "spawn_shell"}} {if tagged "riflew"{call "spawn_shell"}} {if tagged "pistolw"{call "spawn_shell"}} {if tagged "sniperw"{call "spawn_shell"}} {if tagged "shotgunw"{call "spawn_shell"}}}}}
}
{on "spawn_shell"
{if not tagged "ptrw"{if tagged "jammable" ;giving mgun larger shells
{if tagged "mgunw" {if bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "fxshell" x scale 0.025
{impulse up 1.5 0.5 dir 1.0 0.7 fy 2.2 1.1 cy 4.2 0.1 cz 0.2 0.1 com}
{delay_effect 17 1 "stop"}
}}}}
{if tagged "mgunw" {if not bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "foresight3" x scale 0.025
{impulse up 1.5 0.5 dir 1.0 0.7 fy 2.2 1.1 cy 4.2 0.1 cz 0.2 0.1 com}
{delay_effect 17 1 "stop"}
}}}}

{if not tagged "mgunw" {if bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "fxshell" x scale 0.015
{impulse up 1.5 0.5 dir 1.0 0.7 fy 2.2 1.1 cy 4.2 0.1 cz 0.2 0.1 com}
{delay_effect 17 1 "stop"}
}}}}
{if not tagged "mgunw" {if not bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "foresight3" x scale 0.015
{impulse up 1.5 0.5 dir 1.0 0.7 fy 2.2 1.1 cy 4.2 0.1 cz 0.2 0.1 com}
{delay_effect 17 1 "stop"}
}}}}
} }}


;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;
;;;comment on moddb page if you encounter bugs;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;
;SONNE2 SPACE JAM END ;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;; ;;;;;;;X_x;;;;;;;;;;;;;; ;;;;;;;SHENMUE 3 FOR THE WIN!!!!!

Comments
PetrenkaPie
PetrenkaPie

thanks a lot!

btw: is there an "immersion" related scriptpackage for everyone to use?

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

this is it for now, until I come up with something else again

Reply Good karma+1 vote
newboy101
newboy101

Sonne, do you think you can port the grenade timer message from as2 to mow?

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

I tried doing that last year, I failed due to it being a hardcoded string in the ingame.lng localization file.

Reply Good karma+1 vote
Sundiata Author
Sundiata

hey everyone if you did this tutorial before this comment was made please search in your human.inc for smgjam if its not there you may have to recopy this script.

I forgot to include the following:

{on "pistoljam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "smgjam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "riflejam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "sniperjam" {if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "shotgunjam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}
{on "mgunjam"{if "gun_jamming_enabled" {if bone "foresight3" {if rand 0.0005 {tags add "js"} }}}}


because I used ctrl+X to paste it as an example in the tutorial I actually cut it out of my own human.inc X_x. Must.Proof.Read.Before.Publishing....

FACEPALM. EPIC FAIL

Reply Good karma+1 vote
Sundiata Author
Sundiata

Don't forget, all my codes are free to use with or without credit, have fun!

Also don't forget to configure the menu's of the codes to your liking. If you don't know how to, then comment here how you want the code to be and I'll post a pastebin link with the sets.

Reply Good karma+1 vote
agzaz
agzaz

Sonne can you help me? When i try to use the Weapon jamming and the Revival script at the same time the game always crash. But when i use one of them it doesnt?

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

what does the error say?

also paste your human.inc with both scripts on pastebin and link it here.

Reply Good karma+1 vote
agzaz
agzaz

here - Pastebin.com

error - Postimg.org

The other .inc file seem to have an error when i use both of your scripts. Even though they're the default one.

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

aw man, I had a feeling this would happen some time, other .inc files are adding flags such as "{if then", so there is too many of them.

try using this shorter revival script instead Pastebin.com

if it still gives the error you may have to only use one of them, or get rid of any .inc files you are not using.

I kind of expected Assault Squad 2 to have increased the tag limits of the engine, I guess not as there is still the 128 tag limit...why are there tag limits in this day and age? I have no idea.

If games such as Skyrim can hold up to 255 mods which can hold more than a million individual scripts, the gem engine should atleast be able to hold more than 128 tags in a few .inc files, especially in this decade(this limit has been present since SHOWW2 from 2004).

Then again, the development team is probably focused on other things like multiplayer functions at the moment, I don't blame them as Assault Squad's series is all about multiplayer lol, but it would be nice to increase the tag limit for the .inc files while they're at it, or do it in call to arms, it would be so awesome!

Reply Good karma+1 vote
agzaz
agzaz

Ohh....... so that whats all about.

Alright im gonna try the shorter one

btw, i just want the quote only. If it possible what should i do to make them appear ?

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

The shorter version doesn't have any quotes, because they are what added too many tags.

Reply Good karma+1 vote
agzaz
agzaz

The shorter one work.

Also, thanks for helping me.

Reply Good karma Bad karma+1 vote
Guest
Guest

This comment is currently awaiting admin approval, join now to view.

Post a comment
Sign in or join with:

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.

Tutorial
Tags
Fix, Free, Tutorial
Browse
Tutorials
Report
Report
Share
Related Games
Men of War
Men of War Real Time Tactics
Men of War: Assault Squad
Men of War: Assault Squad Real Time Tactics
Men of War: Assault Squad 2
Men of War: Assault Squad 2 Real Time Tactics
Related Engines
GEM 2
GEM 2 Commercial
Related Groups
1C Company
1C Company Developer & Publisher
Best Way
Best Way Developer & Publisher
Digitalmindsoft
Digitalmindsoft Developer & Publisher