Men of War: Assault Squad features a completely new cooperative skirmish game mode with access to five different nations (Russia, Germany, USA, Commonwealth and, for the first time ever in the Men of War series, Japan) as well as increased realism and accessibility.

Post tutorial Report RSS 3D Shell Casing Tutorial 5/31 Bazooka's FIXED.

This will show you how to spawn shell casings each time a weapon is fired. Works exactly as the Shells from cannons that disappear after some time. Shells appear for all firearms this time!, and mounted heavy machine guns will work by following steps 2b and 2c! Now Bazookas no longer spawn shells!!!

Posted by on - Basic Other

3D Shell Casing Tutorial(Bazookas HAVE BEEN FIXED).

Works with all MOW/AS/AS2 and etc.

Code has been updated!, Can't believe it was so simple, had to add if bone "fxshell" so it can check if the "fxshell" is present on the gun, if not then they use the "foresight3" bone! This is excellent!!

By copying the altered code below for human.inc, shells will appear on all your firearms now! >:D

As for Heavy Machine Guns(Mounted), fixed that as well, look at steps 2b and 2c and copy the code on the bottom for vehicle.inc.

By following steps 2b and 2c shells will appear for your heavy mounted machineguns!

AS2:us marine and japanese soldier skins from 3000 miles to tokyo mod.

Shells disappear after some time!


MOW:

There are Four 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" with this code in human.inc
2b.Copying the Vehicle.inc file to your mod directory(skippable if you already have it.)
2c.Overwriting "on fire mgun" with this code in vehicle.inc
3.Setting up your mod and activating it.(Skippable if your pasting it into an existing mod)
4.Getting it to work with mounted heavy machine guns.
5.For AS2, getting rid of the default 2 Dimensional "Texture Bullet" XD

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

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 fire hand_right" with this code in human.inc(for carried firearms)


Now lets open up human.inc

search for "on fire" and you will see this.

{on fire "hand_right"
{view show "flashbarrel"}
{view start "flashbarrel"}
{view start "shell"}
{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}
}

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

I've checked MOW/MOWAS2 on fire code and they are both identical, so they both work with this! >:D

2b.Copying the Vehicle.inc(for Heavy Mounted Mgun's) file to your mod directory(skippable if you already have it.)

Installation: If you don't have a vehicle.inc go to men of war/game.pak or gamelogic.pak set/interaction_entity/vehicle.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 vehicle.inc to the interaction_entity folder you just created.

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

2c.Overwriting "on fire mgun" with this code in vehicle.inc

Now lets open up vehicle.inc

search for "on fire" and you will see this.

{on fire "mgun"
{view start "flashbarrel3"}
{ani_play "fire_mgun"}
{view start "shell"}
{delay 0.1 "shell"
{view pause "shell"}
}
}

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

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, fire a gun and shells will appear and then disappear after some time, Found out how to make the shells last longer, read below


4.For AS2 Getting Rid of the 2 Dimensional "Texture Bullet "

(Skippable if you don't see this when you fire a gun)

look above this code, and you will see {on "link_weapon"

find all mentions of this:

human.inc

{add_view "shell_smg" "shell" "foresight3"}
{add_view "shell_mgun" "shell" "foresight3"}

vehicle.inc (for mounted heavy mguns)

{add_view "shell_mgun" "shell" "fxshell"}

and remove it by placing a ; at the beginning of the line or you can just delete it.

Definitions:

{spawn "shell_cannon" "foresight3" ;could also be "fxshell" see the definition of it below.

"Foresight3" - Shell Casings appear at the barrel or the very end of the gun. Appears for all guns. I use this instead of "Fxshell".

"Fxshell" - alternative for "Foresight3" Shell Casings fall from gun's ejection port, just like in real life. Doesn't appear on guns that don't have the "Fxshell" Bone in their .mdl file, but since 5/18's update they do.
But you can manually copy the Fxshell bone from an identical gun's .mdl file into yours, so the shells will appear on fxshell's bone, instead of foresight3 if fxshell isn't in the .mdl file .

Shell_Drop Sound(Optional):

{delay 0.8 {start_sound "weapon/shell_drop"}} is the sound you can create for the shell casings dropping to the ground sound.

This is the path if you want to add the shell_drop sounds to make it more realistic
Men of War\mods\yourmod\resource\sound\weapon\shell_drop

in the shell_drop folder make a file and name it folder.set and paste this into it.

{sound
{tag environment} ;in the sound options menu, moving the environment slider will move this.
{loudness "footstep"};so the sound will decrease with distance
}

Youtube.com shell drop sample sounds

Moddb.com zip file for those who are lazy or don't have enough time to sample their own sound.


x scale 0.025 - big size, so you can see it

x scale 0.015 - normal, hardly able to see it

CODE:

Realistic. Moves by the direction of the map though.

Human.inc(Firearms)

		{on fire "hand_right"
		{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"
 {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"}
 }}}
 }


Vehicle.inc(Heavy Mounted Machine Guns)


{on fire "mgun"
		{view start "flashbarrel3"}
		{ani_play "fire_mgun"}
		{view start "shell"}
{delay 0.9 {start_sound "weapon/shell_drop"}}       
		{kill_delay "shell"}
		{delay 0.2 "shell"
			{view pause "shell"}
			{view pause "flashbarrel3"}
		}
    {call "spawn_shell"} 
   {delay 0.01 {call "spawn_shell"} }
	}
 {on "spawn_shell"
 {if bone "fxshell" {if not bone "fxshot" {spawn "shell_cannon" "fxshell" x scale 0.030 
 {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.030 
 {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"}
 }}}
 }


to make the shells last longer:

copy dummy.inc from gamelogic/game.pak/set/interaction_entity to yourmod/resource/set/interaction_entity

open it up, search for "small part" and you will see this

{on spawn
; {con "spawn small part"}
{delay 0.1
{volumes disable bullet contact blast touch}
}
{delay 2 {volumes enable bullet contact blast}}
{call "stop_view"}
{delay 25 15 {hide 10}}
}

delete the code in red or set it to a bigger delay like {delay 60 50 {hide 10}} . Warning (May cause lag)

for performance set it to {delay 5 1 {hide 0.1}}

Comments
PetrenkaPie
PetrenkaPie

i like it when people tutorial dirty with me.

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

lol? does it work?

Reply Good karma+1 vote
DUBONTIMEđź‘˝
DUBONTIMEđź‘˝

Great feature, but I've noticed the shell spawn at the foresight and heavy machine guns don't have the 3d shell fx.

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

okay, I've found out the mounted machine guns and tank machine guns don't have the "foresight3" bone, but they do have the "fxshell" bone, however the mounted mguns aren't linked to human.inc, its in cannon.inc. I'll try and include a cannon.inc guide too to fix that, as for the shell spawning at the foresight, fxshell makes it spawn at the ejection port, so replacing "foresight3" with "fxshell" will give it a more realistic feel, but be warned some guns don't have the fxshell bone.

Reply Good karma+1 vote
DUBONTIMEđź‘˝
DUBONTIMEđź‘˝

I see, also when rocket launchers are fired they eject a cannon sized shell.

Reply Good karma Bad karma+2 votes
Sundiata Author
Sundiata

I've noticed that too lol.

Reply Good karma+1 vote
Sundiata Author
Sundiata

finally fixed the heaavy mounted machine guns, it wasn't in cannon.inc but vehicle.inc . Also updated the code to allow both the fxshell and foresight bone to be used.

Gonna try to fix that bazooka shot fx

Reply Good karma+1 vote
Sundiata Author
Sundiata

X_x this may take a while.

Reply Good karma+1 vote
Guest
Guest

you may want to disable shell spawn when using flamers and rocketlaunchers :)
like this:
{on "spawn_shell"
{if stuff "pistol"
*original on "spawn_shell" code*
else stuff "smg"
*same*
...
}
}

Reply Good karma Bad karma0 votes
Guest
Guest

ahh nevermind it doesn't work
****!

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

Exactly how I feel right now, funny how I can make big scripts but I can't fix one small issue like this X_x.

Lets hope for a miracle.

Reply Good karma+1 vote
Sundiata Author
Sundiata

alright! Bazooka's no longer spawn shells! Updated the code!

Now its time to fix flamethrowers!

Noticed that bazooka mdl files have an fxshot bone, so I put "if not bone "fxshot"", so any weapon that has bone fxshot will be ignored and won't spawn any shells.

Tried doing the same with flamethrowers but no success, yet. hint hint.

Reply Good karma+1 vote
Guest
Guest

your last resort is to add some "flag" bones to flamers/zookas/anything that shouldn't spawn shells and check if that bone is not present...

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

thats the only thing I can do to stop the shells from spawning on flamethrowers, as there is no other way besides this one. Thanks!

Reply Good karma+1 vote
takemikazuchi
takemikazuchi

hi, can you make mod thats make bullet/shells ricoche wen hit terrain/ground, like in war thunder.
sory for my english

Reply Good karma Bad karma+1 vote
jezko4
jezko4

Hi, Im making new fx for As2 and I have two problems: 1.When tank shoots it spawns a smoke effect which I want to delete but I cant find it in code or fx library(I deleted everything in muzzle.inc assigned to muzzle but that smoke effect is still there) 2.My new muzzle for fire arms contains one little explosion but when I fire from the gun the explosion show only for the first shot and when I fire again its not here.Can you help me please?Thanks.

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

hmmm, paste your vehicle.inc on Pastebin.com and link it here.

Reply Good karma+1 vote
jezko4
jezko4

Well I found it in the tank_medium.inc and fixed it.Im almost done with my FX mod but I still have the second problem I posted above.I want machine guns to emit smoke but they cant.

Reply Good karma Bad karma+1 vote
Sundiata Author
Sundiata

hmm, if its a handheld machinegun paste your human.inc, if its a mounted machine gun paste your vehicle.inc and I'll tell you where the problem is.

Reply Good karma+1 vote
jezko4
jezko4

Well I fixed it again.On the first try I created loop of emitting smoke and then added pause to stop it.For the past days I resimulated and (almost)completely remastered all FX and I wanted MGs to emit smoke but there is something wrong with the game file system (battle of empires).I wanted to do all the details but then I talked to the devs and they told me that the whole mod will not work in the most played part(multiplayer) so I will develop it fully only for the DMS GEM games.Just hope that they will change the file system for the Gates of Hell.Thanks for replies.

Reply Good karma Bad karma+2 votes
Sundiata Author
Sundiata

no problem. XD

Reply Good karma+1 vote
Sundiata Author
Sundiata

latest version of call to arms incorporated a better version of 3d shell ejection! perfection at its finest.

Reply Good karma+1 vote
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.

Follow Report Profile
Icon
Men of War: Assault Squad
Platforms
Windows
Developer
Digitalmindsoft
Publisher
1C Company
Engine
GEM 2
Contact
Send Message
Homepage
Menofwargame.com
Release date
Game watch
Follow
Tutorial
Tags
Fix, 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