ok. well, it works now.
my first code were indeed working, but the error i made was that in the other .uc file that extends the mutator class, i put a reference to my older Mutator ( eg MutFragSoundClass) instead of MutTeamGameFragsoundClass. now this being fixed it works wonderfull.
thanks to everyone contributing to this thread / problem.
Announcement
Collapse
No announcement yet.
Controller Class --> is Player ?
Collapse
X
-
GuntiNDDS repliedOriginally posted by the Adster
Err, no, it works for all Controller types; how do you think CTF flags are attached to non-human players?. Why not spend the rest of the afternoon having a good look round all the standard classes you have on your machine? You may be surprised by what you find out.
Leave a comment:
-
legacy-the Adster repliedOriginally posted by GuntiNDDS
doesnt playerreplicationinfo only work with human players ?
Leave a comment:
-
GuntiNDDS repliedOriginally posted by the Adster
This code come from one of my projects (modified to your needs):
Code:if( ( killed != killer ) && ( killer.PlayerReplicationInfo != None ) && ( killed.PlayerReplicationInfo != None ) && ( killed.PlayerReplicationInfo.Team != killed.PlayerReplicationInfo.Team ) && ( killed != None ) )
Leave a comment:
-
legacy-the Adster repliedThis code come from one of my projects (modified to your needs):
Code:if( ( killed != killer ) && ( killer.PlayerReplicationInfo != None ) && ( killed.PlayerReplicationInfo != None ) && ( killed.PlayerReplicationInfo.Team != killed.PlayerReplicationInfo.Team ) && ( killed != None ) )
Leave a comment:
-
GuntiNDDS repliedOriginally posted by Grzech
surely it isn't. what do you cast that poor killer to playercontroller for?
get rid of that and it will work.
Code:class TeamGameFragsoundClass extends GameRules; function ScoreKill(Controller Killer, Controller Killed) { if ( !Killer.SameTeamAs(Killed) ) { log("someone killed someone else"); } if ( NextGameRules != None ) NextGameRules.ScoreKill(Killer,Killed); }
Leave a comment:
-
legacy-Grzech repliedsurely it isn't. what do you cast that poor killer to playercontroller for?
get rid of that and it will work.
Leave a comment:
-
GuntiNDDS repliedumm kay. i want to do something slighty different now.
what i want is that if your team scores a frag ( being it a bot from your team or a human player from your team), everyone from that team should hear a sound.
i tried like this:
Code:class TeamGameFragsoundClass extends GameRules; function ScoreKill(Controller Killer, Controller Killed) { local Controller p; if ( !Killer.SameTeamAs(Killed) ) { for( p = Level.ControllerList; p != None; p = p.nextController ) { if( p.IsA( 'PlayerController' ) ) { if ( PlayerController(p).sameteamas(PlayerController(Killer))) { PlayerController(p).ClientReliablePlaySound(Sound'scorefrag'); } } } } if ( NextGameRules != None ) NextGameRules.ScoreKill(Killer,Killed); }
"MutTeamGameFragsound accessed 'None' Killer" ?
( being playing with bots when this occours + it works and not display that when i make a frag myself. so maybe the code above is not realy compatible with bots ? )
thx
Leave a comment:
-
GuntiNDDS repliedOriginally posted by the Adster
To play a sound to just one player try this:
Code:PlayerController( killer ).ClientReliablePlaySound( Sound'MyCustomSound' );
Importing a custom sound can be done in this way:
Code:#exec AUDIO IMPORT FILE="Sounds\Whatever.wav" NAME="MyCustomSound"
Leave a comment:
-
legacy-the Adster repliedTo play a sound to just one player try this:
Code:PlayerController( killer ).ClientReliablePlaySound( Sound'MyCustomSound' );
Importing a custom sound can be done in this way:
Code:#exec AUDIO IMPORT FILE="Sounds\Whatever.wav" NAME="MyCustomSound"
Leave a comment:
-
GuntiNDDS repliedOriginally posted by Grzech
http://www.ataricommunity.com/forums...hreadid=386389
"I want to play sound from my mutator. I want it to be heard by every player (not localized sound)"
--
for that hud thing, i tried:
Code:class DeathRatioHUD extends ChallengeHUD; function PostRender(canvas C) { Super.PostRender(C); C.SetPos( 0, Canvas.ClipY/2 ); C.DrawColor.R = 255; C.DrawColor.G = 0; C.DrawColor.B = 0; C.Font = MyFonts.GetBigFont( C.ClipX ); C.DrawText( PlayerOwner.PlayerReplicationInfo.GetSpree(), False ); }
Code:Analyzing... Superclass ChallengeHUD of class DeathRatioHUD not found History: UMakeCommandlet::Main Exiting due to error
Leave a comment:
-
GuntiNDDS repliedOriginally posted by Grzech
your english seems to be terrible I don't know what you want to achieve :weird: ,lol :sulk:
Right now code above you increase a variable everytime some player does a good "kill" and reset it anytime some player does "bad" kill; (player here is either bot or human)
if you want to remember "FragsSinceLastDeath" for every player u need to make a table or list for all players and count it for every player independently.
it is already done:
search code for killing sprees is realized. Killer.pawn.GetSpree() gives you kills from last death of that pawn (if thats what you want... )
Leave a comment:
-
legacy-Grzech repliedOriginally posted by GuntiNDDS
ok. so this will only trigger if the player makes a kill, and not trigger if the (human) enemey of the player makes a kill, right ?
so could i extend it like this to archive my goal:
Code:if ( Killer.GetTeamNum()!=Killed.GetTeamNum() || (Killer!=Killed && Killer.GetTeamNum()==255) ) { FragsSinceLastDeath+=1; } else { FragsSinceLastDeath=0; }
Right now code above you increase a variable everytime some player does a good "kill" and reset it anytime some player does "bad" kill; (player here is either bot or human)
if you want to remember "FragsSinceLastDeath" for every player u need to make a table or list for all players and count it for every player independently.
it is already done:
search code for killing sprees is realized. Killer.pawn.GetSpree() gives you kills from last death of that pawn (if thats what you want... )
Leave a comment:
Leave a comment: