Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 00033 00034 00035 00036 00037 00038 00039 00040 00041 00042 00043 00044 00045 00046 00047 00048 00049 00050 00051 00052 00053 00054 00055 00056 00057 00058 00059 00060 00061 00062 00063 |
//===================================================================== // AI_TestCharacterB // Test Class for Actions - sensors test //===================================================================== class AI_TestCharacterB extends AI_CharacterAction editinlinenew; //===================================================================== // Variables var AI_Sensor sensor1; var int goalsAchievedN; // counts how many goalAchievedCB's were received //===================================================================== // Functions function onSensorMessage( AI_Sensor sensor, AI_SensorData value, Object userData ) { log( self.name @ "sensorMessage called by" @ sensor.name @ "with value" @ value.integerData ); } function goalAchievedCB( AI_Goal goal, AI_Action action ) { super.goalAchievedCB( goal, action ); goalsAchievedN++; log( self.name @ "goalAchievedCB called for" @ goal.name @ "by" @ action.name ); } //===================================================================== // State code state Running { Begin: log( self.name @ "started. Spawning a sensor." ); sensor1 = class'AI_Sensor'.static.activateSensor( self, class'AI_TestSensorA', resource, 0, 50, ); Sleep(5.0); log( self.name @ "is deactivating the sensor" ); sensor1.deactivateSensor( self ); sensor1 = None; Sleep(2.0); log( self.name @ "is spawning an inactive goal" ); WaitForGoal( (new class'AI_TestInactiveAchievableGoal'( movementResource(), 99 )).postGoal( self ) ); log( self.name @ "will terminate now." ); if ( sensor1.queryIntegerValue() == 53 ) succeed(); else fail( ACT_ErrorCodes.ACT_GENERAL_FAILURE ); } //===================================================================== defaultproperties { satisfiesGoal = class'AI_TestCharacterGoalB' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |