• Please make sure you are familiar with the forum rules. You can find them here: https://forums.tripwireinteractive.com/index.php?threads/forum-rules.2334636/

Code Re-Enabling Vehicle Horn?

ToiletDuckie

Grizzled Veteran
Aug 22, 2006
59
0
At the behest of others, I've decided to (attempt) to re-add a horn to a Red Orchestra vehicle, lets say BA64 for simplicities sake, both to help me learn unrealscript coding and for the humor of it.

Of course, I have no idea where to start. Looking at the code, UnrealPlayer still has the ability to PlayVehicleHorn, which ROPlayer overrides via an empty function.

Meanwhile, Vehicle has a HornSounds array. No idea why it's an array.. although the Vehicle class has its horn related functions overriden by ROVehicles.

If I understand correctly, the only way to re-enable sounds at this point would be to alter ROPlayer (or make a ROPlayerAlt that extends it then switch stuff to look to it, which is ARGH), which seems like a no no. Once that is done, I can just add the vehicle horn code to whatever vehicle I design/desire, since it will override ROVehicle's code and essentially re-enable the horn.

That still leaves the question of ... why is it a HornSounds array? I don't even know what's stored IN the array.. so that's a big "hmm".
 
Problem fixed.

Since ROPlayer and Vehicles both had the silly horn disabled, re-enabling the horn would be... you know... too much of a problem.

The solution? They left "DriverWeapons" around... despite no vehicles using it. So, I gave the driver an invisible turret that either a)shoots no bullets or B)shoots 1 bullet every 5 seconds thats set to do 0 damage, not sure which.. and is not aimable that plays the horn sound I want.

Although, my intention was to get the dixie horn back, which presented a minor issue: the horn.. err driver gun code is set to play a looping sound while the mouse is held down, and a end sound when you let off the trigger. I got around this by making a "silence" sound for when you are holding the trigger down, and made the horn sound my end sound.

So, long story short... I hackjobbed the hell out of it, but I have vehicle horns again. RARR.
 
Upvote 0
Nah, it's just the horn itself, although the only version I could find had the car engine in the background.. so its not "perfect" but it will do.

Now that I've figured this out though, horns for every vehicle on my map! Huzzah! I've already recorded myself going "Honka Honka!" and put that on the BA - IS2... just because I can.

Meanwhile, I've been informed that the populous would prefer if their STG44 went "PEW PEW PEW PEW!" when it fired, so once I create a "NoS turret" for the BA I might do that.

Eh, silly modding stuff. You change one thing, then you must change 4 more.... then 6 more.. then...

Edit: Oh, one other thing... the different BAs don't have lyrics per se, but they will have different entry/possibly exit sounds. RiiiiiiidgeRacer currently plays the first 8 seconds of the Daytona USA theme song when you hop in. Do do do do do do do do doooo dooooo DAYTOOOOOOOOOOONAAAAAAA!!!
 
Upvote 0
I thought these arrays were refreed to as soundgroups - are we talking about those here?

Soundgroups are arrays in the UAX file.
Normally you could assign a weapon like umteen-million sounds, bundled in a sound group.

But. weapons with distance sounds also use SoundGroups.. the difference is sound 0 in the group is the 'up close' sound, and sound 1 is the distance sound. Which mitigates the ability to have 10 different firing sounds.
So to work around, in the code for a weapon, there is an array of SoundGroups that have distance sounds. So you can have 3 different sounds w/ distance sounds.


If you follow.. ;]
 
Upvote 0