Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 12 Enemies Pt.2! Agent Functions!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- //Force an agent to look at an entity instantly
- Agent_FaceEntity("ghoul_hallway", "player");
- //agentName (String)- name of agent(an enemy for example).
- //entityName (String)- name of entity as it appears in your level editor.
- //Checks to see if the player was detected
- Agent_PlayerDetected("ghoul_hallway");
- //agentName (String)- name of agent(an enemy for example).
- //Resets the detection state, agent will no longer know where the player is
- Agent_ResetPlayerDetectionState("ghoul_hallway");
- //agentName (String)- name of agent(an enemy for example).
- //Reveals the player position to the agent
- Agent_RevealPlayerPosition("ghoul_hallway", false);
- //agentName (String)- name of agent(an enemy for example).
- //forceRedetect (bool)- should the agent redetect if player is already detected (will replay detection cutscenes).
- //Will disable agent when outside of the specified range
- Agent_SetAutoDisableWhenOutOfSightActive("ghoul_hallway", true, 15.0f);
- //agentName (String)- name of agent(an enemy for example).
- //autoDisableActive (bool)- should auto disable be activated(true or false).
- //distance (float)- what distance should trigger the auto disable.
- //Will prevent the agent from being able to see
- Agent_SetBlinded("ghoul_hallway", true, 5.0f);
- //agentName (String)- name of agent(an enemy for example).
- //blindActive (bool)- should the agent be blinded (true or false.
- //timeBlinded (float)- the amount of time this effect should last.
- //Will prevent the agent from being able to hear
- Agent_SetDeafened("ghoul_hallway", true, 5.0f);
- //agentName (String)- name of agent(an enemy for example).
- //blindActive (bool)- should the agent be deafened (true or false).
- //timeDeafened (float)- the amount of time this effect should last, if <0 this effect is infinite until disabled.
- //Will disable the agents senses meaning he will ignore the player entirely
- Agent_SetSensesActive("ghoul_hallway", false);
- //agentName (String)- name of agent(an enemy for example).
- //enabled (bool)- whether or not this effect should be enabled.
- //If Agent_SetAutoDisableWhenOutOfSightActive is enabled this will set the function to run
- Agent_SetAutoDisableCallback("ghoul_hallway", "OnDespawn_GhoulHallway");
- //agentName (String)- name of agent(an enemy for example).
- //functionName (String)- name of the function you want to be called.
- //Syntax for AutoDisableCallback
- void OnDespawn_GhoulHallway(const tString &in asEntity){
- cLux_AddDebugMessage("Ghoul despawned");
- }
- //Performs a callback when ghoul enters or exits radius of player
- Agent_SetDistanceCallback("ghoul_hallway", "OnDistance_Player_GhoulHallway", 15.0f);
- //agentName (String)- name of agent(an enemy for example).
- //functionName (String)- name of the function you want to be called.
- //distance (float)- what distance the callback should occur.
- //Syntax for DistanceCallback
- void OnDistance_Player_GhoulHallway(int alState){
- if(alState == 1){
- //Agent entered range
- cLux_AddDebugMessage("Ghoul entered range");
- }else{
- //Agent left range
- cLux_AddDebugMessage("Ghoul left range");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement