Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //From my Amnesia Rebirth Tutorial Series
- //Episode 13 Enemies Pt.3! Patrolling!
- //https://www.youtube.com/playlist?list=PL4KkjlmOwLwwMVqedCNpi6caUxhgyf8Qr
- //-----------------------------------------------------------
- /////////////////////////////////////////////
- //Patrolling using the Patrol Mode functions
- /////////////////////////////////////////////
- //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.
- //Setups the ghoul's patrol mode
- Ghoul_ModePatrol_Setup("ghoul_hallway", false, eGhoulSpeed_Walk);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //randomNodes (bool)- whether or not the ghoul should it's added patrol nodes at random. If false it will patrol the nodes in the order the nodes were added.
- //ghoulSpeed (eGhoulSpeed)- the speed at which the ghould should patrol the added path nodes.
- //Sets the mode that the ghoul should operate in
- Ghoul_Mode_Set("ghoul_hallway", eGhoulMode_Patrol, false);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulMode (eGhoulMode)- the mode we want the ghoul to be in eGhoulMode_Patrol for a patrolling ghoul.
- //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
- //Adds a node that the ghoul should patrol to
- Ghoul_ModePatrol_AddNode("ghoul_hallway", "PathNode_14", 0, -1, "", false);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //pathNodeName (String)- name of path node as it appears in your level editor.
- //minWaitTime (float)- the minimum amount of time a ghoul should wait at each node.
- //maxWaitTime (float)- the maximum amount of time a ghoul should wait at each node. (-1 for instant).
- //animationName (String)- name of animation that the ghoul should play after reaching the point.
- //loopAnimation (bool)- whether the animation should loop.
- Ghoul_ModePatrol_AddNode("ghoul_hallway", "PathNode_1", 0, -1, "", false);
- //Change speed of a patrolling ghoul
- Ghoul_ModePatrol_SetSpeed("ghoul_hallway", eGhoulSpeed_FastWalk);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //ghoulSpeed (eGhoulSpeed)- the speed at which the ghould should patrol the added path nodes.
- //Clear any nodes that have been added to the ghouls patrol memory
- Ghoul_ModePatrol_ClearNodes("ghoul_hallway");
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- ///////////////////////////////////////////////
- //Patrolling using the Command Patrol functions
- ///////////////////////////////////////////////
- //Adds a node that the ghoul should patrol to
- Ghoul_CommandPatrol_AddNode("ghoul_hallway", "PathNode_14", 0, -1, "", false);
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //pathNodeName (String)- name of path node as it appears in your level editor.
- //minWaitTime (float)- the minimum amount of time a ghoul should wait at each node.
- //maxWaitTime (float)- the maximum amount of time a ghoul should wait at each node. (-1 for instant).
- //animationName (String)- name of animation that the ghoul should play after reaching the point.
- //loopAnimation (bool)- whether the animation should loop.
- //Command the ghoul to start protrolling with certain values
- Ghoul_CommandPatrol_Execute("ghoul_hallway", false, 1, false, eGhoulSpeed_Walk, "OnPatrolFinish_GhoulHallway");
- //ghoulName (String)- name of ghoul as it appears in your level editor.
- //forceModeChange (bool)- should the ghoul immediately switch into the new state or should he do it at the next best opportunity.
- //#ofLoops (int)- number of times the ghould should patrol the added nodes.
- //randomNodes (bool)- whether or not the ghoul should it's added patrol nodes at random. If false it will patrol the nodes in the order the nodes were added.
- //ghoulSpeed (eGhoulSpeed)- the speed at which the ghould should patrol the added path nodes.
- //completedCallbackName (String)- the name of the function that should be called when the ghoul finishes patrolling the number of times you specified.
- //Syntax for the completed callback
- void OnPatrolFinish_GhoulHallway(const tString &in asEntity){
- cLux_AddDebugMessage("Patrol finished");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement