Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Callback when enemy changes to inactive
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
RE: Callback when enemy changes to inactive

Clever! I would suggest making that into its own function alone, something like

PHP Code: (Select All)
bool GetEnemyActive(string &in asEnemyName) {
    if(
GetEnemyStateName(asEnemyName) != "Hunt" 
    
&& GetEnemyStateName(asEnemyName) != "Search" 
    
&& GetEnemyStateName(asEnemyName) != "Patrol"
    
&& GetEnemyStateName(asEnemyName) != "Wait" 
    
&& GetEnemyStateName(asEnemyName) != "Alert" 
    
&& GetEnemyStateName(asEnemyName) != "Investigate"
    
&& GetEnemyStateName(asEnemyName) != "Track" 
    
&& GetEnemyStateName(asEnemyName) != "BreakDoor")
        return 
true;
    return 
false;


Then you could just do

PHP Code: (Select All)
void doStuff(string &in asTimer) {
    if(
GetEnemyActive("enemy")) {
        
//do stuff
    
}


(This post was last modified: 11-17-2017, 09:05 PM by Mudbill.)
11-17-2017, 09:05 PM
Find


Messages In This Thread
RE: Callback when enemy changes to inactive - by Mudbill - 11-17-2017, 09:05 PM



Users browsing this thread: 2 Guest(s)