Weapon porting and proper scripting

Codename CURE763 views31 favorites4 min readby I can't aimUpdated 16 Mar, 2018View on Steam ↗

Only for for Single-Player and host, so far.

As much as i hate to say this, But it seems that the Multiplayer can't seem to make the scripts function right, thus making a big glitch on reloading and shooting at times.

Also the host can have the addons, but other player's addons may be glitchy as well.

I am doing my best to figure out this problem ASAP. So please bare with me. and if you have happend to actually be able to help, please do so. I would really appreciate it!

Reminder

I know this is obvious, But might as well say it.. When publishing weapon mods, Please be sure to always credit the original creator, Especially if it's from Gamebanana. Claiming it as your own will cause you into trouble. But then again, Just a friendly reminder.

Choose your weapon!

To begin, We shall choose any kind of weapon. Usually it's best to do it on a website such as Gamebanana[www.gamebanana.com].
I would want the MP5K replaced by the M4A1. so lets go ahead and download the mod

For this tutorial I'll chose this mod.

Making a folder

If you don't plan on making a folder on custom:
Make a folder and have the VPK convertor with you like this:
So you can transfer the VPK file to the custom folder.

If you do plan on making a folder on custom:
Make a folder on the custom folder
This will make scripting much easier without having to do the hassle of the use of VPK
After downloading, unzip the files to the file of the weapon:

Changing the model files of the weapon

This is where it gets abit tricky; The weapons for the MP5K will have both v_ and w_. Sometimes the mod will only just have v_
Since we're going to move it to the MP5K
Go inside models\weapons
We would want to rename the
v_rif_m4a1 to v_smg_ump45
As same goes for the
w_rif_m4a1 to w_smg_ump45
Like this:
Before
After
https://i.gyazo.com/b62761231a94d414f5d02b3dffbb22c9.png
So far so good! But you're not done yet, As the mod is not sucessful yet.
This is what it looks like incase you're wondering.

Scripting: Sound tweaking

Now that we got the renaming done, We will want to script the weapon so it won't force you to be left handed as i previously showed.
If you perfer the left handed, That is no problem!
But we still need to script the sounds for fire sound. Reload sound still functions, but script is confused on what to use for the fire. That's where this script will come in handy.

If the folder already has a script by any chance, Then good. just go inside the folder and keep reading.

You'll want to have 2 scripts:
game_sounds_weapon_mp5k & sights_weapon_mp5

Though it's best if you get the script originally from the game itself, it can be found under:

Drag both of those to the script folder. You will also will come across 3 files that the mod came from, since it was for CSS. It will look like this:

remove the 2, but keep "weapon" folder. That will be the M4's weapon scripting, renaming it to game_sounds_weapon_mp5k also works too, and just rename the file inside the folder, drag the file out of the "weapon" folder. remove the folder. And it should look like this:

After all this, go inside the game_sounds_weapon_mp5k file; originally it will be like this:
Be sure to make it so that it detects as a MP5K. To make the script function the shot fire like the MP5K.
"Weapon_M4A1.Single" to "Weapon_UMP45.Single"
Also adding //UMP45 (mp5k)to the top
https://i.gyazo.com/5eed8290706b677c60cfd27ec7f2f74c.png
The sound will now function as a weapon since the script thinks you're using a MP5K weapon instead of the M4. but you're tricking the script.

Scripting: Right hand weapon

To change the hand to right hand, Inside the script sights_weapon_mp5; change the BuiltRightHanded from 0 to 1.

If you perfer left handed, Just leave it to "0"

Scripting: Aim down sight adjustment

You are almost close to finish!

Not all weapons you import are gonna aim down sights properly,
and that's ok.

With the script we looked at earlier sights_weapon_mp5. We can adjust it to anyway we like. Though for most, it's best to have it what Codename CURE originally had it as.

As the script shows:
Aim sight is set to the MP5K's aim sight setting. and we all know right away it won't aim down right. As shown:

Most of the time, you'll be adjusting for abit, but it'll pay off in the end.

with the fixed numbers, It will now look like this!

End

This can happend to any kind of weapon you wish to be in any kind of slot.
For example: AK-47 over Galil, Or TMP over MP5K, Or even a AUG over the MP5K!

And that's all you do! It's pretty simple and pretty fun to do, Some may find this very hard and confusing and it's understandable, You can take the time to read all of this carefully, and if i happend to miss a detail. I can clearly edit it in to make things easier!

And acoridng to some, The script may not exaclty work for Multiplayer on their end. and it can be just cause mostly of conflicting issues with other mods. I will look more into details hopfully about the whole reload glitches that some fans were having issues with.

Happy modding! and be sure to credit the original modder who made the weapon.

M4 over MP5K is also released!

This guide was created by its original author on the Steam Community. Are you the author and want it removed? Request removal.