*V@vn^LV9Ƈ/aVNone GetArgVal SendLine BotSkins BotClasses BotNames BotFaces BotTeamsBotAPIBeginStartUp ParseVectorinFrontCoreEngineRemoteBotInfoForce LightColor Movement Collision LightingKarma StopWaiting TakeDamage BeginState ParseRotRunning monitoringDoneMoveLandedEnemyAcquired GameEndedDying LongFallIpDrvProcessAction AcceptedListen MakeItem SendTextSystem ReceivedText UnrealGameRestartPlayer RemoteBotGetLPostBeginPlay FallingStateGetR ReceivedLineCurL TryAgainSetFallTurning WarnTargetStrafeClientMessageKilled SeePlayerTickSetL Tracking IsRunningSetRPSetLA BaseChangeWaitingForInitGetGameStatusTestSetTib SpawnPlayercurr GetGameInfoaeas checkSelfFGetR checkVisionFireWhileFallingRestore InitRecievedSetDTSetLPSetLVSetRV GameSpeedSetRARemoteFireWeaponSetR RemoteJumpSendVoiceMessage PainTimerInitbDebug TryToDuckStop ListenPort BeginPlay StartFire UnPossessedSwitchToBestWeaponFindPlayerStart StopFiring PreBeginPlay HaltFiringMaxConnections checkGame DRMovementClose NotifyBumpChangedWeapon AcceptClassEnemyNotVisibleClosedDRM BindPortTimer AddRemoteBot LostChild GainedChildSaveFGetLRemoteBotClassStepRemoteBotConfigClass BotAccuracyFire GameplayCorrectCHIndividualizeChooseBotInfo DrawTypeBotServerClassVizServerClassCHGetBotClass ViewTestAltFirePutDownDeadremoteVisionLimit PawnDiedPossessPreKAlterDestinationSetHand updateTime GetSpeedSendTeamMessagebAlwaysRelevantPlayTeleportEffectSendGlobalMessage bAllowPauseDoJumpClientSetRotation HearPickup DrawScale AdjustAim TriggerEvent TeamMessage StopFirePlayerCalcView Initialize ClientDying KilledBy AddInventoryBroadcastLocalizedMessage UnderLiftNotifyTakeHitAddInteractionBotVoiceMessage FearThisSpot PlayLandedServerChangedWeaponTakeFallingDamage FireWeaponCloseToPointManAddDefaultInventoryGetDefaultPlayerClass StartMatch MaybeTauntInventorySpotPickup MaxPlayers bPauseableAutoAim GameNameTranslocateToTargetPlayerControllerClassNameParseRotAsVec vizClientWaitingForStartBigJumpFindAmbushSpot SpecialFire HurtOtherbVision visionTimebAffectPlayersbAffectSpectators VizServerVizConnectionViewTestPlayerController ChangeWeapon SetOrdersInfMaxErrPathMarkerMutatorCheckFutureSight AdjustToss StaticMesh PathMarkerIdle KeyEventMyInteractionicu_mutDeadReckoning BotServerBotDeathMatchBotConnection PlayFall unLocked RemoteRoleDuckingLockedsplashTakeHit IsLocked setCacheGlobalDefaultEnemyRosterClassNetWait CountDown FortStandard ImpactJumpYellAtRecoverCanImpactJumpHeld SpawnWait ResetSkill GetBotTeam isNewBaseAddBot VictoryDance MoveToGoalPreLPNotifyHitWall HearNoiseMayFallAnimEnd AmmoAmount ZoneChange EndStateTouchTrigger DestroyedPreRPXGame Alertness Difficulty bVisibleNewBase DeltaTime DownWeaponTeamMessageStringbBeepActiontmpControllerListNavigationPointListGamePauserSecond TimeSeconds bIsSpectator VoiceType GameClass RecipientSenderCurrentinjured ViewTarget KilledPawnKiller newWeapon PawnClassPCTeamNumaPlayer StartSpotPRIM PlayerID TimeLimit CurrentID NumPlayers messagetypeScoreKey instigatedBy EInputAction EInputKeyPEndStart Loudness Momentum HitLocationDamageNewZone HitNormalEventInstigator bUpAndOutOther bIsWalkingDeltaViewportOwnerbCanFlySimAnim AnimRate TimerRate bDeleteMeOwnerbRollToDesiredcur UnrealPawnOldControllerAnchorFirePropertiesBotDelimPendingWeaponTcpLinkLastStartSpotLastStartTime bMeleeWeaponBotModeCameraLocationStartLocation LinkStateCameraRotationFiredAmmunition projStart ReceivedDataConnectionCountbNoCRLF OrderGiver NewOrdersSkillNewItem OldWeapon DeathMatch HitActordtfirstbDamageTriggeredAccelnextNavigationPoint projSpeedshooter DMSquadClassaSpotVel2DSquadSquadAICTFFlag GameObjectUnrealMPGameInfoNewBot OldEnemy bNormalizeVelDirbInitLifeMessageOldMessageType OldMessageIDMoron SeenPlayer enemyDist OtherDir TargetDist bDefendMelee FireRotation FireSpot enemyDirduckDir bReversedHolder TeamString NoiseMakerWaitParticleMeshesSimple ParticleBombRVxPlayerHitLv2 MessageIDresbLockedIdFireDir OutStringr2PreviousPawnClassOutStr RouteCacheOldMessageTimeEnemy tempPawnFocus FocalPoint MoveTarget MoveTimernextController bAltFirebFire bIsPlayerSetViewTarget LevelName aimerror ViewActor AccelerationHealth bDrawEnemybDrawFriendly bControlPawnmyPawn WalkingPctJumpZbHasInteractionbInited RecievedArgs RecievedVals tempActor tempBooltheBot bIterative AirSpeed WaterSpeedattrNum GroundSpeed SightRadius bCanJump gameInfoStrSpeed clientNamestartRotationcmdTypeargBodyremendloc wordsplit curBotStatebRotateToDesiredargNameDesiredRotationvecNameAnimRepvecGameMessageClass PlayerName boolResultoutBuf focusTargType AccelRate RotationRatebBoundbCollideWorldPhysics sentNavs NetPriority plrStringbHidden theVizServerCollisionRadius theBotServerbServerLoadedNNumRemoteBotConfigNumRemoteBotsTexttheConnectionTargetAngle ScriptTextABC ConfigUsedXiBotNYtZSR myConnection RemoteEnemyRemoteDestination RemoteFocus myTargetmyDestinationmyFocusmyRotationRatelastWallHitTime lastBumpTime myRotationbotDRisDR LocationDR_TDR_PDR_VDR_ADR_RPDR_RVDR_RA Rotation bLFilter bRFilter Velocity ReturnValuebFallVSetPropertyTextTimeDynamicLoadObjectWeapon LevelInfo GameInfo bUseAltMode RemoteTarget ZoneInfo PlayerStartPlayerReplicationInfo InventoryDestn AIController ControllerPlayerController DamageType JumpDest AvoidMarkerMutator ArmorAmountNavigationPointHitN ViewportInteractionMasteroldInf bRunningLevel bNewBase bAutoTurnMoverPlayerPawnActor Interactions Interaction ClassNameYawRollPitchCacheEventClassParentPackageRot TextBufferObjectEnum FunctionStaterpRotatoractVectordrStruct StrPropertyStructPropertyClassProperty NamePropertyObjectPropertyFloatProperty BoolProperty IntProperty ByteProperty bGameEndedvC -B fK9:| O^Gz3},e,e,e,e,e,e,e,eHk*,e|qYԅ,e,e O^Gz,e|@q@q@q@q O^Gz@q@q|AfAfAf O^GzAfAfAf3}ɢɢɢɢ O^Gzɢɢ O^GzKv PPPPPnPPPP O^Gz|||Hk*||||qY O^Gz O^Gz3}ڬRp3}|~}| O^Gz||ʁ)|||||||| |||| |3}|~}\fF |||ʁ)|||||| O^Gz|3}ڬRp||| O^Gz||| O^Gz|||||||||||qYԄ||||||qYԄ|qYԄ|qYԄ|qYԄ| O^Gz||||Hk*|Hk*| O^Gzʁ)ʁ) O^Gz|ʁ)3} O^Gzʁ)3}3} O^Gz3} O^Gz||||qYԄ|qYԄ|||qYԄ|qYԄ|qYԄ| O^Gz O^Gz||qYԄ| O^Gz,eHk*Hk* O^Gz O^Gz O^Gz3}3} O^Gz@q||| O^Gz| 3}|qYԄ|qYԄ|qY+A _M$4?H$=@@>qx@@xV S o Y%  @E||||||||||||||||||||||||||||||||||| P"O"@@Z w\>g O^GzK3}KK3}3}-PkKK3}3}K3}KKKK|K|KK|K|KK|K|K|K|K|K|K|KKKKK KK 3}K K K K K K K KK KK KK KK KK KK KK KK KK KK KKKKK|KK|K|K|KKKKʁ)Kʁ)Kʁ)KK|K|KK|K|K|KKKKʁ)Kʁ)KKKKKKKKKKK|K|KK|K|K|qYKKKKKʁ)Kʁ)KKʁ)KKKKK|KKʁ)Kʁ)KKKKKK|KKKK|KKKKʁ)Kʁ)KKKKKKKKKʁ)KKKK|K|K|KK|K3}-PkKv 3}-PkKv Kv Kv Kv # _F$=EL]{K]}G] b e@jjszDU \Z >Kv K# b" k"@L]{K]}G] q @S @' @ @@g%I@2:W@a@XwV m [6Q-Pk|~}Kv Kv Kv ,eHk*,eK O^Gz,e,eKv Kv Kv Kv Kv Kv 3},e,eHk*,eHk*,eKKɢɢKKKKKKK|K|K|3}KK|KKKK|K3}|~}KK|KɢKKKKKKK O^GzK O^GzK O^GzKHk*KHk*KHk*KKK8 bKv + G8F~o|h"i"g]XGame.xDMRosteryz${n?W$?x"}]! BotAPI.ViewTestPlayerController{]Remote Bot DeathMatchd@@i@n@}AS;v@a@HQ I >8 bK# b" k"qYUN[@~TbF@lZL1@@M0QN@Cs.iK@]bJ@u_cW@w@f@v@@|@i@@x@3xtQI@y@` 4!u@{6@@l@`LPHQ@SKL@M@@O@7@p8K]U^ @XXPA]DG@E @eZ]@c@@h@mArtp6o")I+ ]CommandoSkins.BlakeSGirlSkins.AryssSoldierSkins.MalcomCommandoSkins.LuthorFCommandoSkins.CryssFCommandoSkins.VisseSoldierSkins.KregoreSGirlSkins.CiliaCommandoSkins.Kragoth FCommandoSkins.Tanya SoldierSkins.Johnson CommandoSkins.Boris SGirlSkins.Vixen SGirlSkins.SaraSoldierSkins.OthelloFCommandoSkins.KylaCommandoSkins.GornSGirlSkins.AnnakaSoldierSkins.RikerFCommandoSkins.MaliseCommandoSkins.RamirezFCommandoSkins.FreylisSoldierSkins.ArkonSGirlSkins.SarenaCommandoSkins.GrailFCommandoSkins.MarianaSoldierSkins.RankinSGirlSkins.IsisCommandoSkins.GravesSGirlSkins.LaurenSoldierSkins.MalcomFCommandoSkins.JayceE]YigalPaulJeffLewisMilindEdDanielBillJim Kevin Stacy Ulf Randy Yolanda Wei-MinGalSheilaAndrewDavid  Andrew MTaylorAaron RogelioJayChonJihieJafar BenaminMike  Jose LuisNicoHans"    $?D$?]BotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBot BotAPI.RemoteBot BotAPI.RemoteBot BotAPI.RemoteBot BotAPI.RemoteBot BotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBotBotAPI.RemoteBot]CommandoSkins.cmdoSGirlSkins.fbthSoldierSkins.blktCommandoSkins.dacoFCommandoSkins.gothFCommandoSkins.gothSoldierSkins.RawSSGirlSkins.VenmCommandoSkins.goth FCommandoSkins.daco SoldierSkins.sldr CommandoSkins.daco SGirlSkins.Garf SGirlSkins.armySoldierSkins.blktFCommandoSkins.dacoCommandoSkins.cmdoSGirlSkins.fbthSoldierSkins.blktFCommandoSkins.gothCommandoSkins.dacoFCommandoSkins.gothSoldierSkins.RawSSGirlSkins.VenmCommandoSkins.gothFCommandoSkins.dacoSoldierSkins.sldrSGirlSkins.GarfCommandoSkins.dacoSGirlSkins.armySoldierSkins.blktFCommandoSkins.dacoW$?X@w@wB@t@z\m@t@d@v@[fej Gq C^5, GE&@}@YM7drG% r*9:9:$9:9:$ cGa>> HM HOG=> SmlcM HcSL?  sppppppppppppPRJTime9UHODirection9Y9Pc Go=@@O@f^m`@j8ea\W@Ye@N @J @EcdI @fkhRPz inY@oDDx@y@@@k?@C @h@h@@@"@JgKM @kg@}@fH TU3ʁ) )ES]$=S@F@bd J>%YVhK3}3}8 b3}-Pk3},e,eHk*,eHk*,eK,e,e|,eHk*,e|,e,e,e3}ɢɢɢ3}3}Hk*3}8 b3}-Pk8 b# YS$L>L]{K]}G] o/[PI ]`xNNO @@#d(W @W@_ @@fmnN@En@tujxmyz{|}~@AvBlGZBZ &F G"Hs@JLI@BOv @9Y`beZo[J@Zp @v@^osY:M 0 && ConnectionCount > MaxConnections && LinkState == STATE_Listening) { if(bDebug) Log("VizServer: Too many connections - closing down Listen."); Close(); } } event LostChild( Actor C ) { Super.LostChild(C); ConnectionCount--; // if closed due to too many connections, start listening again. if(ConnectionCount <= MaxConnections && LinkState != STATE_Listening) { if(bDebug) Log("VizServer: Listening again - connections have been closed."); Listen(); } } E[D7Z' GIp7 GJDY7P-D$$%d%$$&d& GRr y" . ppppppppppppHRNSourceClass9VRRotation9Y9PR  GKNQ9' GOMQR:[.b_r[*b$[  [ 99 [ ~[ B GBAC\M-Z NppppppHRPRotation9Y9PC  GTUX%60--^Accepted connection in BotServer GV}y=s}J`% J`9:9:$-^BotServer: Too many connections - closing down Listen.n G`c([X-QuTJ-^pBotServer bound to port 9ST&-Q' GPZ^FK&.b1r&*$$hb$&  & &a/!j9P& |y& _& ^9D9?^9?, 9?, & _& ?& -Dw&*&-_9?-D^?z G|_W\xL\JJ`9:9:$z-^BotServer: Listening again - connections have been closed.& Gza~oM)9?%a?(QQ9?, _Q6_u~ 6uuu_uL?66_66_QC? pppppppppppppBMPId9V~Location9X~ v!o( GT{* [0--^pRecievedTest in Server - { Gcwx'?C ppppppppppppppppppWALId9VxNormal9XwLocation9XC' GDclass VizConnection extends TcpLink config(BotAPI); var string ReceivedData; var string RecievedArgs[9]; var string RecievedVals[9]; //used to store info inside function where local wont work //set property text dosent seem to work with a local var actor tempActor; var VizServer Parent; // set true to allow viz clients to pause var config bool bAllowPause; // set true for verbose debug logs var config bool bDebug; // delay between visionUpdates var config float updateTime; // record once we have sent navs - don't need to duplicate var bool sentNavs; // configurable delimeters for strings sent to clients // currently of form (with multiple possible attributes): // "type"$ib$"identifier"$ib$as$"attrname1"$ib$"attrvalue1"$ae // as = identifies the start of an attribute var string as; // ae = attribute end var string ae; // ib = item break var string ib; //------------Message Types--------------------------- // Each message appears on a seperate line. The first item // of each message is the type identifier. It is a three // letter code identifing what the message contains. // Used types are: // (Asynchronous messages) // (Synchronous messages) // PLR - see another player // INV - see an inventory item (or weapon) // NAV - see a navigation point // DOM - see a domination point // FLG - see a flag // END - end of a vision batch // BEG - begin of a vision batch // GAM - random information about the game //-------------------------------------------------- function PostBeginPlay() { Parent = VizServer(Owner); if(bDebug) log("Spawned VizConnection"); } //Socket established event Accepted() { local string gameInfoStr, levelName; local int i; if(bDebug) log("Accepted VizConnection"); //no clean way to do this since gametypes are not derived from //a common ancestor switch(Parent.gameClass) { /*case "BotTeamGamePlus": gameInfoStr = BotTeamGamePlus(Level.Game).GetGameInfo(); break;*/ case "BotDeathMatch": gameInfoStr = BotDeathMatch(Level.Game).GetGameInfo(); break; /*case "BotDomination": gameInfoStr = BotDomination(Level.Game).GetGameInfo(); break; case "BotCTF": gameInfoStr = BotCTF(Level.Game).GetGameInfo(); break; */ } levelName = string(Level); i = InStr(Caps(levelName), ".LEVELINFO"); if(i != -1) levelName = Left(levelName, i); SendLine("NFO" $ib$as$ "Gametype" $ib$ Parent.gameClass $ae$ib$as$ "Level" $ib$ levelName $ae$ gameInfoStr); gotoState('monitoring','Running'); } //Closed on other end event Closed() { Destroy(); } //Recieve info - parse into lines and call RecievedLine event ReceivedText( string Text ) { local int i; local string S; if(bDebug) log("Recieved - "$Text); ReceivedData = ReceivedData $ Text; // remove a LF which arrived in a new packet // and thus didn't get cleaned up by the code below if(Left(ReceivedData, 1) == Chr(10)) ReceivedData = Mid(ReceivedData, 1); i = InStr(ReceivedData, Chr(13)); while(i != -1) { S = Left(ReceivedData, i); i++; // check for any LF following the CR. if(Mid(ReceivedData, i, 1) == Chr(10)) i++; ReceivedData = Mid(ReceivedData, i); ReceivedLine(S); if(LinkState != STATE_Connected) return; i = InStr(ReceivedData, Chr(13)); } } //Here is where we handle incoming commands /* Commands expected to look like: runto {Argument value} {Arg value}... Currently hard coded to take no more than 9 args Command type and arguments can be any length, but first space terminates the name. Values can have spaces or any other kind of character. */ function ReceivedLine(string S) { local string cmdType, argBody, rem; local int endloc, wordsplit, attrNum; if(bDebug) log(S); wordsplit = InStr(S,ib); if( wordsplit == -1) wordsplit = Len(S); cmdType = left(S,wordsplit); rem = mid(S,InStr(S,as)); attrNum = 0; //iterate through attr/val pairs, storring them in the //parallel arrays RecievedArgs and RecievedVals while(attrNum < 9 && rem != "") { endloc = InStr(rem,ae); argBody = mid(rem,1,(endloc - 1)); wordsplit = InStr(argBody,ib); RecievedArgs[attrNum] = left(argBody,wordsplit); RecievedVals[attrNum] = mid(argBody,(wordsplit + 1)); rem = mid(rem,1); //advance rem = mid(rem,InStr(rem,as)); attrNum++; } cmdType = Caps(cmdType); ProcessAction(cmdType); } function string GetArgVal(string argName) { local int i; while (i < 9 && RecievedArgs[i] != "") { if (RecievedArgs[i] ~= argName) return RecievedVals[i]; i++; } return ""; } function ProcessAction(string cmdType) { if(bDebug) log("comandType:"@cmdType); switch(cmdType) { case "PAUSE": if (bAllowPause) Level.Pauser.IsA('vizClient'); break; case "UNPAUSE": if (bAllowPause) Level.Pauser=None; break; } } //Send a line to the client function SendLine(string Text, optional bool bNoCRLF) { if(bDebug) log(" Sending: "$Text); if(bNoCRLF) SendText(Text); else SendText(Text$Chr(13)$Chr(10)); } //Concat two strings togeather with our list bookends function string MakeItem(string first, string second) { return (as$first$ib$second$ae); } // iterate through objects and send appropriate messages function checkGame() { local Controller P; local string plrString; local NavigationPoint N; SendLine("BEG" $ib$as$ "Time" $ib$ Level.TimeSeconds $ae); //no clean way to do this since gametypes are not derived from //a common ancestor that has AddRemoteBot switch(Parent.gameClass) { /*case "BotTeamGamePlus": sendLine( BotTeamGamePlus(Level.Game).GetGameStatus() ); break;*/ case "BotDeathMatch": sendLine( BotDeathMatch(Level.Game).GetGameStatus() ); break; /*case "BotDomination": sendLine( BotDomination(Level.Game).GetGameStatus() ); break; case "BotCTF": sendLine( BotCTF(Level.Game).GetGameStatus(none) ); break; */ } for ( P=Level.ControllerList; P!=None; P=P.NextController) { if(!P.PlayerReplicationInfo.bIsSpectator) { plrString = "PLR" $ib$as$ "Id" $ib$ P.PlayerReplicationInfo.PlayerName $ae$ib$as; if(P.IsA('RemoteBot')) { plrString = plrString $ "Rotation" $ib$ RemoteBot(P).myRotation $ae$ib$as; } else { plrString = plrString $ "Rotation" $ib$ P.Rotation $ae$ib$as; } // "ViewRotation" $ib$ PlayerController(P).ViewRotation $ae$ib$as$ plrString = plrString $ "Location" $ib$ P.Pawn.Location $ae$ib$as$ "Team" $ib$ 0 $ae$ib$as$ // "Team" $ib$ P.PlayerReplicationInfo.Team $ae$ib$as$ "Name" $ib$ P.PlayerReplicationInfo.PlayerName $ae$ib$as$ "Weapon" $ib$ P.Pawn.Weapon $ae; if( P.bFire != 0 ) plrString = plrString $ib$as$ "Firing" $ib$ "1" $ae; else if( P.bAltFire != 0 ) plrString = plrString $ib$as$ "AltFiring" $ib$ "2" $ae; else plrString = plrString $ib$as$ "AltFiring" $ib$ "0" $ae; sendLine(plrString); } } for ( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint ) { /*if(N.IsA('ControlPoint')) { if( ControlPoint(N).ControllingTeam == none ) temp = 255; else temp = ControlPoint(N).ControllingTeam.TeamIndex; SendLine("DOM" $ib$as$ "Id" $ib$ N $ae$ib$as$ "Location" $ib$ N.Location $ae$ib$as$ "Controller" $ib$ temp $ae); } else if(!sentNavs) {*/ if(!sentNavs) //only send Navs once SendLine("NAV" $ib$as$ "Id" $ib$ N $ae$ib$as$ "Location" $ib$ N.Location $ae); //} } sentNavs = true; /* foreach AllActors (class'Inventory', I) { if( I.GetStateName() == 'Pickup' && !I.bHidden ) { SendLine("INV" $ib$as$ "Id" $ib$ I $ae$ib$as$ "Location" $ib$ I.Location $ae); } } foreach AllActors (class'CTFFlag', C) { outstring = "FLG" $ib$as$ "Id" $ib$ C $ae$ib$as$ "Team" $ib$ C.Team $ae$ib$as$ "State" $ib$ C.GetStateName() $ae; //when a flag is held its location is not updated by engine =( if( C.GetStateName() == 'Held') outstring = outstring $ib$as$ "Location" $ib$ C.Holder.Location $ae$ib$as$ "Holder" $ib$ C.Holder $ae; else outstring = outstring $ib$as$ "Location" $ib$ C.Location $ae; SendLine(outstring); } */ SendLine("END" $ib$as$ "Time" $ib$ Level.TimeSeconds $ae); } //fire right up into the loop for sending updates auto state monitoring { Begin: Running: if( Level.Pauser == None ) checkGame(); sleep(updateTime); goto 'Running'; } eu%'% pTouched 9Vu Ggdl& GHpp#Cw*rfua!Iq!U*6w*9:%$$ @?9:%$$ J? Rr* bppppppppppppCWPIdNoneClassNone@ ppppppppppppCWPId9VClass9V GkR}UXRUw * 6ppppppZCBId9VR GiljM Gyhk,wV  ppppppppppppppppppVMGSender9VVType9WhId9Ri Gnogqq<ah' GrptuDh GuhFRa= !C--Fr* w*a! a!!ppppppBEG Time 9U .-DMOppppppEND Time 9U S-[aW ! C GddKx`(D 8ppppppVMTStringd G{@pk G|z~|}l G}@nl( Gk^m GACAm GBEBm( GDaN nEe*a-V(, GFCi'qLZC`Y\BppppppppppppDAMDamage9SZDamageType9V\kPOeC fC e5fkL?BppppppBInstigator9VC B G@GM_9D 8ppppppVMSString_ GkOGXEV9:U] 9:UV\GVU!f GSQUUEY9:XX 9:XY\UYX!J GgS[f-g[ mppppppppppppAINId9V[Class9V[-g GXRl GH^ J1!-V as'b9:9:$##aA ! $b**aA !Ea( - ( ! ! w#*#:#:a( -J( !8 ! 9:9:$##r#*b$#  ! #aL= !> 9:9:$##KU" Udw#*#:#:[@aU"U"  aL= !  6>P8Ep !tGt8a.t GUM'v"8MLJHG GYWT-$-*? GIRz-R-/-Rq! !  jppppppppppppFALFell9T-RLocation9X--R G[jnk Uah <o: G]hg $$ GVFv8F G`taU  G\r<w4 r* +%-V( a-VO? ^a11? Sr-L@ N1@6L-K( {+.(6LD a ( a 6Lr -]b66L9?%66L9?%66L9?%@9P6La+@ Gj_hZ GTbcs!!!!TakeHit Gvn Gay0 9:9:$ !,a?L>=b !PZ-o$ !a333? !"v!{a-(-9:9:$ !a@ !" `] brrh"=PG}He7 GfgIdB 8B G"hC̎"8CBvut GwQSg Gr,lmiv GoqՏ]w*k6k]k 9?%#m6o633%q!0!q!0! GktEpp;8;p G|sr( 8r GBu5f-q!0 Gv’ 8 Gw Gx~ ?-( GcBuK Go"8onmfd GLc Interaction Initialized G}FV.BQ9:H9:$9:F9:$!9Key PRESSED:9RF9:H9:$9:F9:$"9Key PRESSED:9RF( Gf)/;45S.82-YSpawned VizConnection G{ 8 GAF Gz] GyEs GFGHIHDK7 GLMpJ] GNCڠ GgOQ`( GRSBP5J GAT"h GfUW: GXYV[d G\Z [6 $$$a(((o$# FIN GC`! "-q! aL>a>.pDYING, TRYAGAINr*DYING, TRYAGAIN, Pawn == None, !4DYING, TRYAGAIN, Pawn != Noneq! DYING, WAITINGFORSTART !  @4* Gi,eDYING, RESTARTPLAYER##qo$ba! q!!!4 G_D"*$$-( G^dLGce] Gb}Dead, BeginState GaL #ëL(na=9PL{9?6n #FO9?6n #FO(}' Gnwq'?TR%ppppq N  GeaD3W ppppppppppppppppppHITId9V]Damage9SaDamageType9W` GO@n^b Ur*-Nw*-U^P P#HB Gi\M=;\%[%/ppppppppppppppppppppppppppppppppppppppppppSLFId9VRotation9Y Location9X Velocity9X NameHealth9SWeapon9Vw*/pppppp/CurrentAmmo9S|%?9:%/pppppp/Firing19:%/pppppp/AltFiring2/pppppp/AltFiring0 / G{ZHPZc  Gm5Og [w*Dw-b$   #ra}{ !ppppppppppppppppppppppppppppppppppppppppppppppppPLRId9VRotation9Y Location9X Velocity9X NameTeam9S%Reachable9TbWeapon9V9:%!pppppp!Firing109:%!pppppp!AltFiring20!pppppp!AltFiring0 !/a8 55a!w5- 5 ra}{5 * ppppppppppppppppppppppppINVId9V5Location9X5 Reachable9Tb5Class9V510/a8 ;YX;- ; ra}{; * ppppppppppppppppppppppppppppppMOVId9V;Location9X; Reachable9Tb;DamageTrig9T;-Class9V;102w2*wb$2  2 ra}{2 * ppppppppppppppppppNAVId9V2Location9X2 Reachable9Tb222n z CGBotCTF/a0 '  b$'  ' w'!ppppppFLGId9V''a!o!pppppppppppp!Location9X' Holder9V' !pppppp!Location9X' !pppppppppppppppppp!Team9V'Reachable9Tb'State9W'a !10 G^class ViewTestPlayerController extends xGame.xPlayer config(ViewTest); var Actor A; // The player view is determined by this function. function event PlayerCalcView(out actor ViewActor, out vector CameraLocation, out rotator CameraRotation ) { // USAR if ( (ViewTarget == None) || ViewTarget.bDeleteMe ) { if ( (Pawn != None) && !Pawn.bDeleteMe ) SetViewTarget(Pawn); else SetViewTarget(self); } ViewActor = ViewTarget; // Set the output variable ViewActor with the new view target CameraLocation = ViewTarget.Location; // Set the output variable CameraLocation with the view targets location CameraLocation += vect(0,0,50); // Comment out next two lines for 2 DOF spectator //CameraRotation.Yaw = ViewTarget.Rotation.Yaw; //CameraRotation.Roll = ViewTarget.Rotation.Roll; // END USAR // UTSAF /*bBehindView = false; Super.PlayerCalcView(ViewActor, CameraLocation, CameraRotation);*/ // END UTSAF /*CameraLocation.X = ViewTarget.Location.X; CameraLocation.Y = ViewTarget.Location.Y; CameraLocation.Z = ViewTarget.Location.Z+30; CameraRotation = ViewTarget.Rotation; CalcFirstPersonView(CameraLocation, CameraRotation);*/ } rlK 6s3됑ʁ)|ʁ)C+ Iy//============================================================================= // RemoteBotInfo. //============================================================================= //class RemoteBotInfo extends Info class RemoteBotInfo extends UnrealMPGameInfo config(BotAPI); var() string VoiceType[64]; var() string BotFaces[64]; var() config byte Difficulty; var() config string BotNames[64]; var() int BotTeams[64]; var() config float BotAccuracy; var() config float Alertness; var byte ConfigUsed[64]; var() string BotClasses[64]; var() string BotSkins[64]; function PreBeginPlay() { //DON'T Call parent prebeginplay } function int GetBotTeam(int BotN) { return BotTeams[BotN]; } function CHIndividualize(RemoteBot NewBot, int num) { local int n; n = num % 64; // Set bot's skin //NewBot.Static.SetMultiSkin(NewBot, BotSkins[n], BotFaces[n], BotTeams[n]); // FIXME // Set bot's name. if ( (BotNames[n] == "") || (ConfigUsed[n] == 1) ) BotNames[n] = "RemoteBotController"; /*Level.Game.ChangeName( NewBot, BotNames[n], false ); // FIXME if ( BotNames[n] != NewBot.PlayerReplicationInfo.PlayerName ) Level.Game.ChangeName( NewBot, ("RemoteBot"$NewBot), false);*/ ConfigUsed[n] = 1; // adjust bot skill //NewBot.InitializeSkill(Difficulty); //NewBot.Accuracy = BotAccuracy; //NewBot.BaseAlertness = Alertness; /*if ( VoiceType[n] != "" && VoiceType[n] != "None" ) NewBot.PlayerReplicationInfo.VoiceType = class(DynamicLoadObject(VoiceType[n], class'Class')); if(NewBot.PlayerReplicationInfo.VoiceType == None) NewBot.PlayerReplicationInfo.VoiceType = class(DynamicLoadObject(NewBot.VoiceType, class'Class'));*/ } function int ChooseBotInfo() { local int n; n = 0; while ( (n < 31) && (ConfigUsed[n] == 1) ) n++; return n; } function class CHGetBotClass(int n) { return class( DynamicLoadObject(BotClasses[n], class'Class') ); } @Q%F<#-YAccepted VizConnectionSv kBotDeathMatchQ.-Jn g9Vf~g.LEVELINFOfggfpppppppppppppNFO Gametype Sv Level gQq!! Gk//============================================================================= // RemoteBot. // Basedon Bot class //============================================================================= class RemoteBot extends Bot config(BotAPI); var config bool bDebug; //maybe link to bot's periphreal vision? UT bots need much less of an arc though //like Pawn's PeriphrealVision, this value should be the cosine of the limits //of visual field. (i.e. 0.707 = 45 degrees to each side, or a 90* arc.) var config float remoteVisionLimit; //The socket to the agent var BotConnection myConnection; //The three remote vars compliment the my vars right below. The only one //that ever needs to be duplicated is RemoteEnemy and myTarget //just need RemoteDestination || myDestination and RFocus || myFocus //Who the remote bot is trying to shoot at. Used by the aiming code. var Actor RemoteEnemy; //Thing the remote bot is trying to move to. var Actor RemoteDestination; //Thing the remote bot is looking at. var Actor RemoteFocus; //The spot the bot is shooting at var vector myTarget; //The spot the bot is moving to var vector myDestination; //The spot the bot is looking at var vector myFocus; var rotator myRotationRate; // time that last sent a WAL message var float lastWallHitTime; // time that last sent a BMP message var float lastBumpTime; // delimeters for strings sent to clients. set to match those of myConnection // as = identifies the start of an attribute var string as; // ae = attribute end var string ae; // ib = item break var string ib; var rotator myRotation; var DeadReckoning botDR; var bool isDR; var config float deltatime; var actor HitActor; var vector HitNormal, HitLocation; struct DRMovement { var float DR_T; var vector DR_P; var vector DR_V; var vector DR_A; var rotator DR_RP; var rotator DR_RV; var rotator DR_RA; var int PreK; var bool bLFilter; var bool bRFilter; }; var DRMovement start; // called when using movetoward with bAdvancedTactics true to temporarily modify destination event AlterDestination(); // Mover has notifies pawn that pawn is underneath it function UnderLift(Mover M) { // SENDMESSAGE // !!! possible new message } //Take a wild guess function StartMatch() { // SENDMESSAGE // !!! possible new message } //Called from weapon code when out of ammo or some such //Don't call from local - weapon won't stop until ticked function StopFiring() { bFire = 0; bAltFire = 0; } //Use from local code - stops firing and ticks weapon to let it stop function HaltFiring() { Pawn.Weapon.StopFire(Pawn.Weapon.BotMode); StopFiring(); Pawn.Weapon.Tick(0.001); } //Change to what the bot is standing on singular event BaseChange() { // !!! Can't handle shootable floors /* local actor HitActor; local vector HitNormal, HitLocation; if ( Mover(Base) != None ) { // handle shootable secret floors if ( Mover(Base).bDamageTriggered && !Mover(Base).bOpening && (MoveTarget != None) ) { HitActor = Trace(HitLocation, HitNormal, MoveTarget.Location, Location, true); if ( HitActor == Base ) { Target = Base; bShootSpecial = true; FireWeapon(); bFire = 0; bAltFire = 0; Base.Trigger(Base, Self); bShootSpecial = false; } } } else */ botDR.SetT(Level.TimeSeconds);// Added by jjwang. When the bot changes its base, refreshs the DR. 02/28/03 Super(Pawn).BaseChange(); // !!! possible SENDMESSAGE } //Called right before bot falls off something //If bot running, set bCanJump to true - let him fall //if walking, won't fall event MayFall() { local bool bFall; bFall = !Pawn.bIsWalking; if(!bfall) { GotoState('Startup', 'Begin'); } myConnection.SendLine("FAL" $ib$as$ "Fell" $ib$ bFall $ae$ib$as$ "Location" $ib$ Location $ae); Pawn.bCanJump = bFall; } function float GetSpeed() { if(Pawn.bIsWalking) { return Pawn.WalkingPct; } else { return 1.0; } } //can be autocalled when bot is shot by team mate function YellAt(Pawn Moron); //called when get new item function bool AddInventory( inventory NewItem ) { local bool res; res = Super(Pawn).AddInventory(NewItem); myConnection.SendLine("AIN" $ib$as$ "Id" $ib$ NewItem $ae$ib$as$ "Class" $ib$ NewItem.Class $ae); return res; } // !!! need functions to send arbitrary string messages //functions to send tokenized messages function SendTeamMessage(PlayerReplicationInfo Recipient, name MessageType, byte MessageID, float Wait) { //log(self@"Send message"@MessageType@MessageID@"at"@Level.TimeSeconds); if ( (MessageType == OldMessageType) && (MessageID == OldMessageID) && (Level.TimeSeconds - OldMessageTime < Wait) ) return; //log("Passed filter"); OldMessageID = MessageID; OldMessageType = MessageType; SendVoiceMessage(PlayerReplicationInfo, Recipient, MessageType, MessageID, 'TEAM'); } function SendGlobalMessage(PlayerReplicationInfo Recipient, name MessageType, byte MessageID, float Wait) { //log(self@"Send message"@MessageType@MessageID@"at"@Level.TimeSeconds); if ( (MessageType == OldMessageType) && (MessageID == OldMessageID) && (Level.TimeSeconds - OldMessageTime < Wait) ) return; //log("Passed filter"); OldMessageID = MessageID; OldMessageType = MessageType; SendVoiceMessage(PlayerReplicationInfo, Recipient, MessageType, MessageID, 'GLOBAL'); } //events for recieving arbitrary string messages event ClientMessage( coerce string S, optional name Type, optional bool bBeep ) { myConnection.SendLine("VMS" $ib$as$ "String" $ib$ S $ae); } event TeamMessage( PlayerReplicationInfo PRI, coerce string S, name Type, optional bool bBeep ) { myConnection.SendLine("VMT" $ib$as$ "String" $ib$ S $ae); } //events for recieving tokenized voice message function BotVoiceMessage(name messagetype, byte MessageID, Controller Sender) { if (Sender.PlayerReplicationInfo.Team != PlayerReplicationInfo.Team) return; myConnection.SendLine("VMG" $ib$as$ "Sender" $ib$ Sender $ae$ib$as$ "Type" $ib$ messagetype $ae$ib$as$ "Id" $ib$ messageID $ae); } //other code may try to call this. make sure nada happens //!!! need to change - make sure orders are actually recorded somewhere // for reference function SetOrders(name NewOrders, Controller OrderGiver); /* // !!! Allow for disabling of autoswitch??? function bool SwitchToBestWeapon() { local float rating; local int usealt, favalt; local inventory MyFav; if ( Inventory == None ) return false; PendingWeapon = Inventory.RecommendWeapon(rating, usealt); if ( PendingWeapon == None ) return false; if ( (FavoriteWeapon != None) && (PendingWeapon.class != FavoriteWeapon) ) { MyFav = FindInventoryType(FavoriteWeapon); if ( (MyFav != None) && (Weapon(MyFav).RateSelf(favalt) + 0.22 > PendingWeapon.RateSelf(usealt)) ) { usealt = favalt; PendingWeapon = Weapon(MyFav); } } if ( Weapon == None ) ChangedWeapon(); else if ( Weapon != PendingWeapon ) Weapon.PutDown(); return (usealt > 0); } */ //events that are called when head, feet or whole bot changes zones //e.g. air to water or lava //only way to tell if underwater until drowning damage starts /*function FootZoneChange(ZoneInfo newFootZone) { Super.FootZoneChange(newFootZone); myConnection.SendLine("ZCF" $ib$as$ "Id" $ib$ newFootZone $ae); } function HeadZoneChange(ZoneInfo newHeadZone) { Super.HeadZoneChange(newHeadZone); myConnection.SendLine("ZCH" $ib$as$ "Id" $ib$ newHeadZone $ae); }*/ function ZoneChange(ZoneInfo newZone) { Super.ZoneChange(newZone); if(myConnection != None) myConnection.SendLine("ZCB" $ib$as$ "Id" $ib$ newZone $ae); } //may want to hack into this for vision limits. //used by existing bots to change fov based on activity. /*function SetPeripheralVision() { if ( bNovice ) PeripheralVision = 0.7; else if ( Skill == 3 ) PeripheralVision = -0.2; else PeripheralVision = 0.65 - 0.33 * skill; PeripheralVision = FMin(PeripheralVision - BaseAlertness, 0.9); Pawn.SightRadius = Pawn.Default.SightRadius; }*/ //overriden to avoid bot version which can goto state 'findair' function PainTimer() { if (Pawn.Health <= 0) return; /*if (FootRegion.Zone.bPainZone) Super(Pawn).PainTimer(); else if (HeadRegion.Zone.bWaterZone) { if (bDrowning) self.TakeDamage(5, None, Location + CollisionHeight * vect(0,0,0.5), vect(0,0,0), 'Drowned'); if (Pawn.Health > 0) PainTime = 2.0; } */ // FIXME } //Called when weapon is switched - may happen automatically function ChangedWeapon() { if ( Pawn.Weapon != None && Pawn.Weapon == Pawn.PendingWeapon ) { SwitchToBestWeapon(); if ( Pawn.Weapon.GetStateName() == 'DownWeapon' ) Pawn.Weapon.GotoState('Idle'); Pawn.PendingWeapon = None; } else Super(Pawn).ChangedWeapon(); if ( Pawn.Weapon != None ) { if (bFire > 0) { bAltFire = 0; bFire = 1; Pawn.weapon.Fire(1.0); } else if (bAltFire > 0) { bAltFire = 0; bFire = 1; Pawn.Weapon.AltFire(1.0); } Pawn.Weapon.SetHand(0); // Weapon.FireOffset.Y = 0; } // !!! use or just make people get from status update if(Pawn.Weapon == None) myConnection.SendLine("CWP" $ib$as$ "Id" $ib$ "None" $ae$ib$as$ "Class" $ib$ "None" $ae); else myConnection.SendLine("CWP" $ib$as$ "Id" $ib$ Pawn.Weapon $ae$ib$as$ "Class" $ib$ Pawn.Weapon.Class $ae); } // called from pathnodes that unitelligent creatures are supposed to avoid function FearThisSpot(AvoidMarker aSpot); event Touch( Actor Other ) { myConnection.SendLine("Touched " $Other); } //called on hitting a wall event bool NotifyHitWall(vector HitNormal, actor HitActor) { if ( Level.TimeSeconds - 0.5 >= lastWallHitTime ) { myConnection.SendLine("WAL" $ib$as$ "Id" $ib$ HitActor $ae$ib$as$ "Normal" $ib$ HitNormal $ae$ib$as$ "Location" $ib$ Location $ae); lastWallHitTime = Level.TimeSeconds; } return true; } //called on collisions with other actors event bool NotifyBump(Actor Other) { local vector VelDir, OtherDir; local float speed; if ( TimerRate <= 0 ) setTimer(1.0, false); speed = VSize(Velocity); if ( speed > 10 ) { VelDir = Velocity/speed; VelDir.Z = 0; OtherDir = Other.Location - Location; OtherDir.Z = 0; OtherDir = Normal(OtherDir); if ( (VelDir Dot OtherDir) > 0.8 ) { Velocity.X = VelDir.Y; Velocity.Y = -1 * VelDir.X; Velocity *= FMax(speed, 280); } } if ( Level.TimeSeconds - 0.5 >= lastBumpTime ) { myConnection.SendLine("BMP" $ib$as$ "Id" $ib$ Other $ae$ib$as$ "Location" $ib$ Other.Location $ae); lastBumpTime = Level.TimeSeconds; } // Need to disable bumping ??? //Disable('Bump'); Disable('NotifyBump'); return false; } function SetFall() { //SENDMESSAGE /* if (Enemy != None) { TweenToFalling(); NextAnim = AnimSequence; GotoState('FallingState'); }*/ // FIXME } function LongFall() { // SENDMESSAGE ??? } //called when someone picksup a nearby object WORKING???? function HearPickup(Pawn Other) { myConnection.SendLine("HRP" $ib$as$ "Rotation" $ib$ rotator(Location - Other.Location) $ae); } //called when sound is made function HearNoise(float Loudness, Actor NoiseMaker) { myConnection.SendLine("HRN" $ib$as$ "SourceClass" $ib$ NoiseMaker.Class $ae$ib$as$ "Rotation" $ib$ rotator(Location - NoiseMaker.Location) $ae); } //called periodicaly for each player in view function SeePlayer(Pawn SeenPlayer) { if(SeenPlayer == None) { return; } myConnection.SendLine("SEE" $ib$as$ "Id" $ib$ SeenPlayer $ae$ib$as$ "Rotation" $ib$ SeenPlayer.Rotation $ae$ib$as$ "Location" $ib$ SeenPlayer.Location $ae$ib$as$ "Velocity" $ib$ SeenPlayer.Velocity $ae$ib$as$ "Name" $ib$ SeenPlayer.PlayerReplicationInfo.PlayerName $ae$ib$as$ "Team" $ib$ SeenPlayer.PlayerReplicationInfo.Team $ae$ib$as$ "Reachable" $ib$ actorReachable(SeenPlayer) $ae$ib$as$ "Weapon" $ib$ SeenPlayer.Weapon $ae); } /* FindBestPathToward() assumes the desired destination is not directly reachable, given the creature's intelligence, it tries to set Destination to the location of the best waypoint, and returns true if successful */ /* function bool FindBestPathToward(actor desired, bool bClearPaths) { local Actor path; local bool success; if ( specialGoal != None) desired = specialGoal; path = None; path = FindPathToward(desired,,bClearPaths); success = (path != None); if (success) { MoveTarget = path; Destination = path.Location; } return success; } */ /* NearWall() returns true if there is a nearby barrier at eyeheight, and changes Focus to a suggested value */ //Potentially usefull /* function bool NearWall(float walldist) { local actor HitActor; local vector HitLocation, HitNormal, ViewSpot, ViewDist, LookDir; LookDir = vector(Rotation); ViewSpot = Location + BaseEyeHeight * vect(0,0,1); ViewDist = LookDir * walldist; HitActor = Trace(HitLocation, HitNormal, ViewSpot + ViewDist, ViewSpot, false); if ( HitActor == None ) return false; ViewDist = Normal(HitNormal Cross vect(0,0,1)) * walldist; if (FRand() < 0.5) ViewDist *= -1; if ( FastTrace(ViewSpot + ViewDist, ViewSpot) ) { Focus = Location + ViewDist; return true; } ViewDist *= -1; if ( FastTrace(ViewSpot + ViewDist, ViewSpot) ) { Focus = Location + ViewDist; return true; } Focus = Location - LookDir * 300; return true; } */ // Largely untested function RemoteJump() { Pawn.DoJump(true); } //Intercept FireWeapon - is called from other code function FireWeapon(); function RemoteFireWeapon(bool bUseAltMode) { if ( !bUseAltMode ) { bFire = 1; bAltFire = 0; Pawn.Weapon.BotMode = 0; Pawn.Weapon.StartFire(0); } else { bFire = 0; bAltFire = 1; Pawn.Weapon.BotMode = 1; Pawn.Weapon.StartFire(1); } } // check for line of sight to target deltatime from now. //used by missle launcher and others to abort firing // may want to reimplement function bool CheckFutureSight(float deltatime) { return true; } /* Adjust the aim at target. - add aim error - adjust up or down if barrier Must set RemoteTarget elsewhere */ function vector AdjustToss(float projSpeed, vector projStart, vector End, bool bNormalize) { local vector FireSpot; local float TargetDist; local pawn RemoteTarget; RemoteTarget = pawn(RemoteEnemy); //if ( projSpeed == 0 ) // return AdjustAim(projSpeed, projStart, aimerror, leadTarget, warnTarget); if ( RemoteTarget == None || !FastTrace(RemoteTarget.Location) || !inFront(RemoteTarget.Location) ) return vector(Pawn.Rotation); FireSpot = RemoteTarget.Location; TargetDist = VSize(RemoteTarget.Location - ProjStart); /*if ( !RemoteTarget.bIsPawn ) //{ if ( (Region.Zone.ZoneGravity.Z != Region.Zone.Default.ZoneGravity.Z) || (TargetDist > projSpeed) ) { TossTime = TargetDist/projSpeed; FireSpot.Z -= ((0.25 * Region.Zone.ZoneGravity.Z * TossTime + 200) * TossTime + 60); } viewRotation = Rotator(FireSpot - ProjStart); return viewRotation; } aimerror = aimerror * (11 - 10 * ((RemoteTarget.Location - Location)/TargetDist Dot Normal((RemoteTarget.Location + 1.2 * RemoteTarget.Velocity) - (ProjStart + Velocity)))); if ( bNovice ) { if ( (RemoteTarget.Weapon == None) || !RemoteTarget.Weapon.bMeleeWeapon || (TargetDist > 650) ) aimerror = aimerror * (2.1 - 0.2 * (skill + FRand())); else aimerror *= 0.75; if ( Level.TimeSeconds - LastPainTime < 0.15 ) aimerror *= 1.3; } else { aimerror = aimerror * (1.5 - 0.35 * (skill + FRand())); if ( (Skill < 2) && (Level.TimeSeconds - LastPainTime < 0.15) ) aimerror *= 1.2; } if ( (bNovice && (LastAcquireTime > Level.TimeSeconds - 5 + 0.6 * Skill)) || (LastAcquireTime > Level.TimeSeconds - 2.5 + Skill) ) { LastAcquireTime = Level.TimeSeconds - 5; aimerror *= 1.75; } if ( !leadTarget || (accuracy < 0) ) aimerror -= aimerror * accuracy; if ( leadTarget ) { FireSpot += FMin(1, 0.7 + 0.6 * FRand()) * (Target.Velocity * TargetDist/projSpeed); if ( !FastTrace(FireSpot, ProjStart) ) FireSpot = 0.5 * (FireSpot + RemoteTarget.Location); } //try middle FireSpot.Z = RemoteTarget.Location.Z; if ( !FastTrace(FireSpot, ProjStart) ) { FireSpot = LastSeenPos; HitActor = Trace(HitLocation, HitNormal, FireSpot, ProjStart, false); if ( HitActor != None ) { bFire = 0; bAltFire = 0; FireSpot += 2 * RemoteTarget.CollisionHeight * HitNormal; SetTimer(TimeBetweenAttacks, false); } } // adjust for toss distance (assume 200 z velocity add & 60 init height) if ( FRand() < 0.75 ) { TossSpeed = projSpeed + 0.4 * VSize(Velocity); if ( (Region.Zone.ZoneGravity.Z != Region.Zone.Default.ZoneGravity.Z) || (TargetDist > TossSpeed) ) { TossTime = TargetDist/TossSpeed; FireSpot.Z -= ((0.25 * Region.Zone.ZoneGravity.Z * TossTime + 200) * TossTime + 60); } } FireRotation = Rotator(FireSpot - ProjStart); realYaw = FireRotation.Yaw; aimerror = Rand(2 * aimerror) - aimerror; FireRotation.Yaw = (FireRotation.Yaw + aimerror) & 65535; if ( (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) > 8192) && (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) < 57343) ) { if ( (FireRotation.Yaw > Rotation.Yaw + 32768) || ((FireRotation.Yaw < Rotation.Yaw) && (FireRotation.Yaw > Rotation.Yaw - 32768)) ) FireRotation.Yaw = Rotation.Yaw - 8192; else FireRotation.Yaw = Rotation.Yaw + 8192; } FireDir = vector(FireRotation); // avoid shooting into wall HitActor = Trace(HitLocation, HitNormal, ProjStart + FMin(VSize(FireSpot-ProjStart), 400) * FireDir, ProjStart, false); if ( (HitActor != None) && (HitNormal.Z < 0.7) ) { FireRotation.Yaw = (realYaw - aimerror) & 65535; if ( (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) > 8192) && (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) < 57343) ) { if ( (FireRotation.Yaw > Rotation.Yaw + 32768) || ((FireRotation.Yaw < Rotation.Yaw) && (FireRotation.Yaw > Rotation.Yaw - 32768)) ) FireRotation.Yaw = Rotation.Yaw - 8192; else FireRotation.Yaw = Rotation.Yaw + 8192; } FireDir = vector(FireRotation); } if ( warnTarget && (RemoteTarget != None) ) RemoteTarget.WarnTarget(self, projSpeed, FireDir); viewRotation = FireRotation;*/ //return FireRotation; } function rotator AdjustAim(FireProperties FiredAmmunition, vector projStart, int aimerror) { local rotator FireRotation; local vector FireSpot; local float TargetDist; local bool bDefendMelee; local pawn RemoteTarget; RemoteTarget = pawn(RemoteEnemy); if ( RemoteTarget == None ) { bFire = 0; bAltFire = 0; return Rotation; } if ( !FastTrace(RemoteTarget.Location) || !inFront(RemoteTarget.Location) ) { return Rotation; } //if ( !RemoteTarget.bIsPawn || RemoteTarget.IsA('FortStandard') ) if ( RemoteTarget.IsA('FortStandard') ) return rotator(RemoteTarget.Location - projstart); FireSpot = RemoteTarget.Location; TargetDist = VSize(RemoteTarget.Location - Location); aimerror = aimerror * (11 - 10 * ((RemoteTarget.Location - Location)/TargetDist Dot Normal((RemoteTarget.Location + 1.25 * RemoteTarget.Velocity) - (Location + Velocity)))); bDefendMelee = ( (RemoteTarget.Weapon != None) && RemoteTarget.Weapon.bMeleeWeapon && (TargetDist < 700) ); if ( bDefendMelee ) aimerror *= 0.5; /*if ( ((projSpeed == 0) || (Projspeed >= 1000000)) ) { // instant hit if ( bNovice ) aimerror *= 0.5; else aimerror *= 0.5 + 0.19 * skill; } if ( bNovice ) { if ( !bDefendMelee ) aimerror = aimerror * (2.4 - 0.2 * (skill + FRand())); if ( (Level.TimeSeconds - LastPainTime < 0.2) || (Physics == PHYS_Falling) || (RemoteTarget.Physics == PHYS_Falling) ) aimerror *= 1.5; } else { aimerror = aimerror * (1.7 - 0.4 * (skill + FRand())); if ( (Skill < 2) && ((Level.TimeSeconds - LastPainTime < 0.15) || (Physics == PHYS_Falling) || (RemoteTarget.Physics == PHYS_Falling)) ) aimerror *= 1.2; } if ( (bNovice && (LastAcquireTime > Level.TimeSeconds - 5 + 0.5 * skill)) || (LastAcquireTime > Level.TimeSeconds - 2.5 + skill) ) { LastAcquireTime = Level.TimeSeconds - 5; if ( bDefendMelee ) aimerror *= 1.3; else aimerror *= 2; } if ( !leadTarget || (accuracy < 0) ) aimerror -= aimerror * accuracy; if (leadTarget && (projSpeed > 0)) { TargetVel = RemoteTarget.Velocity; if ( RemoteTarget.Physics == PHYS_Falling ) { if ( RemoteTarget.Region.Zone.ZoneGravity == RemoteTarget.Region.Zone.Default.ZoneGravity ) TargetVel.Z = FMin(-160, TargetVel.Z); else TargetVel.Z = FMin(0, TargetVel.Z); } FireSpot += FMin(1, 0.7 + 0.6 * FRand()) * TargetVel * TargetDist/projSpeed; FireSpot.Z = FMin(RemoteTarget.Location.Z, FireSpot.Z); if ( (RemoteTarget.Physics != PHYS_Falling) && (FRand() < 0.55) && (VSize(FireSpot - ProjStart) > 1000) ) { TargetLook = RemoteTarget.Rotation; if ( RemoteTarget.Physics == PHYS_Walking ) TargetLook.Pitch = 0; if ( ((Vector(TargetLook) Dot Normal(RemoteTarget.Velocity)) < 0.71) ) bClean = false; else bClean = FastTrace(FireSpot, ProjStart); } else bClean = FastTrace(FireSpot, ProjStart); if ( !bClean) { if ( FRand() < 0.3 ) FireSpot = RemoteTarget.Location; else FireSpot = 0.5 * (FireSpot + RemoteTarget.Location); } } bClean = false; //so will fail first check unless shooting at feet //if ( RemoteTarget.bIsPawn && (!bNovice || bDefendMelee) if ( bNovice || bDefendMelee) && (Weapon != None) && (Weapon.bRecommendSplashDamage || (Weapon.bRecommendAltSplashDamage && (bAltFire != 0))) && (((RemoteTarget.Physics == PHYS_Falling) && (Location.Z + 80 >= RemoteTarget.Location.Z)) || ((Location.Z + 19 >= RemoteTarget.Location.Z) && (bDefendMelee || (skill > 2.5 * FRand() - 0.5)))) ) { HitActor = Trace(HitLocation, HitNormal, FireSpot - vect(0,0,1) * (RemoteTarget.CollisionHeight + 6), FireSpot, false); bClean = (HitActor == None); if ( !bClean ) { FireSpot = HitLocation + vect(0,0,3); bClean = FastTrace(FireSpot, ProjStart); } else if ( RemoteTarget.Physics == PHYS_Falling ) bClean = FastTrace(FireSpot, ProjStart); else bClean = false; } if ( !bClean ) { //try middle FireSpot.Z = RemoteTarget.Location.Z; bClean = FastTrace(FireSpot, ProjStart); } if( !bClean ) { ////try head FireSpot.Z = RemoteTarget.Location.Z + 0.9 * RemoteTarget.CollisionHeight; bClean = FastTrace(FireSpot, ProjStart); } FireRotation = Rotator(FireSpot - ProjStart); realYaw = FireRotation.Yaw; aimerror = Rand(2 * aimerror) - aimerror; FireRotation.Yaw = (FireRotation.Yaw + aimerror) & 65535; if ( (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) > 8192) && (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) < 57343) ) { if ( (FireRotation.Yaw > Rotation.Yaw + 32768) || ((FireRotation.Yaw < Rotation.Yaw) && (FireRotation.Yaw > Rotation.Yaw - 32768)) ) FireRotation.Yaw = Rotation.Yaw - 8192; else FireRotation.Yaw = Rotation.Yaw + 8192; } FireDir = vector(FireRotation); // avoid shooting into wall FireDist = FMin(VSize(FireSpot-ProjStart), 400); FireSpot = ProjStart + FireDist * FireDir; HitActor = Trace(HitLocation, HitNormal, FireSpot, ProjStart, false); if ( HitActor != None ) { if ( HitNormal.Z < 0.7 ) { FireRotation.Yaw = (realYaw - aimerror) & 65535; if ( (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) > 8192) && (Abs(FireRotation.Yaw - (Rotation.Yaw & 65535)) < 57343) ) { if ( (FireRotation.Yaw > Rotation.Yaw + 32768) || ((FireRotation.Yaw < Rotation.Yaw) && (FireRotation.Yaw > Rotation.Yaw - 32768)) ) FireRotation.Yaw = Rotation.Yaw - 8192; else FireRotation.Yaw = Rotation.Yaw + 8192; } FireDir = vector(FireRotation); FireSpot = ProjStart + FireDist * FireDir; HitActor = Trace(HitLocation, HitNormal, FireSpot, ProjStart, false); } if ( HitActor != None ) { FireSpot += HitNormal * 2 * RemoteTarget.CollisionHeight; if ( !bNovice ) { HitActor = Trace(HitLocation, HitNormal, FireSpot, ProjStart, false); if ( HitActor != None ) FireSpot += RemoteTarget.CollisionHeight * HitNormal; } FireDir = Normal(FireSpot - ProjStart); FireRotation = rotator(FireDir); } } if ( warnTarget && (RemoteTarget != None) ) RemoteTarget.WarnTarget(self, projSpeed, FireDir); viewRotation = FireRotation;*/ // FIXME return FireRotation; } // Let Bot know about incoming projectiles function WarnTarget(Pawn shooter, float projSpeed, vector FireDir) { local float enemyDist; local vector X,Y,Z, enemyDir; // AI controlled creatures may duck if not falling if ( (Pawn.health <= 0) || (Enemy == None) || (Physics == PHYS_Falling) || (Physics == PHYS_Swimming) ) return; /*if ( bNovice ) { if ( FRand() > 0.11 * skill ) return; }*/ //else if ( FRand() > 0.22 * skill + 0.33 ) if ( FRand() > 0.22 * skill + 0.33 ) return; // and projectile time is long enough enemyDist = VSize(shooter.Location - Location); if (enemyDist/projSpeed < 0.11 + 0.15 * FRand()) return; // only if tight FOV GetAxes(Rotation,X,Y,Z); enemyDir = (shooter.Location - Location)/enemyDist; if ((enemyDir Dot X) < 0.8) return; myConnection.SendLine("PRJ" $ib$as$ "Time" $ib$ (enemyDist/projSpeed) $ae$ib$as$ "Direction" $ib$ rotator(enemyDir) $ae); } function bool TryToDuck(vector duckDir, bool bReversed); // CloseToPointMan - called if orders are 'follow' to check if close enough to point man function bool CloseToPointMan(Pawn Other) { //return what engine wants to hear return true; } //Don't need our bots autotaunting function MaybeTaunt(Pawn Other); //Called when someone other than this bot dies. function Killed(pawn Killer, pawn Other, name damageType) { if ( Killer == self ) Other.Health = FMin(Other.Health, -11); // don't let other do stagger death if ( Pawn.Health <= 0 ) return; if ( OldEnemy == Other ) OldEnemy = None; if ( Enemy == Other ) { Enemy = None; } myConnection.SendLine("KIL" $ib$as$ "Id" $ib$ Other $ae$ib$as$ "Killer" $ib$ Killer $ae$ib$as$ "DamageType" $ib$ damageType $ae); } //Pointless callback function EnemyAcquired(); //All kinds of shit can call this mostly special trigger points function Trigger( actor Other, pawn EventInstigator ) { //SENDMESSAGE } //Much of translocator brains implemented in translocator //For now better off playing without it - need to research how //it interacts with path finding function TranslocateToTarget(Actor Destn) { //MyTranslocator.DesiredTarget = Destn; } //Don't let engine pick nodes that must be impact jumped function bool CanImpactJump() { return false; } //Don't handle impact jumps or low gravity manuevers for bots function ImpactJump(); function BigJump(Actor JumpDest); //Don't have engine direct to Ambush function bool FindAmbushSpot() { return false; } function PawnDied(Pawn P) { Pawn.UnPossessed(); Pawn = None; Super.PawnDied(P); isDR=false; //if(!IsInState('Dying')) // BotDeathMatch(Level.Game).SpawnPlayer(self); //GotoState('Dying'); Level.Game.RestartPlayer(self); } //Called when bot dies // function PawnDied() ??? /*function Died(Controller Killer, classdamageType, vector HitLocation) { log("BOT DIED!!!!!!!!!!!"); Pawn.Died(Killer, damageType, HitLocation); myConnection.SendLine("DIE" $ib$as$ "Killer" $ib$ Killer $ae$ib$as$ "DamageType" $ib$ damageType $ae); }*/ //Called when bot is injured function NotifyTakeHit(pawn InstigatedBy, vector HitLocation, int Damage, class damageType, vector Momentum) { local float enemyDist; local vector enemyDir, X, Y, Z; local string messageString; Super.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType); messageString = "DAM" $ib$as$ "Damage" $ib$ Damage $ae$ib$as$ "DamageType" $ib$ damageType $ae; // !!! need to fix this and projectile detection to match our //periphreal vision parameter. // only if tight FOV GetAxes(Rotation,X,Y,Z); enemyDist = VSize(instigatedBy.Location - Location); enemyDir = (instigatedBy.Location - Location)/enemyDist; if ((enemyDir Dot X) > 0.8) messageString = messageString $ib$as$ "Instigator" $ib$ instigatedBy $ae; myConnection.SendLine(messageString); } //********************************************************************************** //Base Monster AI /* auto state StartUp { function BeginState() { SetMovementPhysics(); if (Physics == PHYS_Walking) SetPhysics(PHYS_Falling); } Begin: } */ auto state StartUp { function BeginState() { Squad = spawn(DeathMatch(Level.Game).DMSquadClass); // FIXME Squad.AddBot(self); // Above is a blatant hack because I don't understand why this // won't work in AddRemoteBot //SetMovementPhysics(); } function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, class damageType) { Global.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType); } function Landed(vector HitNormal) { Global.Landed(HitNormal); } function Tick( float DeltaTime ) // jjwang 02/06/11 { local vector cur; if (botDR==none) return; if (Pawn.Health<=0) {isDR=false;return;} if (!isDR) { if (!botDR.IsRunning()) return; else botDR.Stop(); } else { if (botDR.IsRunning()) { //if (botDR.Step(DeltaTime)) return; botDR.SetDT(DeltaTime); if (botDR.bRFilter) myRotation = botDR.FGetR(); else { botDR.GetR(); myRotation = botDR.current.DR_RP; } //DesiredRotation = myRotation; //Pawn.SetRotation(myRotation); if (botDR.bLFilter) myDestination = botDR.FGetL(); else { botDR.GetL(); myDestination = botDR.current.DR_P; } cur=Pawn.Location; if (!Pawn.Move(myDestination-Pawn.Location)) Pawn.Move(botDR.current.DR_V*DeltaTime); // if user doesn't specify rotation, let bot turn to its moving direction. 03/02/06 //if (botDR.current.DR_RV.pitch==0 && botDR.current.DR_RV.yaw==0 && botDR.current.DR_RV.roll==0) //dr=rotator(Normal(Pawn.Location-cur)); //log("DR TTT:"@Pawn.Rotation.Pitch@Pawn.Rotation.Yaw@Pawn.Rotation.Roll); //if (Pawn.Rotation.Yaw==32767||Pawn.Rotation.Yaw==-32767) dr.Pitch=0-dr.Pitch; if (botDR.bAutoTurn&&(botDR.current.DR_V.X!=0||botDR.current.DR_V.Y!=0||botDR.current.DR_V.Z!=0)) myRotation = rotator(Normal(botDR.current.DR_V)); //myRotation = dr; Pawn.SetRotation(myRotation); //if (!Pawn.SetLocation(myDestination)) { //This is used to keep bot moving after it hit something. To be honest, I don't like this. //Thin is not the correct way to simulte hit responce. Because I must let Tick() as simple //as possible, I let UT to addjust driection after hitted something. So I use: // SetLocation(Location + botDR.current.DR_V*DeltaTime); //Anyway, it works. jjwang 02/06/18 //Pawn.SetLocation(Pawn.Location + botDR.current.DR_V*DeltaTime); //Velocity=botDR.current.DR_V; //Pawn.Move(botDR.current.DR_V*DeltaTime); //Pawn.SetRotation(rotator(Normal(botDR.current.DR_V))); //} } } } /* This function is used to correct Bot's position and handle hit event. What I'm doing is: if (hit a fixed wall) {call function HitWall();} else {goto move state; let UT deal with hit event;} So if Bot hit a mover wall(for example: a door), UT will deal with it. I'm not sure, after Bot hit something if DeadReckoning will continue work. Right now, I let DeadReckoning continue work. jjwang 02/06/18 */ /*function Timer() // jjwang 02/06/11 { log("TIMER()"); // Show walking or running //if(bIsWalking) // PlayWalking(); //else // PlayRunning(); if (isDR) { log("TIMER"); if (!botDR.Correct(Level.TimeSeconds)) { HitActor=Trace(HitLocation,HitNormal,botDR.PreLP(Level.TimeSeconds),Location,true); if (bDebug) log("Trace HitActor("$HitActor$") HitLocation("$HitLocation$") HitNormal("$HitNormal$") Destination("$botDR.current.DR_P$")"); if (HitActor==Level) HitWall(HitNormal,HitActor); else if (HitActor != None) { //isDR = false; // I'm not sure weather I should stop dead recknoing. Right now, I let it continue work. myDestination = botDR.PreLP(Level.TimeSeconds+5*deltatime); GotoState('startup','Move'); } } if (!botDR.bLFilter) start.bLFilter = false; // Used for updating DR replication. 02/06/28 if (!botDR.bRFilter) start.bRFilter = false; // Used for updating DR replication. 02/06/28 } else SetTimer(0,false); } */ DRM: if (isDR) { botDR.Begin(); SetTimer(deltatime,true); } //goto 'Begin'; Begin: if (Physics != PHYS_Falling) { Velocity = vect(0,0,0); Acceleration = vect(0,0,0); MoveTimer = -1.0; } //Pawn.PlayWaiting(); sleep( 30 ); goto 'Begin'; Test: bFire = 0; RemoteEnemy=none; Enemy=none; //PlayDuck(); sleep( 30 ); goto 'Test'; Move: MoveTo(myDestination, , Pawn.bIsWalking); if( VSize(Pawn.Location - myDestination) > CollisionRadius ) { goto 'Move'; } goto 'Begin'; Strafe: // STRAFE is not working yet. They got rid of the Strafe funcions :-( */ if(RemoteFocus != none) { Focus = RemoteFocus; } else if(myFocus != vect(0,0,0)) { FocalPoint = myFocus; } MoveTo(myDestination, , Pawn.bIsWalking); if( VSize(Location - myDestination) > CollisionRadius ) goto 'Strafe'; goto 'Begin'; Tracking: if (Physics != PHYS_Falling) { Velocity = vect(0,0,0); Acceleration = vect(0,0,0); MoveTimer = -1.0; } if ( RemoteFocus == none || !FastTrace(RemoteFocus.Location) ) { goto 'Begin'; } else { Focus = RemoteFocus; Sleep(0.05); goto 'Tracking'; } Turning: if (Pawn.Physics != PHYS_Falling) { Velocity = vect(0,0,0); Acceleration = vect(0,0,0); MoveTimer = -1.0; } if(myRotationRate != rot(0,0,0)) { Pawn.RotationRate = myRotationRate; } if(RemoteFocus != none) { Focus = RemoteFocus; } else if(myFocus != vect(0,0,0)) { FocalPoint = myFocus; } else { ClientSetRotation(myRotation); } FinishRotation(); /* Reset rotation rate to default value */ if(myRotationRate != rot(0,0,0)) { myRotationRate = rot(0,0,0); Pawn.RotationRate = Pawn.default.RotationRate; } Sleep(0.05); goto 'Begin'; } state TakeHit { //ignores seeplayer, hearnoise, bump, hitwall; function Timer(); Begin: error("!!!TakeHit"); //GotoState(NextState,NextLabel); } state FallingState { ignores Bump, Hitwall, WarnTarget; singular event BaseChange() { Global.BaseChange(); } /* function AnimEnd(int Channel) // FIXME { //PlayInAir(); } function ZoneChange(ZoneInfo newZone) { Global.ZoneChange(newZone); if (newZone.bWaterZone) // FIXME { TweenToWaiting(0.15); GotoState('FallingState', 'Splash'); } }*/ function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, class damageType) { Global.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType); } /* function bool SetEnemy(Pawn NewEnemy) // FIXME { Global.SetEnemy(NewEnemy); }*/ function Timer(); function Landed(vector HitNormal) { local vector Vel2D; if ( MoveTarget != None ) { Vel2D = Velocity; Vel2D.Z = 0; if ( (Vel2D Dot (MoveTarget.Location - Location)) < 0 ) Acceleration = vect(0,0,0); } //Note - physics changes type to PHYS_Walking by default for landed pawns Pawn.PlayLanded(Velocity.Z); Pawn.TakeFallingDamage(); if (Velocity.Z < -1.4 * Pawn.JumpZ) { if ( Pawn.health > 0 ) GotoState('FallingState', 'Landed'); } else GotoState('FallingState', 'Done'); } function SeePlayer(Pawn SeenPlayer) { Global.SeePlayer(SeenPlayer); } function EnemyNotVisible() { Global.EnemyNotVisible(); } function SetFall() { if (!Pawn.bUpAndOut) GotoState('FallingState'); } function EnemyAcquired() { Global.EnemyAcquired(); } function BeginState(); function EndState() { //log(self$" left falling state "); Pawn.bUpAndOut = false; //Pawn.bJumpOffPawn = false; //bBigJump = false; /*if ( bImpactJumping ) { bImpactJumping = false; SwitchToBestWeapon(); }*/ // FIXME } FireWhileFalling: if ( Physics != PHYS_Falling ) Goto('Done'); else Sleep(0.5 + 0.2 * FRand()); if ( LineOfSightTo(Enemy) ) Goto('FireWhileFalling'); LongFall: if ( Pawn.bCanFly ) { SetPhysics(PHYS_Flying); Goto('Done'); } Sleep(0.7); /*if ( (Velocity.Z > -150) && (Region.Zone.ZoneGravity.Z <= Region.Zone.Default.ZoneGravity.Z) ) //stuck { SetPhysics(PHYS_Falling); Velocity = groundspeed * VRand(); Velocity.Z = FMax(JumpZ, 250); }*/ // FIXME Goto('LongFall'); Landed: //log("Playing"@animsequence@"at"@animframe); Disable('AnimEnd'); FinishAnim(); //log("Finished"@animsequence@"at"@animframe); Done: //log("After fall"@NextState@NextLabel); /*if ( Pawn.NextAnim == '' ) { bUpAndOut = false; if ( (NextState != '') && (NextState != 'FallingState') ) GotoState(NextState, NextLabel); else { log("Going from -Done"); GotoState('StartUp'); } } if ( !bUpAndOut ) { if ( NextAnim == 'Fighter' ) TweenToFighter(0.2); else TweenAnim(NextAnim, 0.12); } */ // FIXME Splash: Pawn.bUpAndOut = false; /*if ( NextState != '' ) GotoState(NextState, NextLabel); else { log("Going from -Splash"); GotoState('StartUp'); }*/ // FIXME Begin: if ( !Pawn.bUpAndOut ) // not water jump { /*if ( Region.Zone.bWaterZone ) { SetPhysics(PHYS_Swimming); GotoState(NextState, NextLabel); }*/ // FIXME PlayFall: /*if ( (Velocity.Z > 300) && (MoveTarget != None) && ((FRand() < 0.13) || ((Region.Zone.ZoneGravity.Z > Region.Zone.Default.ZoneGravity.Z) && (FRand() < 0.2))) && (VSize(Destination - Location) > 160) && ((Vector(Rotation) Dot (Destination - Location)) > 0) ) PlayFlip(); else TweenToFalling();*/ // FIXME } if (Physics != PHYS_Falling) Goto('Done'); /*if ( bJumpOffPawn ) { if ( bBigJump ) { While( bBigJump ) { Sleep(0.25); Acceleration = AccelRate * Normal(Destination - Location); } } else { Sleep(0.2); While ( (Abs(Velocity.X) < 60) && (Abs(Velocity.Y) < 60) ) Sleep(0.1); Acceleration = vect(0,0,0); Sleep(1.5); } bBigJump = false; bJumpOffPawn = false; } else */ // FIXME Sleep(2); Goto('LongFall'); Ducking: /*if ( Region.Zone.ZoneGravity.Z > Region.Zone.Default.ZoneGravity.Z ) { Acceleration = AccelRate * Normal(Destination - Location); if ( bNovice ) Sleep(0.4); PlayInAir(); } */ // FIXME } //called from pressure zone just get the hell back out state VictoryDance { function TakeDamage( int Damage, Pawn instigatedBy, Vector hitlocation, Vector momentum, class damageType) { Global.TakeDamage(Damage, instigatedBy, hitlocation, momentum, damageType); } function EnemyAcquired() { Global.EnemyAcquired(); } function BeginState(); Begin: //GotoState(NextState,NextLabel); } state GameEnded { //ignores SeePlayer, EnemyNotVisible, HearNoise, TakeDamage, Died, Bump, Trigger, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, PainTimer; ignores SeePlayer, EnemyNotVisible, HearNoise, TakeDamage, Bump, Trigger, HitWall, ZoneChange, Falling, WarnTarget, PainTimer; function SpecialFire() { } function bool TryToDuck(vector duckDir, bool bReversed) { return false; } function SetFall() { } function LongFall() { } function Killed(pawn Killer, pawn Other, name damageType) { } function ClientDying(class DamageType, vector HitLocation) { } function BeginState() { Pawn.SimAnim.AnimRate = 0.0; bFire = 0; bAltFire = 0; //SimAnim.Y = 0; SetCollision(false,false,false); SetPhysics(PHYS_None); Velocity = vect(0,0,0); myConnection.SendLine("FIN"); } } state Dying { //ignores SeePlayer, EnemyNotVisible, HearNoise, Died, Bump, Trigger, HitWall, HeadZoneChange, FootZoneChange, ZoneChange, Falling, WarnTarget, LongFall, SetFall, PainTimer; //ignores SeePlayer, EnemyNotVisible, HearNoise, Died, Bump, Trigger, HitWall, ZoneChange, Falling, WarnTarget, LongFall, SetFall, PainTimer; ignores Trigger, Bump, HitWall, HeadVolumeChange, PhysicsVolumeChange, Falling; function ReStartPlayer() { log("DYING, RESTARTPLAYER"); Velocity = vect(0,0,0); Acceleration = vect(0,0,0); //ViewRotation = Rotation; //SetRotation(Rotation); ReSetSkill(); SetPhysics(PHYS_Falling); //SetOrders(BotReplicationInfo(PlayerReplicationInfo).RealOrders, BotReplicationInfo(PlayerReplicationInfo).RealOrderGiver, true); // FIXME //GotoState('StartUp'); //ServerReStartPlayer(); //Level.Game.ReStartPlayer(self); // FIXME //BotDeathMatch(Level.Game).SpawnPlayer(self); if ( !IsInState('GameEnded') ) { //log("not game ended, restart player"); GotoState('Dying', 'TryAgain'); } } function BeginState() { Enemy = None; //PointDied = -1000; // FIXME bFire = 0; bAltFire = 0; bInitLifeMessage = false; //MyTranslocator = None; // FIXME //log("DYING, BEGINSTATE"); } Begin: if ( Level.Game.bGameEnded ) GotoState('GameEnded'); Sleep(0.2); //log("DYING, BEGIN"); TryAgain: //if ( !bHidden ) //{ // HidePlayer(); //} // FIXME Sleep(0.25 + DeathMatch(Level.Game).SpawnWait(self)); log("DYING, TRYAGAIN"); if(Pawn == None) { log("DYING, TRYAGAIN, Pawn == None"); ReStartPlayer(); Goto('TryAgain'); } else { log("DYING, TRYAGAIN, Pawn != None"); GotoState('StartUp'); } WaitingForStart: //bHidden = true; //bHidden = false; log("DYING, WAITINGFORSTART"); Goto('Begin'); } state Dead { ignores SeePlayer, HearNoise, KilledBy; function BeginState() { log("Dead, BeginState"); //ServerReStartPlayer(); } } //-------------RemoteBot Specific Functions-------------------- //Check to see if a location is really in front of the bot //may be a more efficient algorithm function bool inFront(Vector A) { local rotator angle; //can't be infront if inside bot if( VSize(Location - A) < CollisionRadius ) return false; angle = ( Rotation - rotator(A - Location) ); if( (cos(angle.Yaw / 10435.0) < remoteVisionLimit) || (cos(angle.Pitch / 10435.0) < remoteVisionLimit) ) return false; else return true; } //Called by the gametype when someone else is injured by the bot function HurtOther(int Damage, name DamageType, pawn injured) { myConnection.SendLine("HIT" $ib$as$ "Id" $ib$ injured $ae$ib$as$ "Damage" $ib$ Damage $ae$ib$as$ "DamageType" $ib$ DamageType $ae); } function checkSelf() { local int ArmorAmount,i; local string outstring; ArmorAmount = 0; i = 0; outstring = "SLF" $ib$as$ "Id" $ib$ self $ae$ib$as$ "Rotation" $ib$ Pawn.Rotation $ae$ib$as$ "Location" $ib$ Pawn.Location $ae$ib$as$ "Velocity" $ib$ Pawn.Velocity $ae$ib$as$ "Name" $ib$ PlayerReplicationInfo.PlayerName $ae$ib$as$ // "Team" $ib$ PlayerReplicationInfo.Team $ae$ib$as$ // Team works, but break the Java bot "Health" $ib$ Pawn.Health $ae$ib$as$ "Weapon" $ib$ Pawn.Weapon $ae; if(Pawn.Weapon != None) { outstring = outstring $ib$as$ "CurrentAmmo" $ib$ Pawn.Weapon.AmmoAmount(0) $ae; //FIXME } // "Armor" $ib$ ArmorAmount $ae; // ae; if( bFire != 0 ) outstring = outstring $ib$as$ "Firing" $ib$ "1" $ae; else if( bAltFire != 0 ) outstring = outstring $ib$as$ "AltFiring" $ib$ "2" $ae; else outstring = outstring $ib$as$ "AltFiring" $ib$ "0" $ae; myConnection.sendLine(outstring); } function checkVision() { local Inventory I; local Mover M; local Controller P; local CTFFlag C; local NavigationPoint N; local vector HitL, HitN; //local int temp; local string outstring; //!!! view rotation sometimes falls out of synch with rotation? wtf?? for ( P=Level.ControllerList; P!=None; P=P.NextController ) { if( (P != self) && !P.bHidden && FastTrace(P.Location) && inFront(P.Location) && ( Trace(HitL, HitN, P.Location) == P) ) { outstring = "PLR" $ib$as$ "Id" $ib$ P $ae$ib$as$ "Rotation" $ib$ P.Rotation $ae$ib$as$ "Location" $ib$ P.Location $ae$ib$as$ "Velocity" $ib$ P.Velocity $ae$ib$as$ "Name" $ib$ PlayerReplicationInfo.PlayerName $ae$ib$as$ "Team" $ib$ 0 $ae$ib$as$ // "Team" $ib$ P.PlayerReplicationInfo.Team $ae$ib$as$ "Reachable" $ib$ actorReachable(P) $ae$ib$as$ "Weapon" $ib$ P.Pawn.Weapon.Class $ae; if( P.bFire != 0 ) outstring = outstring $ib$as$ "Firing" $ib$ "1" $ae; else if( P.bAltFire != 0 ) outstring = outstring $ib$as$ "AltFiring" $ib$ "2" $ae; else outstring = outstring $ib$as$ "AltFiring" $ib$ "0" $ae; myConnection.sendLine(outstring); } } foreach VisibleCollidingActors(class'Inventory',I,Pawn.SightRadius) { if( I.GetStateName() == 'Pickup'&& !I.bHidden && inFront(I.Location) && ( Trace(HitL, HitN, I.Location) == none) ) { myConnection.SendLine("INV" $ib$as$ "Id" $ib$ I $ae$ib$as$ "Location" $ib$ I.Location $ae$ib$as$ "Reachable" $ib$ actorReachable(I) $ae$ib$as$ "Class" $ib$ I.Class $ae); } } foreach VisibleCollidingActors(class'Mover',M,Pawn.SightRadius) { if( !M.bHidden && inFront(M.Location) && ( Trace(HitL, HitN, M.Location) == none) ) { myConnection.SendLine("MOV" $ib$as$ "Id" $ib$ M $ae$ib$as$ "Location" $ib$ M.Location $ae$ib$as$ "Reachable" $ib$ actorReachable(M) $ae$ib$as$ "DamageTrig" $ib$ M.bDamageTriggered $ae$ib$as$ "Class" $ib$ M.Class $ae); } } for ( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint ) { //try letting them see inv navpoints - may be needed for some levels //if( !N.IsA('InventorySpot') && FastTrace(N.Location) && inFront(N.Location)) if( FastTrace(N.Location) && inFront(N.Location) && ( Trace(HitL, HitN, N.Location) == none) ) { /*if(N.IsA('ControlPoint')) // FIXME { if( ControlPoint(N).ControllingTeam == none ) temp = 255; else temp = ControlPoint(N).ControllingTeam.TeamIndex; myConnection.SendLine("DOM" $ib$as$ "Id" $ib$ N $ae$ib$as$ "Location" $ib$ N.Location $ae$ib$as$ "Reachable" $ib$ actorReachable(N) $ae$ib$as$ "Controller" $ib$ temp $ae); } else */ myConnection.SendLine("NAV" $ib$as$ "Id" $ib$ N $ae$ib$as$ "Location" $ib$ N.Location $ae$ib$as$ "Reachable" $ib$ actorReachable(N) $ae); } } if (myConnection.Parent.gameClass == "BotCTF") { foreach AllActors (class'CTFFlag', C) { //not using trace because players tend to obstruct flags wildly if( FastTrace(C.Location) && inFront(C.Location) && C.Holder != self ) { outstring = "FLG" $ib$as$ "Id" $ib$ C $ae; //when a flag is held its location is not updated by engine =( if( C.GetStateName() == 'Held') outstring = outstring $ib$as$ "Location" $ib$ C.Holder.Location $ae$ib$as$ "Holder" $ib$ C.Holder $ae; else outstring = outstring $ib$as$ "Location" $ib$ C.Location $ae; outstring = outstring $ib$as$ "Team" $ib$ C.Team $ae$ib$as$ "Reachable" $ib$ actorReachable(C) $ae$ib$as$ "State" $ib$ C.GetStateName() $ae; myConnection.SendLine(outstring); } } } } //Shortten up the MakeItem calls function string MakeItem(string first, string second) { return myConnection.MakeItem(first,second); } function Destroyed() { if(Pawn != None) { Pawn.Destroy(); } Super.Destroyed(); } function ChangeWeapon() { } function ServerChangedWeapon(Weapon OldWeapon, Weapon NewWeapon) { } state MoveToGoal { function BeginState(); } //----------------- X p3cQR!->p Sending: p8-X(pO(ppp, ,  GcY//============================================================================= // Mutator. //============================================================================= class PathMarkerMutator extends Mutator; var bool bInited; event PostBeginPlay() { local NavigationPoint N; if(!bInited) { bInited = true; for ( N=Level.NavigationPointList; N!=None; N=N.NextNavigationPoint ) { if(!N.IsA('InventorySpot')) spawn(class'BotAPI.PathMarker',N,,N.Location); } } } qV' 'VS GE xDF;c%2c,9:cg&cc GT@zAg w*a G~L GA n GB @ D vNGK GM |C%9nf9D9?T9?,@]zfG9:fg&fGRemoteBotControllerfg$ G*/VB qC. CMCK CLn->Spawned BotConnection Gyi P2G /jW3}ɢɢɢɢ )R//============================================================================= // PathMarker. //============================================================================= #exec OBJ LOAD FILE=..\staticmeshes\ParticleMeshes.usx class PathMarker extends Actor; M;class MyInteraction extends Interaction; var bool bDrawEnemy; var bool bDrawFriendly; var bool bControlPawn; var PlayerController OldController; var Pawn myPawn; function Initialize() { Log("Interaction Initialized"); } /*function bool KeyEvent(EInputKey Key, EInputAction Action, FLOAT Delta ) { log(Action); if (Action == IST_Press) ViewportOwner.Actor.ClientMessage("Key PRESSED:" @ Key); if (Action == IST_Release) ViewportOwner.Actor.ClientMessage("Key RELEASED:" @ Key); if (Action == IST_Hold) ViewportOwner.Actor.ClientMessage("Key HELD:" @ Key); if (Action == IST_Axis) ViewportOwner.Actor.ClientMessage("Key AXIS:" @ Key); return false; }*/ /*function bool KeyType( EInputKey Key, optional string Unicode ) { if (bIgnoreKeys) return true; if( Key>=0x20 ) { if( Unicode != "" ) TypedStr = TypedStr $ Unicode; else TypedStr = TypedStr $ Chr(Key); return( true ); } }*/ function bool KeyEvent(EInputKey Key, EInputAction Action, FLOAT Delta ) { if ((Action == IST_Press) && (Key == IK_PageUp)) { ViewportOwner.Actor.ClientMessage("Key PRESSED:" @ Key); } if ((Action == IST_Press) && (Key == IK_PageDown)) { ViewportOwner.Actor.ClientMessage("Key PRESSED:" @ Key); } return false; } /*function bool KeyEvent(EInputKey Key, EInputAction Action, FLOAT Delta ) { if ((Action == IST_Press) && (Key == IK_PageUp)) bDrawEnemy = True; if ((Action == IST_Release) && (Key == IK_PageUp)) bDrawEnemy = False; if ((Action == IST_Press) && (Key == IK_PageDown)) bDrawFriendly = True; if ((Action == IST_Release) && (Key == IK_PageDown)) bDrawFriendly = False; return false; } simulated function PostRender( canvas Canvas ) { local Pawn P; local vector CameraLocation, dir, ScreenLocation; local rotator CameraRotation; local float dist, draw_scale; if ((bDrawEnemy) || (bDrawFriendly)) //if none are true, dont do anything. Saves processing. { foreach ViewportOwner.Actor.DynamicActors(class'Pawn', P) { if (ViewportOwner.Actor.Pawn == None || P == None) Return; //A trace to tell if you can see this thing If ((Canvas.Viewport.Actor.FastTrace(P.Location, ViewportOwner.Actor.Pawn.Location)) && (P != ViewportOwner.Actor.Pawn) && (P.PlayerReplicationInfo != None) && (P.Health > 0)) { //Convert 3d location to 2d for display on the Canvas ScreenLocation = WorldToScreen(P.location); Canvas.GetCameraLocation(CameraLocation, CameraRotation); dir = P.Location - CameraLocation; dist = VSize(dir); //Distance between me and them if (dir dot vector(CameraRotation) > 0) { draw_scale = 512 / dist; //Calculate the drawscale, 512 is the "1:1" distance. //Set drawing params Canvas.SetPos(ScreenLocation.X - (32 * draw_scale), ScreenLocation.Y - (32 * draw_scale)); Canvas.Style = 3; Canvas.SetDrawColor(255,255,255); if (bDrawEnemy) //If PageUp is depressed (bDrawEnemy is true), see if the pawn is an enemy, if so, draw him! if ((P.PlayerReplicationInfo.Team.TeamIndex != ViewportOwner.Actor.Pawn.PlayerReplicationInfo.Team.TeamIndex)) Canvas.DrawIcon(texture'red', draw_scale); if (bDrawFriendly) //If PageDown is depressed (bDrawFriendly is true), see if the pawn is an friendly, if so, draw him! if (P.PlayerReplicationInfo.Team.TeamIndex == ViewportOwner.Actor.Pawn.PlayerReplicationInfo.Team.TeamIndex) Canvas.DrawIcon(texture'green', draw_scale); } } } } }*/ J ~WK +/\ u*FHu*FH )Frclass icu_mut extends Mutator; var bool bAffectSpectators; // If this is set to true, an interaction will be created for spectators var bool bAffectPlayers; // If this is set to true, an interaction will be created for players var bool bHasInteraction; var bool bDrawEnemy; var bool bDrawFriendly; function PreBeginPlay() { Log("ICU Mutator Started"); // Always comment out your logs unless they're errors } simulated function Tick(float DeltaTime) { local PlayerController PC; // If the player has an interaction already, exit function. if (bHasInteraction) Return; // DynamicActors is not very fast, so it's used only when really necessary. Using it once is no big deal. ForEach DynamicActors(Class'PlayerController', PC) { if (Viewport(PC.Player) != None) // Find the local Player { // Run a check to see whether this mutator should create an interaction for the player if ((PC.PlayerReplicationInfo.bIsSpectator && bAffectSpectators) || (bAffectPlayers && !PC.PlayerReplicationInfo.bIsSpectator)) { PC.Player.InteractionMaster.AddInteraction("BotAPI.MyInteraction", PC.Player); // Create the interaction bHasInteraction = True; // Set the variable so this lot isn't called again Return; // Exit function, and therefore exit the foreach iteration } } } } N _r_h Ga i G@@usim a Gg@L e X2 R C2jWHHHk*HHk*Hu*FkH )HGV_E|//============================================================================= // Dead Reckoning. //============================================================================= class DeadReckoning extends Object config(BotAPI); //----------------------------------------------------------------------------- // Structurs. struct DRMovement { var float DR_T; var vector DR_P; var vector DR_V; var vector DR_A; var rotator DR_RP; var rotator DR_RV; var rotator DR_RA; }; struct Inf { var rotator RotationRate; var bool bRotateToDesired; var bool bRollToDesired; //var bool bCarriedItem; var float NetPriority; }; //----------------------------------------------------------------------------- // Variables. var DRMovement start; var DRMovement current; var DRMovement cache; var float deltatime; var Inf oldInf; var bool bRunning; var bool bLFilter; var bool bRFilter; var Pawn owner; var config int PreK; var config int MaxErr; var bool bNewBase; var bool bLocked; var bool bAutoTurn; //----------------------------------------------------------------------------- // Functions. function Save(Pawn owner) { oldInf.RotationRate = owner.RotationRate; oldInf.bRotateToDesired = owner.bRotateToDesired; oldInf.bRollToDesired = owner.bRollToDesired; //oldInf.bCarriedItem = owner.bCarriedItem; oldInf.NetPriority = owner.NetPriority; } function Restore(Pawn owner) { owner.RotationRate = oldInf.RotationRate; owner.bRotateToDesired = oldInf.bRotateToDesired; owner.bRollToDesired = oldInf.bRollToDesired; //owner.bCarriedItem = oldInf.bCarriedItem; owner.NetPriority = oldInf.NetPriority; } function SetT(float time) { CurL(time); CurR(time); current.DR_P = owner.Location; start.DR_P = current.DR_P; start.DR_V = current.DR_V; start.DR_A = current.DR_A; current.DR_RP = owner.Rotation; start.DR_RP = current.DR_RP; start.DR_RV = current.DR_RV; start.DR_RA = current.DR_RA; start.DR_T = time; bNewBase=true; bLocked=false; if (current.DR_RV.Pitch==0 && current.DR_RV.Yaw==0 && current.DR_RV.Roll==0 && current.DR_RA.Pitch==0 && current.DR_RA.Yaw==0 && current.DR_RA.Roll==0) bAutoTurn=true; //if(oldInf.NetPriority>0) owner.NetPriority = oldInf.NetPriority; } function SetDT(float dt) { deltatime = dt; //current.DR_V = current.DR_V + current.DR_A * dt * 0.5; // init //current.DR_RV = current.DR_RV + current.DR_RA * dt * 0.5; // init } function SetLP(vector p) { start.DR_P = p; current.DR_P = p; bLFilter = true; } function SetLV(vector v) { start.DR_V = v; current.DR_V = v; } function SetLA(vector a) { start.DR_A = a; current.DR_A = a; } function SetRP(rotator p) { start.DR_RP = p; current.DR_RP = p; bRFilter = false; bAutoTurn=false; //bRFilter = true; } function SetRV(rotator v) { start.DR_RV = v; current.DR_RV = v; bAutoTurn=false; } function SetRA(rotator a) { start.DR_RA = a; current.DR_RA = a; bAutoTurn=false; } function SetL(vector p, vector v, vector a) { start.DR_P = p; start.DR_V = v; start.DR_A = a; current.DR_P = p; current.DR_V = v; current.DR_A = a; } function SetR(rotator p, rotator v, rotator a) { start.DR_RP = p; start.DR_RV = v; start.DR_RA = a; current.DR_RP = p; current.DR_RV = v; current.DR_RA = a; } function bool setCache() { if (!bLocked) { cache.DR_P = current.DR_P; cache.DR_V = current.DR_V; cache.DR_A = current.DR_A; return true; } return false; } function bool Recover() { if (!bLocked) { current.DR_V = cache.DR_V; current.DR_A = cache.DR_A; return true; } return false; } function Locked() { bLocked=true; } function UnLocked() { bLocked=false; } function bool isLocked() { return bLocked; } function NewBase(bool b) { bNewBase=b; } function bool isNewBase() { return bNewBase; } function CurL(float t) { local float dt,tmp; dt = t - start.DR_T; tmp = dt*dt*0.5; current.DR_P = start.DR_P + start.DR_V * dt + start.DR_A * tmp; current.DR_V = start.DR_V + start.DR_A * dt; } function CurR(float t) { local float dt,tmp; dt = t - start.DR_T; tmp = dt*dt*0.5; current.DR_RP = start.DR_RP + start.DR_RV * dt + start.DR_RA * tmp; current.DR_RV = start.DR_RV + start.DR_RA * dt; } function vector PreLP(float t) { local float dt,tmp; dt = t - start.DR_T; tmp = dt*dt*0.5; return (start.DR_P + start.DR_V * dt + start.DR_A * tmp); } function rotator PreRP(float t) { local float dt,tmp; dt = t - start.DR_T; tmp = dt*dt*0.5; return (start.DR_RP + start.DR_RV * dt + start.DR_RA * tmp); } function GetL( ) { current.DR_V = current.DR_V + current.DR_A * deltatime; current.DR_P = current.DR_P + current.DR_V * deltatime; } function GetR( ) { current.DR_RV = current.DR_RV + current.DR_RA * deltatime; current.DR_RP = current.DR_RP + current.DR_RV * deltatime; } function vector FGetL( ) { local int i; local vector v,p; if (current.DR_V.x==0 && current.DR_V.y==0 && current.DR_V.z==0 && current.DR_A.x==0 && current.DR_A.y==0 && current.DR_A.z==0 ) // This means we need to forcely relocate a bot return current.DR_P; GetL(); v = current.DR_V; p = current.DR_P; for (i=1;i1) return false; //bRunning=true; return true; } F F%e8 A(->Accepted BotConnection9VCG pBotDeathMatchF.-Js h9Vv~h.LEVELINFOvhhvpppppppppppppNFO Gametype CG  Level h Fq!!C GMclass BotServer extends TcpLink config(BotAPI); var config int ListenPort; var config int MaxConnections; var string gameClass; var bool bBound; var config bool bDebug; var int ConnectionCount; // configurable delimeters for strings sent to clients // currently of form (with multiple possible attributes): // "type"$ib$"identifier"$ib$as$"attrname1"$ib$"attrvalue1"$ae // as = identifies the start of an attribute var string as; // ae = attribute end var string ae; // ib = item break var string ib; //shouldn't happen event ReceivedText( string Text ) { if(bDebug) log("RecievedTest in Server - "$Text); } function BeginPlay() { Super.BeginPlay(); if(!bBound) { BindPort( ListenPort ); if(bDebug) log("BotServer bound to port "$ListenPort); Listen(); bBound = true; } } //should never happen - accepted connections should be forwarded to a botconnection event Accepted() { if(bDebug) log("Accepted connection in BotServer"); } //called everytime a new botconnection is spawned event GainedChild( Actor C ) { Super.GainedChild(C); ConnectionCount++; //BotConnection(C).Parent = self; // if too many connections, close down listen. if(MaxConnections > 0 && ConnectionCount > MaxConnections && LinkState == STATE_Listening) { if(bDebug) Log("BotServer: Too many connections - closing down Listen."); Close(); } } event LostChild( Actor C ) { Super.LostChild(C); ConnectionCount--; // if closed due to too many connections, start listening again. if(ConnectionCount <= MaxConnections && LinkState != STATE_Listening) { if(bDebug) Log("BotServer: Listening again - connections have been closed."); Listen(); } } {Oclass BotDeathMatch extends DeathMatch config(BotAPI); var class VizServerClass; var VizServer theVizServer; var class BotServerClass; var BotServer theBotServer; var bool bServerLoaded; var class RemoteBotConfigClass; var class RemoteBotClass; var RemoteBotInfo RemoteBotConfig; var int NumRemoteBots; function PostBeginPlay() { Super.PostBeginPlay(); if(!bServerLoaded) { theVizServer = spawn(VizServerClass,self); theVizServer.gameClass = "BotDeathMatch"; theBotServer = spawn(BotServerClass); theBotServer.gameClass = "BotDeathMatch"; bServerLoaded = true; } RemoteBotConfig = spawn(RemoteBotConfigClass); } function RemoteBot AddRemoteBot(BotConnection theConnection, string clientName, int teamNum, vector startLocation, rotator startRotation, string className) { local RemoteBot NewBot; local NavigationPoint startSpot; startSpot = FindPlayerStart(NewBot); newBot = Spawn(RemoteBotClass,self,,startLocation,startRotation); newBot.bIsPlayer = true; newBot.bHidden = false; if ( NewBot != None ) { NewBot.myConnection = theConnection; NewBot.as = theConnection.as; NewBot.ae = theConnection.ae; NewBot.ib = theConnection.ib; NewBot.PlayerReplicationInfo.PlayerID = CurrentID++; NumRemoteBots++; NumPlayers++; if(clientName == "") { newBot.PlayerReplicationInfo.PlayerName = "" $ newBot; } else { newBot.PlayerReplicationInfo.PlayerName = clientName; } if(className != "") { newBot.PawnClass = class(DynamicLoadObject(className,class'Class')); } else if(newBot.PawnClass == None) { log("newBot.PawnClass is None"); newBot.PawnClass = class(DynamicLoadObject("xGame.xPawn",class'Class')); } SpawnPlayer(newBot, startLocation, startRotation); } else { log("NewBot was none"); } return NewBot; } function SpawnPlayer(RemoteBot newBot, optional vector startLocation, optional rotator startRotation) { local NavigationPoint startSpot; if(NewBot == None) { log("NewBot was none"); return; } if(NewBot.Pawn != None) { log("Already had pawn"); return; } startSpot = FindPlayerStart(NewBot); if(startLocation == vect(0,0,0)) { NewBot.Pawn = Spawn(GetDefaultPlayerClass(NewBot),,,StartSpot.Location,StartSpot.Rotation); } else { NewBot.Pawn = Spawn(NewBot.PawnClass,,,startLocation,startRotation); } log("PawnClass: "$NewBot.PawnClass); if ( NewBot.Pawn == None ) { log("Couldn't spawn player of type "$NewBot.PawnClass$" at "$StartSpot); return; } else { log("Spawned player of type "$NewBot.PawnClass$" at "$StartSpot); } NewBot.Pawn.Anchor = startSpot; NewBot.Pawn.LastStartSpot = PlayerStart(startSpot); NewBot.Pawn.LastStartTime = Level.TimeSeconds; NewBot.PreviousPawnClass = NewBot.Pawn.Class; NewBot.Possess(NewBot.Pawn); NewBot.PawnClass = NewBot.Pawn.Class; NewBot.Squad = spawn(DeathMatch(Level.Game).DMSquadClass); if(NewBot.Squad == None) log("NewBot.Squad == None"); NewBot.Pawn.PlayTeleportEffect(true, true); // NewBot.ClientSetRotation(NewBot.Pawn.Rotation); AddDefaultInventory(NewBot.Pawn); TriggerEvent( StartSpot.Event, StartSpot, NewBot.Pawn ); BroadcastLocalizedMessage(GameMessageClass, 1, NewBot.PlayerReplicationInfo); NewBot.GotoState('StartUp', 'Begin'); } function string GetGameStatus() { local string ib, as, ae; local string outStr; local Controller P; ib = theBotServer.ib; as = theBotServer.as; ae = theBotServer.ae; outStr = "GAM"; outStr = ( outStr $ib$as$ "PlayerScores" ); for ( P=Level.ControllerList; P!=None; P=P.NextController ) { if( !P.PlayerReplicationInfo.bIsSpectator ) outStr = ( outStr $ib$as$ P $ib$ P.PlayerReplicationInfo.Score $ae ); } outStr = ( outStr $ae ); return outStr; } function string GetGameInfo() { local string ib, as, ae; local string outStr; ib = theBotServer.ib; as = theBotServer.as; ae = theBotServer.ae; //outStr = (ib$as$ "FragLimit" $ib$ $ae$ib$as$ "TimeLimit" $ib$ $ae); outStr = (ib$as$ "TimeLimit" $ib$ TimeLimit $ae); return outStr; } function RestartPlayer( Controller aPlayer ) { if(aPlayer.IsA('RemoteBot')) { if(aPlayer.IsInState('Dying')) { log("BOTRESTRTPLAYER"); SpawnPlayer(RemoteBot(aPlayer)); } } else { log("RESTARTPLAYER"); Super.RestartPlayer(aPlayer); } } function Killed( Controller Killer, Controller Killed, Pawn KilledPawn, class damageType ) { local string ib, as, ae; ib = theBotServer.ib; as = theBotServer.as; ae = theBotServer.ae; Killer.PlayerReplicationInfo.Score += 1.0; if(!Killed.IsA('RemoteBot')) { Super.Killed(Killer, Killed, KilledPawn, damageType); } else if(Killed != None) RemoteBot(Killed).myConnection.SendLine("DIE" $ib$as$ "Killer" $ib$ Killer $ae$ib$as$ "DamageType" $ib$ damageType $ae); } Q @[ I$&->comandType:I8-[*I `TEST q! !E rINITR INCH (9?,d99   q! ! >SETWALKWalktempBool--D SETPHYSPhysics Walkingo$Setting Physics Walking9:9:$Bot already walking Fallingo$ $Swimmingo$ Flyingo$Setting Physics Flying9:9:$Bot already flying Rotatingo$ Projectileo$ NONE o$  :STOP q! !  UJUMP[ ]DRM eRUN ^SPINr* ^F%{Rotation @{Rate Rate69D669D669D6 V5{AcRate AcRate69D669D669D6 X~{Location sLocation Ts{Velocity Velocity UA#={Acceleration Acceleration A6xT,6\L6yT,6L6zT,6L6{T,6L6|T,6L6}T,6L6~T,6L6T,j-6@T,-K-6AT,-L[-VSTARTING DR-V' q! !t d RUNTO49LSpeed 49:9:$4 9:9:$4 4S9LAccel\ SSTarget z Location (e* q! !a tempActora w*b$    (  q! ! STRAFE49LSpeed+ 4 9:9:$4+  9:9:$4+ 4S9LAccell SS Location (yTarget zy sFocus :s#*x tempActoryx w*b$   # :s q! !8 o SHOOTTarget LocationEnemyRemoteEnemy gAlttempBool Y-D {CHANGEWEAPONID |bestfxtempActorxw*.$r*pxxwK STOPSHOOTj CHECKREACHTargeteidz Location-tb ppppppppppppppppppRCH ID e  Reachable 9T-t  From 9X  tempActorw*b$   -tbppppppppppppppppppppppppRCH ID e  Reachable 9T-t  From 9X   To 9X   TURNTOTarget z6%6%6% Location :#* @  999?#*tempActorw*b$   # :{RotationRatez Uz q! !6 PROTATEAxis "9JAmountwzVertical66"66"{RotationRatez Uz @ : 999?#* q! !6 TRACKTarget{tempActorb$   # q! !> GETPATH"%i",Ir"@*i_"@*" LocationbeidwppppppPTH ID e "%",r"@*vwppppppppw 9S" 9V"@ 9X"@  "w MESSAGEText-t9KGlobal{ PINGPONG  GG@oclass BotConnection extends TcpLink config(BotAPI); var string ReceivedData; var string RecievedArgs[9]; var string RecievedVals[9]; //used to store info inside function where local wont work //set property text dosent seem to work with a local var actor tempActor; var bool tempBool; var BotServer Parent; var RemoteBot theBot; // set true for verbose debug logs var config bool bDebug; // set true for iterative mode var config bool bIterative; // delay between visionUpdates var config float visionTime; var config bool bVision; var int attrNum; // delimeters for strings sent to clients. set to match those of the server // as = identifies the start of an attribute var string as; // ae = attribute end var string ae; // ib = item break var string ib; //------------Message Types--------------------------- // Each message appears on a seperate line. The first item // of each message is the type identifier. It is a three // letter code identifing what the message contains. // Used types are: // (Asynchronous messages) // FIN - game ended // FAL - bot just hit a dropoff // NFO - info about gametype. cue to register self // AIN - added inventory. Bot got new inventory item // VMS - recieved message from global chat channel // VMT - recieved message from team chat channel // VMG - recieved tokenized message // ZCF - foot changed zones // ZCH - head changed zones // ZCB - bot changed zones // CWP - changed weapon // WAL - collided with a wall // BMP - bumped another actor // HRP - hear pickup // HRN - hear noise // SEE - see player - !!!DEPRICATED // PRJ - incoming projectile // KIL - some other player died // DIE - bot died // DAM - took damage // HIT - hurt another player // PTH - a series of nodes in response to a getpath call // RCH - a bool result of a checkreach call // (Synchronous messages) // PLR - see another player // INV - see an inventory item (or weapon) // NAV - see a navigation point // DOM - see a domination point // FLG - see a flag // MOV - see a mover // END - end of a vision batch // BEG - begin of a vision batch // SLF - random information about bots state // GAM - random information about game state //-------------------------------------------------- function PostBeginPlay() { Parent = BotServer(Owner); ib = Parent.ib; as = Parent.as; ae = Parent.ae; if(bDebug) log("Spawned BotConnection"); } //Socket established event Accepted() { local string gameInfoStr, levelName; local int i; if(bDebug) log("Accepted BotConnection" @ self); //no clean way to do this since gametypes are not derived from //a common ancestor switch(Parent.gameClass) { /*case "BotTeamGamePlus": gameInfoStr = BotTeamGamePlus(Level.Game).GetGameInfo(); break;*/ case "BotDeathMatch": gameInfoStr = BotDeathMatch(Level.Game).GetGameInfo(); break; /*case "BotDomination": gameInfoStr = BotDomination(Level.Game).GetGameInfo(); break; case "BotCTF": gameInfoStr = BotCTF(Level.Game).GetGameInfo(); break;*/ } levelName = string(Level); i = InStr(Caps(levelName), ".LEVELINFO"); if(i != -1) levelName = Left(levelName, i); SendLine("NFO" $ib$as$ "Gametype" $ib$ Parent.gameClass $ae$ib$as$ "Level" $ib$ levelName $ae$ gameInfoStr); gotoState('monitoring','WaitingForInit'); } //InitRecieved from client event InitRecieved() { local string clientName; local string teamString; local int teamNum; local vector startLocation; local rotator startRotation; local string className; clientName = GetArgVal("Name"); teamString = GetArgVal("Team"); ParseVector(startLocation,"Location"); ParseRot(startRotation); className = GetArgVal("ClassName"); if( teamString == "" ) teamNum = 255; else teamNum = int(teamString); //no clean way to do this since gametypes are not derived from //a common ancestor that has AddRemoteBot if(bDebug) log("InitRecieved"); //switch(Parent.gameClass) //{ // case "BotTeamGamePlus": /*theBot = BotTeamGamePlus(Level.Game).AddRemoteBot(self, clientName, teamNum, startLocation, startRotation); break;*/ // case "BotDeathMatch": theBot = BotDeathMatch(Level.Game).AddRemoteBot(self, clientName, teamNum, startLocation, startRotation, className); //theBot = BotDeathMatchPlus(Level.Game).AddRemoteBot(self, clientName); // break; /*case "BotDomination": theBot = BotDomination(Level.Game).AddRemoteBot(self, clientName, teamNum, startLocation, startRotation); break; case "BotCTF": theBot = BotCTF(Level.Game).AddRemoteBot(self, clientName, teamNum, startLocation, startRotation); break; */ //} // broadcast a welcome message. //Level.Game.BroadcastMessage( theBot.PlayerReplicationInfo.PlayerName$Level.Game.EnteredMessage, false ); // FIXME if(bDebug) if(theBot != None) log("added bot, now running"); else log("ERROR ADDING BOT"); gotoState('monitoring','Running'); } //Closed on other end event Closed() { local Pawn tempPawn; if ( theBot != None && theBot.Pawn != None ) { theBot.SetLocation(theBot.Pawn.Location); theBot.Pawn.RemoteRole = ROLE_SimulatedProxy; theBot.Pawn.UnPossessed(); tempPawn = theBot.Pawn; theBot.Pawn = None; tempPawn.Destroy(); } if(theBot != None) { theBot.Destroy(); } Destroy(); } //Recieve info - parse into lines and call RecievedLine event ReceivedText( string Text ) { local int i; local string S; if(bDebug) log("Recieved - "$Text); ReceivedData = ReceivedData $ Text; // remove a LF which arrived in a new packet // and thus didn't get cleaned up by the code below if(Left(ReceivedData, 1) == Chr(10)) ReceivedData = Mid(ReceivedData, 1); i = InStr(ReceivedData, Chr(13)); while(i != -1) { S = Left(ReceivedData, i); i++; // check for any LF following the CR. if(Mid(ReceivedData, i, 1) == Chr(10)) i++; ReceivedData = Mid(ReceivedData, i); ReceivedLine(S); if(LinkState != STATE_Connected) return; i = InStr(ReceivedData, Chr(13)); } } //Here is where we handle incoming commands /* Commands expected to look like: {RUN {Argument value} {Arg value}...} Currently had coded to take no more than 9 args Command type and arguments can be any length, but first space terminates the name. Values can have spaces or any other kind of character. */ function ReceivedLine(string S) { local string cmdType, argBody, rem; local int endloc, wordsplit; local name curBotState; if(bDebug) log(S); if( theBot != none ) { curBotState = theBot.GetStateName(); if( curBotState == 'Dying' || curBotState == 'GameEnded') return; } wordsplit = InStr(S,ib); if( wordsplit == -1) wordsplit = Len(S); cmdType = left(S,wordsplit); rem = mid(S,InStr(S,as)); attrNum = 0; //iterate through attr/val pairs, storring them in the //parallel arrays RecievedArgs and RecievedVals while(attrNum < 9 && rem != "") { endloc = InStr(rem,ae); argBody = mid(rem,1,(endloc - 1)); wordsplit = InStr(argBody,ib); RecievedArgs[attrNum] = left(argBody,wordsplit); RecievedVals[attrNum] = mid(argBody,(wordsplit + 1)); rem = mid(rem,1); //advance rem = mid(rem,InStr(rem,as)); attrNum++; } cmdType = Caps(cmdType); ProcessAction(cmdType); } function string GetArgVal(string argName) { local int i; while (i < attrNum && RecievedArgs[i] != "") { if (RecievedArgs[i] ~= argName) return RecievedVals[i]; i++; } return ""; } function ParseVector(out vector v, string vecName) { local int i; local string rem; local string delim; delim = ib; rem = GetArgVal(vecName); if(rem != "") { if( InStr(rem,delim) == -1 ) delim = ","; i = InStr(rem,delim); v.X = float(left(rem,i)); rem = mid(rem,i+1); i = InStr(rem,delim); v.Y = float(left(rem,i)); v.Z = float(mid(rem,i+1)); } else { v.x = float( GetArgVal("x") ); v.y = float( GetArgVal("y") ); v.z = float( GetArgVal("z") ); } } function ParseRotAsVec(out vector vec) { local int i; local string rem; local string delim; delim = ib; rem = GetArgVal("Rotation"); if(rem != "") { if( InStr(rem,delim) == -1 ) delim = ","; i = InStr(rem,delim); vec.X = float(left(rem,i)); rem = mid(rem,i+1); i = InStr(rem,delim); vec.Y = float(left(rem,i)); vec.Z = float(mid(rem,i+1)); } else { vec.Y = float( GetArgVal("pitch") ); vec.Z = float( GetArgVal("yaw") ); vec.X = float( GetArgVal("roll") ); } } function ParseRot(out rotator rot) { local int i; local string rem; local string delim; delim = ib; rem = GetArgVal("Rotation"); if(rem != "") { if( InStr(rem,delim) == -1 ) delim = ","; i = InStr(rem,delim); rot.Pitch = float(left(rem,i)); rem = mid(rem,i+1); i = InStr(rem,delim); rot.Yaw = float(left(rem,i)); rot.Roll = float(mid(rem,i+1)); } else { rot.Pitch = float( GetArgVal("pitch") ); rot.Yaw = float( GetArgVal("yaw") ); rot.Roll = float( GetArgVal("roll") ); } } function ProcessAction(string cmdType) { local int i; local vector v, v2; local bool boolResult; local string target, id, outBuf, focusTarg; local rotator r, r2; local float speed; local float accel; if(bDebug) log("comandType:"@cmdType); if (bIterative) Level.Pauser=None; switch(cmdType) { case "TEST": theBot.GotoState('Startup', 'Test'); break; case "INIT": InitRecieved(); break; case "INCH": //test function /* must deal with target, focus and destination */ theBot.StopWaiting(); theBot.myDestination = (100 * vector(theBot.Pawn.Rotation)) + theBot.Pawn.Location; theBot.GotoState('Startup', 'Move'); break; case "SETWALK": target = GetArgVal("Walk"); SetPropertyText("tempBool",target); theBot.Pawn.bIsWalking = tempBool; break; case "SETPHYS": target = GetArgVal("Physics"); switch(target) { case "Walking": theBot.Pawn.SetPhysics(PHYS_Walking); log("Setting Physics Walking"); if(theBot.Physics == PHYS_Walking) { log("Bot already walking"); } break; case "Falling": theBot.Pawn.SetPhysics(PHYS_Falling); break; case "Swimming": theBot.Pawn.SetPhysics(PHYS_Swimming); break; case "Flying": theBot.Pawn.SetPhysics(PHYS_Flying); log("Setting Physics Flying"); if(theBot.Pawn.Physics == PHYS_Flying) { log("Bot already flying"); } break; case "Rotating": theBot.Pawn.SetPhysics(PHYS_Rotating); break; case "Projectile": theBot.Pawn.SetPhysics(PHYS_Projectile); break; case "NONE": case "": theBot.Pawn.SetPhysics(PHYS_None); break; } break; case "STOP": theBot.GotoState('Startup', 'Begin'); break; case "JUMP": theBot.RemoteJump(); break; case "DRM" : // May be we need to deal with time stamp to make time compensation. 02/06/17 case "RUN" : case "SPIN": //jjwang 02/06/01 if (theBot.botDR==none) { theBot.botDR = new class'DeadReckoning'; theBot.botDR.init(theBot.Pawn); } theBot.botDR.SetT(Level.TimeSeconds); // SPIN if (GetArgVal("Rotation")!="") { ParseRot(r); theBot.botDR.SetRP(r); } if (GetArgVal("Rate")!="") { ParseVector(v,"Rate"); r.Pitch = v.x; r.Yaw = v.y; r.Roll = v.z; theBot.botDR.SetRV(r); } if (GetArgVal("AcRate")!="") { ParseVector(v,"AcRate"); r.Pitch = v.x; r.Yaw = v.y; r.Roll = v.z; theBot.botDR.SetRA(r); } // RUN if (GetArgVal("Location")!="") { ParseVector(v2,"Location"); theBot.botDR.setLP(v2); // joe //theBot.Pawn.SetLocation(v2); //joe } if (GetArgVal("Velocity")!="") { ParseVector(v,"Velocity"); theBot.botDR.setLV(v); theBot.botDR.setLA(vect(0,0,0)); } if (GetArgVal("Acceleration")!="") { ParseVector(v,"Acceleration"); theBot.botDR.SetLA(v); } // Used for replication DR. 02/06/27 theBot.start.DR_T = theBot.botDR.start.DR_T; theBot.start.DR_P = theBot.botDR.start.DR_P; theBot.start.DR_V = theBot.botDR.start.DR_V; theBot.start.DR_A = theBot.botDR.start.DR_A; theBot.start.DR_RP = theBot.botDR.start.DR_RP; theBot.start.DR_RV = theBot.botDR.start.DR_RV; theBot.start.DR_RA = theBot.botDR.start.DR_RA; theBot.start.PreK = theBot.botDR.PreK; theBot.start.bLFilter = theBot.botDR.bLFilter; theBot.start.bRFilter = theBot.botDR.bRFilter; if (!theBot.isDR) { log("STARTING DR"); theBot.isDR = true; theBot.GotoState('Startup', 'DRM'); } break; case "RUNTO": speed = float(GetArgVal("Speed")); if(speed != 0.0) { if(theBot.Physics == PHYS_Flying) { theBot.pawn.airspeed = speed; } else if(theBot.Physics == PHYS_Swimming) { theBot.pawn.waterspeed = speed; } else { theBot.pawn.groundspeed = speed; } } accel = float(GetArgVal("Accel")); if(accel != 0.0) { theBot.pawn.AccelRate = accel; } target = GetArgVal("Target"); if(target == "") { ParseVector(v,"Location"); theBot.myDestination = v; theBot.RemoteDestination = none; theBot.GotoState('Startup', 'Move'); } else { SetPropertyText("tempActor",target); if( tempActor != none && theBot.FastTrace(tempActor.Location) && theBot.inFront(tempActor.Location) ) { //theBot.RemoteDestination = none; //zero out myDestination theBot.myDestination = tempActor.Location; theBot.GotoState('Startup', 'Move'); } } break; case "STRAFE": speed = float(GetArgVal("Speed")); if(speed != 0.0) { if(theBot.Pawn.Physics == PHYS_Flying) { theBot.pawn.airspeed = speed; } else if(theBot.Physics == PHYS_Swimming) { theBot.pawn.waterspeed = speed; } else { theBot.pawn.groundspeed = speed; } } accel = float(GetArgVal("Accel")); if(accel != 0.0) { theBot.pawn.AccelRate = accel; } ParseVector(v,"Location"); theBot.myDestination = v; focusTarg = GetArgVal("Target"); if(focusTarg == "") { ParseVector(v2,"Focus"); theBot.myFocus = v2; theBot.RemoteFocus = none; } else { SetPropertyText("tempActor",focusTarg); if( tempActor != none && theBot.FastTrace(tempActor.Location) && theBot.inFront(tempActor.Location) ) { theBot.RemoteFocus = tempActor; //zero out myFocus theBot.myFocus = v2; } } theBot.StopWaiting(); theBot.GotoState('Startup', 'Strafe'); break; case "SHOOT": target = GetArgVal("Target"); ParseVector(v,"Location"); theBot.SetPropertyText("Enemy",target); theBot.SetPropertyText("RemoteEnemy",target); theBot.StopWaiting(); theBot.myTarget = v; target = GetArgVal("Alt"); SetPropertyText("tempBool",target); theBot.RemoteFireWeapon(tempBool); break; case "CHANGEWEAPON": target = GetArgVal("ID"); if( target ~= "best" ) { theBot.SwitchToBestWeapon(); } else { SetPropertyText("tempActor",target); if(tempActor != none) { theBot.pawn.PendingWeapon = Weapon(tempActor); if ( theBot.pawn.Weapon == None ) theBot.ChangedWeapon(); else if ( theBot.pawn.Weapon != theBot.pawn.PendingWeapon ) theBot.pawn.Weapon.PutDown(); } } break; case "STOPSHOOT": theBot.StopWaiting(); theBot.HaltFiring(); break; case "CHECKREACH": target = GetArgVal("Target"); id = GetArgVal("id"); if(target == "") { ParseVector(v,"Location"); boolResult = theBot.pointReachable(v); sendLine("RCH" $ib$as$ "ID" $ib$ id $ae$ib$as$ "Reachable" $ib$ boolResult $ae$ib$as$ "From" $ib$ theBot.Location $ae); } else { SetPropertyText("tempActor",target); if( tempActor != none && theBot.FastTrace(tempActor.Location) && theBot.inFront(tempActor.Location) ) { boolResult = theBot.actorReachable(tempActor); sendLine("RCH" $ib$as$ "ID" $ib$ id $ae$ib$as$ "Reachable" $ib$ boolResult $ae$ib$as$ "From" $ib$ theBot.Location $ae$ib$as$ "To" $ib$ tempActor.Location $ae); } } break; case "TURNTO": target = GetArgVal("Target"); if(target == "") { ParseRot(r); if(r.Yaw == 0 && r.Pitch == 0 && r.Roll == 0) { //no target or rotation defined ParseVector(v,"Location"); theBot.myFocus = v; theBot.RemoteFocus = none; } else { //no target, yes rotation theBot.myRotation = r; theBot.FocalPoint = theBot.Pawn.Location + ( vector(r) * 1000); //theBot.myFocus = vect(0,0,0); theBot.RemoteFocus = none; } } else { //target defined SetPropertyText("tempActor",target); if( tempActor != none && theBot.FastTrace(tempActor.Location) && theBot.inFront(tempActor.Location) ) { theBot.RemoteFocus = tempActor; //zero out myFocus theBot.myFocus = v; } } if (GetArgVal("RotationRate")!="") { ParseRot(r2); theBot.myRotationRate = r2; } theBot.StopWaiting(); theBot.GotoState('Startup', 'Turning'); break; case "ROTATE": target = GetArgVal("Axis"); r = theBot.Pawn.Rotation; i = int(GetArgVal("Amount")); if(target == "Vertical") { r.Pitch = r.Pitch + i; } else { r.Yaw = r.Yaw + i; } if (GetArgVal("RotationRate")!="") { ParseRot(r2); theBot.myRotationRate = r2; } theBot.myRotation = r; theBot.myFocus = theBot.Pawn.Location + ( vector(r) * 1000 ); theBot.RemoteFocus = none; theBot.StopWaiting(); theBot.GotoState('Startup', 'Turning'); break; case "TRACK": target = GetArgVal("Target"); if(target != "") { SetPropertyText("tempActor",target); if( theBot.FastTrace(tempActor.Location) && theBot.inFront(tempActor.Location) ) { theBot.RemoteFocus = tempActor; theBot.StopWaiting(); theBot.GotoState('Startup', 'Tracking'); } } break; case "GETPATH": //clear the old path for ( i=0; i<16; i++ ) { if ( theBot.RouteCache[i] == None ) break; else { theBot.RouteCache[i] = None; } } ParseVector(v,"Location"); theBot.FindPathTo(v); id = GetArgVal("id"); outBuf = "PTH"$ib$as$"ID"$ib$id$ae; for ( i=0; i<16; i++ ) { if ( theBot.RouteCache[i] == None ) break; else { outBuf = outBuf$ib$as$i$ib$theBot.RouteCache[i]$ib$theBot.RouteCache[i].Location$ae; } } SendLine(outBuf); break; case "MESSAGE": //Note - currently only allow messages under 256 chars target = GetArgVal("Text"); boolResult = bool(GetArgVal("Global")); if(target != "") { // @ preceding message makes it global. dont ask. not my code /* if(boolResult) theBot.BroadcastLocalizedMessage("@"$target); else theBot.BroadcastLocalizedMessage(target); */ // FIXME } break; case "PING": SendLine("PONG"); break; } } //Send a line to the client function SendLine(string Text, optional bool bNoCRLF) { if(bDebug) log(" Sending: "$Text); if(bNoCRLF) SendText(Text); else SendText(Text$Chr(13)$Chr(10)); } //Concat two strings togeather with our list bookends function string MakeItem(string first, string second) { return (as$first$ib$second$ae); } //fire right up into the loop for sending updates auto state monitoring { Begin: WaitingForInit: sleep(0.1); goto 'WaitingForInit'; Running: if(bVision && Level.Pauser == None && theBot != none && !theBot.IsInState('GameEnded') && !theBot.IsInState('Dying')) { SendLine("BEG" $ib$as$ "Time" $ib$ Level.TimeSeconds $ae); //no clean way to do this since gametypes are not derived from //a common ancestor that has AddRemoteBot //switch(Parent.gameClass) //{ /* case "BotTeamGamePlus": sendLine( BotTeamGamePlus(Level.Game).GetGameStatus() ); break;*/ // case "BotDeathMatch": sendLine( BotDeathMatch(Level.Game).GetGameStatus() ); // break; /*case "BotDomination": sendLine( BotDomination(Level.Game).GetGameStatus() ); break; case "BotCTF": sendLine( BotCTF(Level.Game).GetGameStatus(theBot) ); break; */ //} theBot.checkSelf(); theBot.checkVision(); SendLine("END" $ib$as$ "Time" $ib$ Level.TimeSeconds $ae); } if (bIterative) Level.Pauser=theBot.playerReplicationInfo; sleep(visionTime); goto 'Running'; } \ Px#0n 1Rotation{1L~1nn,M~1n6P9D9L1M11M&M~1n6P9D9L1M6P9D9L1M&-6P9D9Lpitch6P9D9Lyaw6P9D9Lroll G^ R~\}!$i 0Rotation{0L~0ii,Q~0i6R9L0Q00Q&Q~0i6R9L0Q6R9L0Q&!6R9Lpitch6R9Lyaw6R9Lroll GY @@c X @Cd .i{.G~.dd,W~.d6X9L.W..W&W~.d6X9L.W6X9L.W&6X9Lx6X9Ly6X9Lz Gr@Iz4k6NAI -6MAI--6KAI-6JAI G] @@` PQ<kP 6NAP--6MAP--6KAP6JA GS j0-TNrJ{raD|rajrEr Gb \FDy3\I\6 6666666 6666666\\-d'-Z(v66%66%66%66%66%66%-]' GT ]Rd)]NameeTeam ALocationCEClassNamerze],]9Je->InitRecieved.- w]]ACE->w*added bot, now runningERROR ADDING BOTq!! Gd kSY 3k GP B*r -YpRecieved - B)p)BPz)&, ))&?~), ?~)??z)?&, ?))?2~9:9:$ ?~), a Gf AT_ +6A6A-K' G{G/ 0~{-{-{'G{wG*dGa/!va UG G GG' Gh }Ue/ #6}6} Gg O2'C-YOD~O >DD}O@OD6O~Ol%(l,  {6v~66&v&D~ lWDl^D&66&66~6lp@@$@ Gj |Ajw #6|6| Go l:xk+Mi+Kh+Ll?Aa/!-lAl@wA*.A mppppppppppppDIEkiKillerk9VlhkiDamageTypek9V@h Gl z@o 36z6z-L(-]( Gs ~,mN~a/!-K~a!!BOTRESTRTPLAYERH.~jRESTARTPLAYER~ Gn uVwG +6u6u-]( Gq@p tX} +6t6t-]( Gy q J{q+Mw+Kx+LypppppqwTimeLimitq9Sxy Gr q= c6q6o6n6q6o6n Gk QQKm, {mWA|mWQm^m Gm@|@t mZ c6m6i6h6m6i6h G{ w D~)|+Mu+Kt+LBGAMBpppB|uPlayerScoresFwF*F-BppppppB|u9VF|9UFtFFBpBtB GE M HKFH r*NewBot was none Jw*Already had pawn 9gj#as 9 9 a jRpPawnClass: 9V[r*pppCouldn't spawn player of type 9V at 9V9 pppSpawned player of type 9V at 9V99.9Oa.r*NewBot.Squad == NoneW''r_99g& q! !  Gx } eW QL-Z6q66q66q6'( G|  m<7-Z66q66q'( G~ a -Z' G@ ^ -Z( GA C d -Z GB TG$-d-T GD G sT -d GF V3`V6\_``?666`6_666` Gbu K$-YcomandType:KK VPAUSES-pa/! ~UNPAUSE{-p*  GH WIlbW6\Wbb?6aTOw*ZaOZ!! Z!  E~T }EE}TNTE7T~TJ%gJ,  {7a~7 O7&a&E~O JaOEJEOE&77&77~7JNN$N GV qy+(qx}% x}9:9:$-oVizServer: Too many connections - closing down Listen.n GP rBhDr6\LDD?apRecieved - J*p*JPz*&, **&=~*, =N*==z*=&, =**=2N9:9:$ =~*, a G^ v'%ppppv b G\ b N=66%66%66%66%66%66%61w6z6s&sja>wa63a>zaw3saDlBl$PTtpxB}^z] X^ eM$rkoVgCEgD SgP `q%l|QP _u#k| NL [T g ytem`P{@$K|oz }|#J_ mn&zP `k#lA#Od rB%P dNOpL iFK(P QT ]9OjKk yXxFu~UxLP DfEQz Vl$c N GEU5ZP OTC[zc^jYAh-Z)Gt"p<XRf jh$wcJ[v"e0vGH7"}j_i mT zIB'G5nQ"cKl Ev Ry_cmv#{v^yTKm bE;)oKIXr'fB55M%B"g~/Iu>x4vKn jKc>wKVnu~ c/Jp%z"_ 1A"rw Tzavou}cKH7#Y j| i J T Wp]#dC"Gg`&iCOD ]P jB5"vA""Xf:#z^]|kc yd&Eckv zdG!Kk,rv7hL2_!e#Q"z t!6A @wP w%P C '7PDTG_ [,W h3bJuMT3k S0P`H3nOla3j4iMKvj4D u%Oyj4wH ` ;P _ Gj4dl '2P DOB EsQ :P _ A8k L"c n#E @ah @_ v v2C C!u CzV  /pP PS@ j4]S MP p Kj4X;| WFT Rj4}Z r+W i#B  e s&q D W XHd j4P|l  %T|j4XP-j4FPh n $l@{Eg j4{u np ~c^ A RNcP ` zimV V Qjc _M Fml RAY S)Z*DC T9GG/~@ U3~2xq A3i-:s\ @?O-,xN V9FsP  X9L-JxE =R}^OuP myP z ZSG-DwZRk Q-Hy ^ eNW|P e mDq~P u a(A ^(i d(QP y G,ERl q s(}P e 3vqP gb t$KA I}L-wCI-/FLRi:R w_L8xSkP~ 2dL8y[p BcK8%MnP{8cjI8*Os .GB 1KI {iTP}aK *Cl'7o NdfPJ siX\AR<L] }iH hP u ?'AP h ^UtlL I aEU mZ BQGP XP dt q