Need help with custom weapons

C++ Got ya down? Half-Life 2 Coding Related.
Post Reply
STALKER Raince
Vertex
Vertex
Posts: 9
Joined: Tue Sep 29, 2009 8:23 pm

Need help with custom weapons

Post by STALKER Raince »

Hey guys.
I need help!
I tried to script Halo weapons for OC. I now have following problem: ingame the sounds dont work and the Assault rifle and the pistol are suddenly left handed. I made a new Base_Halo script but i know that it somehow it wont work. I would like to know if i have to find a script to make the Base script work. then i want to know if i have to write something in the custom_weapons to swap the hands.

please help me. then i start to make a halo coop map.
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Hello.

If your using custom sound scripts then you need the modify.txt (obsidian/maps/cfg) to have it aswell for the map you intend on having the weapons in.

Here is an example of one of mine:

Code: Select all

SpawnItems
{
    "weapon_smg1" "1"
    "weapon_crowbar" "1"
    "weapon_shotgun" "1"
    "weapon_uzi" "2"
    "item_battery" "1"
    "item_ammo_smg1" "5"
    "weapon_healer" "1"
}
"SoundCache"
{
    "Base_CHARGER"		"1"
}
}
}
Note if you experience trouble then add any other defualt scripts that the map may need.

If you want your sounds for all maps then I think you would have to edit an exsisting wepaons script and add your stuff to the bottom, though players and server would need the script.
Your better of using modify.txt's imo.

To swap hands you need some thing like this:

Code: Select all

"BuiltRightHanded" 		"0"
"AllowFlipping" 		"1"
Hope that helps.... (Oh and I hope you'll release your work, we need more content out thar amongst the public, fingers crossed).
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

Also just a note: Have you checked the weapons in thirdperson view?
If they are shooting out of the player origin (players stomach), you may also not hear the sounds.

If this is the case then your w_models would need fixing.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
STALKER Raince
Vertex
Vertex
Posts: 9
Joined: Tue Sep 29, 2009 8:23 pm

Post by STALKER Raince »

Thanks. The weapons are now on the right side. But the sounds still dont work. i made a test_scripted_weps_modify.txt for the map (test_scripted_weps) and there wrote "soundcache Base_Halo" but they still dont work. but another question: can i make a static "viewmodel_fov 74" becuz then the weps look better. and oh before i forget: i may need a skinner becuz the materials look retarded and need to be remade. But thanks fug4life. im gonna release the weapons and the map.
fug4life
Beta Tester
Beta Tester
Posts: 4093
Joined: Mon Dec 11, 2006 10:35 am

Post by fug4life »

I dont know much about weapon models and fov sorry.

Though if your still getting stuck, you could post or pm some examples of your scripts etc for inspection. Or release as beta/work in progress. And I'lll take a look, see if I can help.
'I would probably smarten up before you meet Violet'.
'She has zero tolerance for idiots'.

fug's Obsidian files
fug's Obsidian clips
Obsidian wiki
Obsidian Map Database
Post Reply