Adding Sound to Geonosian Gun

Started by DanielSon777, October 15, 2016, 08:24:25 PM

Previous topic - Next topic
I was able to sucessfully add the Geonosian gun, the Blunderbus, in place of the rebal piolet shot gun and the model detail and animation works great, but there is no sound when it's fired.

FireEmptySound        = "com_weap_inf_weapon_empty"  <<< this was commented out

FireSound               = "cis_weap_inf_sonicblaster_fire"
ReloadSound           = "laserreload"

This is what is inside the "geo_weap_inf_blunderbuss.odf" file.

I was able to change the sound of the dark trooper shotgun to that of the gun turrents on cloud city, so I've changed the sound of the fired weapon before, but I don't know how/why it isn't the same with the blunderbus. Help?

I was also hoping to find out how to add a 'force push' effect with the blunderbuss. So when the gun is fired, the target unit with be knocked back a couple of feet. I tried creating a 'geo_weap_inf_blunderbuss_exp.odf' file but it was not successful; the game crashed when the unit spawned.

I can't remember well, but I'm pretty sure that sound lvl file is loaded in the Geonosis mission luas only ("only load the stuff you need" is a general rule in game development).

You will need to modify the mission file for any sound loading stuff in battlefront.

You can take a look at geonosis lua scripts in a mission builder for reference.

I think just putting

ReadDataFile("sound\\geo.lvl;geo1cw");
   
before

ReadDataFile("SIDE\\rep.lvl",

in your mission LUA will give the Geonosis gun sound. Like RepComm says, if you want a sound effect in your map, you will have to load the sound.lvl in your LUA.

This is what the beginning of my missions lua file looks like, reading the comments you can see where I added the data.

--start header
function ScriptInit()
local ALL = 1
local IMP = 2
local ATT = 1
local DEF = 2
--end header
--start objectives
AddMissionObjective(IMP,"red", "level.HERE.objectives.1");
AddMissionObjective(IMP,"orange", "level.HERE.objectives.2");
AddMissionObjective(IMP,"orange", "level.HERE.objectives.3");
AddMissionObjective(ALL,"red", "level.HERE.objectives.1");
AddMissionObjective(ALL,"orange", "level.HERE.objectives.2");
AddMissionObjective(ALL,"orange","level.HERE.objectives.3");
--end objectives
--start soundlvl
ReadDataFile("sound\\geo.lvl;geo1cw"), -- added here by suggestion of SWBFgamersdotcom
ReadDataFile("sound\\tat.lvl;tat1gcw");
--end soundlvl

-- Start sidelvls
ReadDataFile("sound\\geo.lvl;geo1cw"), -- added here by suggestion of SWBFgamersdotcom
ReadDataFile("SIDE\\all.lvl",
"all_inf_basicdesert",
"all_hover_combatspeeder",   -- added here
"all_inf_lukeskywalker",
"all_inf_smuggler");

ReadDataFile("sound\\geo.lvl;geo1cw") -- added here by suggestion of SWBFgamersdotcom
ReadDataFile("SIDE\\imp.lvl",
"imp_inf_basic_tie",
"imp_walk_atat",   -- added here
"imp_inf_darthvader",
"imp_inf_dark_trooper");
--end sidelvls

When I munge however I get an error (because I don't know how to add spoilers I'll type it):

**********
Debug Assertion Failed!
Program: ...FBuilder\DataHERE\_BUILD_PC\..\..\ToolsFL\Bin\ScriptMunge.exe
File: c:\src\frontline\toolsfl\scriptmunge\source\scriptmunge.cpp
Line:191

Expression: ErrorCode == 0

For information on how your program can cause an assertion failure, see the Visual C++ documentation on asserts.
**********

The munging process however continues and the map and everything loads fine, but I still can't get the gun sound effect when I fire. Did I do something wrong?

The error clearly is saying that you have a problem on line 191.
Open your this lua file again and press ctr+G and type 191 inside.
The program will move you to line 191.There you have a problem.You probably messed up something.

Also like the people early told you,you must add the Bespin ReadData sound.lvl file and your sounds will work.