Attaching sounds to objects -1 reply

  • 1
  • 2

Please wait...

Mr_Cheese

FH Dev

50 XP

12th June 2004

0 Uploads

1,997 Posts

0 Threads

#1 13 years ago

This forum's been a bit quiet over the past few days hasn't it?! Everyone got exams or something? (I know I have!)

Anyways, this post does have a point... firstly - Cretan Village is technically finished! I'm hopefully going to be running a beta test on www.forgottenmaps.net at some point in the near future - as many testers as possible would be great! :) secondly - everything's pretty much as I wanted it (or better!) on the map although there is one thing that would be an improvement: I would like to give the Ju52s flying overhead sounds. Currently there is just the sound of planes flying post "built-in" to the general background sound. The problem is the Ju52s in the game and those in the sound don't always match up so I would like to make it so the in-game objects play the default Ju52 sound (it's a shame - the ones in the background were genuine Ju52s!). Here's the code fromt he Ju52's objects.con: Can I just add a line in somewhere that points to the Ju52 sound from FH? If so what? Otherwise is there any other way of doing it? Cheers




CamelNele

Norwegian Resistance

50 XP

21st May 2005

0 Uploads

27 Posts

0 Threads

#2 13 years ago

If you just want to add the engine-sound of the flying Ju52, then just add these lines to the Ju52overhead : [color=darkorange]ObjectTemplate.loadSoundScript Sounds/Ju52Engine.ssc[/color] [color=darkorange]ObjectTemplate.loadSoundScript Sounds/Ju52Engine1.ssc[/color] Be sure to copy the Sound-folder from the Ju52-folder also. :)




Mr_Cheese

FH Dev

50 XP

12th June 2004

0 Uploads

1,997 Posts

0 Threads

#3 13 years ago

Thanks! I'll give that a go. Does it matter where in the file it goes?




Mr_Cheese

FH Dev

50 XP

12th June 2004

0 Uploads

1,997 Posts

0 Threads

#4 13 years ago

Apparently so - I put the lines in towards the top of the code and it crashed Bf1942... Is there a specific place they need to go?




CamelNele

Norwegian Resistance

50 XP

21st May 2005

0 Uploads

27 Posts

0 Threads

#5 13 years ago

Yes, it should be any active template ... i would just add it to the [color=royalblue]Ju52overhead[/color]-template ...




Mr_Cheese

FH Dev

50 XP

12th June 2004

0 Uploads

1,997 Posts

0 Threads

#6 13 years ago

Hm? Whereabouts?




CamelNele

Norwegian Resistance

50 XP

21st May 2005

0 Uploads

27 Posts

0 Threads

#7 13 years ago

Hm, sorry ... i was editing my post, but i also had to bath my son inbetween. When i wanted to post it, it said, that i can only edit posts for 30 minutes after entering it. Thats why it got lost. Now i will try to get it together again. :beamme: Ok, well, i was writing, that it was my mistake, i didn't look carefully. You should better add it to here : [color=orange]rem *** StaticRotatingJu52 ***[/color] [color=orange]ObjectTemplate.create PlayerControlObject StaticRotatingJu52 [/color] [color=orange]ObjectTemplate.setNetworkableInfo Ju52BodyInfo [/color] [color=orange]ObjectTemplate.NameTagOffset 0/0/4.6 [/color] [color=orange]ObjectTemplate.saveInSeparateFile 1 [/color] [color=orange]objectTemplate.cullRadiusScale 5 [/color] [color=orange]ObjectTemplate.hasMobilePhysics 1 [/color] [color=orange]ObjectTemplate.hasDynamicShadow 1 [/color] [color=orange]ObjectTemplate.drag 0.1 [/color] [color=orange]ObjectTemplate.mass 20000 [/color] [color=orange]ObjectTemplate.inertiaModifier 0.821/0.75/0.84 [/color] [color=orange]ObjectTemplate.hasCollisionPhysics 1 [/color] [color=orange]ObjectTemplate.hasResponsePhysics 1 [/color] [color=orange]ObjectTemplate.explosionRadius 8 [/color] [color=orange]ObjectTemplate.explosionDamage 5 [/color] [color=orange]ObjectTemplate.hasArmor 1 [/color] [color=orange]ObjectTemplate.angleMod 1 [/color] [color=orange]ObjectTemplate.speedMod 2 [/color] [color=orange]ObjectTemplate.hitpoints 400 [/color] [color=orange]ObjectTemplate.maxhitpoints 400 [/color] [color=orange]ObjectTemplate.material 24 [/color] [color=orange]ObjectTemplate.criticalDamage 100 [/color] [color=orange]ObjectTemplate.hpLostWhileCriticalDamage 2 [/color] [color=orange]ObjectTemplate.explosionForceMod 15 [/color] [color=orange]ObjectTemplate.hpLostWhileUpSideDown 10 [/color] [color=orange]ObjectTemplate.hpLostWhileDamageFromWater 10 [/color] [color=orange]ObjectTemplate.addArmorEffect 350 em_PlaneDamage -4.4/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 300 em_PlaneDamage -4.4/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 300 em_PlaneDamage 4.6/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 250 em_PlaneDamage 4.6/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 250 em_SBD-6Damage -4.4/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 250 em_PlaneDamage 0.1/0.3/7.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 200 em_SBD-6Damage -4.4/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 200 em_SBD-6Damage 4.6/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 200 em_PlaneDamage 0.1/0.3/7.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 150 em_SBD-6Damage -4.4/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 150 e_SBD-6Fire 4.6/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 150 em_SBD-6Damage 0.1/0.3/7.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 100 e_SBD-6Fire -4.4/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 100 e_SBD-6Fire 4.6/-0.6/4.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 100 e_SBD-6Fire 0.1/0.3/7.7 [/color] [color=orange]ObjectTemplate.addArmorEffect 0 e_ExplGas 0/0/0 [/color] [color=orange]ObjectTemplate.addArmorEffect 0 e_scrapmetal_Ju52 0/0/0 [/color] [color=orange]ObjectTemplate.addArmorEffect 0 e_scrapmetal_Ju522 0/0/0 [/color] [color=orange]ObjectTemplate.addArmorEffect -1 WaterWaterExplosion 0/0/0 [/color] [color=orange]ObjectTemplate.damageFromWater 1 [/color] [color=orange]ObjectTemplate.aiTemplate Ju52 [/color] [color=orange]rem ------------------------------------- [/color] [color=orange]ObjectTemplate.addTemplate lodStaticRotating [/color] [color=orange]rem ------------------------------------- [/color] [color=orange]ObjectTemplate.setSoldierExitLocation 1.5/0.3/-0.5 0/0/0 [/color] [color=orange]ObjectTemplate.GUIIndex 33 [/color] [color=orange]ObjectTemplate.setVehicleIcon "Vehicle/Icon_Ju52.tga" [/color] [color=orange]ObjectTemplate.setVehicleIconPos 112/65 [/color] [color=orange]ObjectTemplate.setNumberOfWeaponIcons 2 [/color] [color=orange]ObjectTemplate.setPrimaryAmmoIcon "Ammo/icon_JumpLightDoor.tga" [/color] [color=orange]ObjectTemplate.setPrimaryAmmoBar ABIconOnly [/color] [color=orange]ObjectTemplate.setSecondaryAmmoIcon "Ammo/icon_Ammocrates.tga" [/color] [color=orange]ObjectTemplate.setSecondaryAmmoBar ABAmmoBarOnly [/color] [color=orange]ObjectTemplate.setCrossHairType CHTNone [/color] [color=orange]ObjectTemplate.setVehicleCategory VCAir [/color] [color=orange]ObjectTemplate.setVehicleType VTLevelBomber [/color] [color=orange]ObjectTemplate.setToolTipType TTLevelBomber[/color] [color=orange]ObjectTemplate.setMinimapIcon "Minimap/minimap_icon_bomber_32x32.tga"[/color] [color=red]ObjectTemplate.loadSoundScript Sounds/Ju52Engine.ssc[/color] [color=red] [/color] And because there is another sound for the second engine also, lets just add it here in one of the next templates : [color=orange]rem *** StaticRotatingComplex ***[/color] [color=orange]ObjectTemplate.create Bundle StaticRotatingComplex[/color] [color=orange]ObjectTemplate.hasMobilePhysics 1[/color] [color=orange]ObjectTemplate.hasCollisionPhysics 1[/color] [color=orange]ObjectTemplate.hasResponsePhysics 1[/color] [color=red]ObjectTemplate.loadSoundScript Sounds/Ju52Engine1.ssc[/color] [color=orange]rem -------------------------------------[/color] [color=orange]ObjectTemplate.addTemplate lodJu52Cockpit[/color] [color=orange]ObjectTemplate.addTemplate Ju52Camera_For_PCO0[/color] [color=orange]ObjectTemplate.setPosition -0.5/1.45/3.4[/color] [color=orange]ObjectTemplate.addTemplate Ju52stickrotation[/color] [color=orange]ObjectTemplate.setPosition -0.652/0.051/4.133[/color] [color=orange]ObjectTemplate.addTemplate Ju52stickrotationR[/color] [color=orange]ObjectTemplate.setPosition 0.638/0.051/4.153[/color] [color=orange]ObjectTemplate.addTemplate Ju52ThrottleRotation[/color] [color=orange]ObjectTemplate.setPosition -0.157/0.763/4.205[/color] [color=orange]ObjectTemplate.setRotation 0/-35/0[/color] [color=orange]ObjectTemplate.addTemplate Ju52ThrottleRotation[/color] [color=orange]ObjectTemplate.setPosition -0.233/0.72/4.205[/color] [color=orange]ObjectTemplate.setRotation 0/-35/0[/color] [color=orange]ObjectTemplate.addTemplate Ju52Doorrotation[/color] [color=orange]ObjectTemplate.setPosition -1.194/0.616/-3.862[/color] [color=orange]ObjectTemplate.setRotation 150/180/0[/color] [color=orange]ObjectTemplate.addTemplate Ju52Seat[/color] [color=orange]ObjectTemplate.setPosition -0.6/1/3.7[/color] [color=orange]ObjectTemplate.addTemplate Ju52Entry[/color] [color=orange]ObjectTemplate.setPosition 0/0/3.8[/color]

[color=orange]ObjectTemplate.addTemplate Jumplight[/color] [color=orange]ObjectTemplate.setPosition -0.8/1.5/-3.362[/color] [color=orange]ObjectTemplate.addTemplate SupplyboxGun[/color] [color=orange]ObjectTemplate.setPosition 0/-3/-6[/color]

[color=orange]ObjectTemplate.addTemplate Ju52_PCO1[/color] [color=orange]ObjectTemplate.setPosition 0.118/1.0/-6.5[/color] [color=orange]ObjectTemplate.setRotation -180/0/0[/color]

[color=orange]ObjectTemplate.addTemplate Ju52_Passenger_PCO2[/color] [color=orange]ObjectTemplate.setPosition -0.5/0.15/0.4[/color] [color=orange]ObjectTemplate.addTemplate Ju52_Passenger_PCO3[/color] [color=orange]ObjectTemplate.setPosition 0.5/0.15/0.4[/color] [color=orange]ObjectTemplate.addTemplate Ju52_Passenger_PCO4[/color] [color=orange]ObjectTemplate.setPosition -0.5/0.15/-0.4[/color] [color=orange]ObjectTemplate.addTemplate Ju52_Passenger_PCO5[/color] [color=orange]ObjectTemplate.setPosition 0.5/0.15/-0.4[/color] [color=orange]ObjectTemplate.addTemplate Ju52_Passenger_PCO6[/color] [color=orange]ObjectTemplate.setPosition -0.5/0.15/-1.2[/color]

[color=orange]ObjectTemplate.addTemplate Ju52FlapR[/color] [color=orange]ObjectTemplate.setPosition 3/0.4/0[/color] [color=orange]ObjectTemplate.addTemplate Ju52FlapL[/color] [color=orange]ObjectTemplate.setPosition -3/0.4/0[/color] [color=orange]ObjectTemplate.addTemplate Ju52BodyWing[/color] [color=orange]ObjectTemplate.setPosition 0/0/0[/color] [color=orange]ObjectTemplate.setRotation 0/0/-89.999[/color] [color=orange]ObjectTemplate.addTemplate Ju52AileronR[/color] [color=orange]ObjectTemplate.setPosition 8.688/-0.393/-1.647[/color] [color=orange]ObjectTemplate.setRotation -4.627/-0.324/4.004[/color] [color=orange]ObjectTemplate.addTemplate Ju52AileronL [/color] [color=orange]ObjectTemplate.setPosition -8.688/-0.392/-1.645 [/color] [color=orange]ObjectTemplate.setRotation 4.409/-0.343/-4.454 [/color]

[color=orange]ObjectTemplate.addTemplate Ju52Elevator[/color] [color=orange]ObjectTemplate.setPosition 0/1.127/-14.230[/color] [color=orange]ObjectTemplate.addTemplate Ju52Rudder[/color] [color=orange]ObjectTemplate.setPosition 0/2.153/-14.896[/color] [color=orange]ObjectTemplate.setRotation 0/0/-89.999[/color]

[color=orange]ObjectTemplate.addTemplate Ju52WheelFront[/color] [color=orange]ObjectTemplate.setPosition -2.286/-2.886/1.513[/color] [color=orange]ObjectTemplate.addTemplate Ju52WheelFront[/color] [color=orange]ObjectTemplate.setPosition 2.286/-2.886/1.513[/color] [color=orange]ObjectTemplate.addTemplate Ju52BackWheelSteering[/color] [color=orange]ObjectTemplate.setPosition 0/-0.357/-15.284 [/color]

[color=orange]ObjectTemplate.addTemplate Ju52Engine1[/color] [color=orange]ObjectTemplate.setPosition 0/0.243/7.410[/color] [color=orange]ObjectTemplate.addTemplate Ju52Engine2[/color] [color=orange]ObjectTemplate.setPosition -4.443/-0.584/4.493[/color] [color=orange]ObjectTemplate.addTemplate Ju52Engine3[/color] [color=orange]ObjectTemplate.setPosition 4.460/-0.582/4.494[/color]

By the way, you still have the engines in the code, when it will not be used, then you should remove them, because these would just cost performance.




Mr_Cheese

FH Dev

50 XP

12th June 2004

0 Uploads

1,997 Posts

0 Threads

#8 13 years ago

Hmm... no, putting the lines where you suggested didn't work - it just caused BF42 to crash when loading the map. I have copied the sound folder from the FH Ju52 and put it in the Objects/Ju52overhead folder - was that the right thing to do?

How do you mean have the engines in code? The only code for the planes is that which I posted above.




CamelNele

Norwegian Resistance

50 XP

21st May 2005

0 Uploads

27 Posts

0 Threads

#9 13 years ago

Yeah, ... just in the last templates which i posted above : ObjectTemplate.addTemplate [color=red]Ju52Engine1 ObjectTemplate.setPosition 0/0.243/7.410[/color] [color=orange]ObjectTemplate.addTemplate [/color][color=red]Ju52Engine2[/color] [color=orange]ObjectTemplate.setPosition -4.443/-0.584/4.493[/color] [color=orange]ObjectTemplate.addTemplate [/color][color=red]Ju52Engine3[/color] [color=orange]ObjectTemplate.setPosition 4.460/-0.582/4.494[/color] As you may see, you are adding them there to the Complex-template of the airplane. Thus, when you see the (Complex-) airplane ingame, the engines are there and the game is processing all the physics with many, many zero's ... which could slow down a not-so-fast computer. smilie.gif For the sound-lines ... actually it is like this: Any template can have one "loadSoundScript"-line, it will just call the mentioned file and play the sound from there. Thus, you should just add it properly, check if you (or i) got spelling errors in it, also check if the called files are there, i.e. Ju52Engine.ssc and Ju52Engine1.ssc. Then check, if these files contain links to other sound-ssc's, if so, update them with the apropriate path. If your map still crashes, run the <debugger> and look what it metiones. I use it very often when i code something, thus i at least know, where to look when the map crashes. winkx.gif




Mr_Cheese

FH Dev

50 XP

12th June 2004

0 Uploads

1,997 Posts

0 Threads

#10 13 years ago

So, are you saying I can safely get rid of the engine code? (Those lines which you said above?) I'll take another look at the sound lines and files - check for mistakes. Thanks :)




  • 1
  • 2