Tremulous Forum

Mods => Modding Center => Topic started by: Shifty on July 21, 2010, 08:33:56 am

Title: "Base Under Attack"Sound?
Post by: Shifty on July 21, 2010, 08:33:56 am
You know how when aliens attack human rc you get that cp message or what ever it is "Base under attack!"? Would it be possible to, through a client side mod, add sound to this like on aliens? Like...what are the files governing this and all?
Title: Re: "Base Under Attack"Sound?
Post by: Demolution on July 21, 2010, 11:16:15 am
There is a sound like that already. It's "The Overmind is under attack!"
>.> Play more.
Title: Re: "Base Under Attack"Sound?
Post by: Plague Bringer on July 21, 2010, 01:36:06 pm
Quote
You know how when aliens attack human rc you get that cp message or what ever it is "Base under attack!"? Would it be possible to, through a client side mod, add sound to this like the sound that's played on aliens? Like...what are the files governing this and all?
no clue/good idea/there's probably a reason devs decided to do it this way
Title: Re: "Base Under Attack"Sound?
Post by: gimhael on July 21, 2010, 02:42:03 pm
When a human building in range of the DC is hit, the game qvm creates an event of type EV_DCC_ATTACK. In the cgame qvm, in file cg_envent.c this event is handled:

Code: [Select]
   case EV_DCC_ATTACK:
      if( cg.predictedPlayerState.stats[ STAT_TEAM ] == TEAM_HUMANS )
      {
        //trap_S_StartLocalSound( cgs.media.humanDCCAttack, CHAN_ANNOUNCER );
        CG_CenterPrint( "Our base is under attack!", 200, GIANTCHAR_WIDTH * 4 );
      }
      break;

So apparently the devs intended to play a sound here, but the sound was commented out later (due to a lack of a sound file ?). So you just have to remove the comment markers and register an appropriate sound (modify cg_local.h and cg_main.h).
Title: Re: "Base Under Attack"Sound?
Post by: Shifty on July 21, 2010, 09:23:45 pm
There is a sound like that already. It's "The Overmind is under attack!"
>.> Play more.
:facepalm: I said..FOR THE HUMAN RC....LIKE on ALIENS..I already know there is one for aliens...I just want to replicate that on humans.

Thanks gimhael...so I assume this would mean I would need to write a custom qvm to get this to work?
Title: Re: "Base Under Attack"Sound?
Post by: F50 on July 22, 2010, 03:36:26 am
Yes, although with the commented code and such it should be incredibly trivial once you have a sound file.
Title: Re: "Base Under Attack"Sound?
Post by: SlackerLinux on July 22, 2010, 03:43:07 am
the humans also get a message if their spawn nodes are attacked aliens get it for their overmind but dont get the warning for eggs the rc currently doesnt give any warnings(unless if this has changed in 1.2)

the aliens really need the rc to give no warning its hard enough to get it down w/out the attack being broadcast out. they dont have range like the humans do they have to actually get on it
Title: Re: "Base Under Attack"Sound?
Post by: Shifty on July 24, 2010, 12:49:48 pm
So theoretically, you could make things a whole lot easier for you (and cheat) by adding code to give warnings for arms, meds, rc, nodes, eggs, om, and anything important?
Title: Re: "Base Under Attack"Sound?
Post by: David on July 24, 2010, 01:20:31 pm
It's a cgame change, so the server would have to OK it or you'd have to cheat, same as with aimbots etc etc.
Title: Re: "Base Under Attack"Sound?
Post by: UniqPhoeniX on July 25, 2010, 06:54:21 am
But basically the client already receives information from server about base status, more then the "Base is under attack"? If yes, fail.
Title: Re: "Base Under Attack"Sound?
Post by: gimhael on July 25, 2010, 07:53:57 am
No.