Always snap to grid

Difference between revisions of "Legacy:ScriptedPawn"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m
m
Line 1: Line 1:
{{classbox| [[Legacy:UT|UT]] :: [[Legacy:Actor (UT)|Actor (UT)]] >> [[Legacy:Pawn (UT)|Pawn (UT)]] >> ScriptedPawn}}
+
{{classbox| [[Legacy:UT|UT]] :: [[Legacy:Actor (UT)|Actor (UT)]] >> [[Legacy:Pawn (UT)|Pawn (UT)]] >> ScriptedPawn (Package: UnrealShare)}}
  
 
'''''Note:''''' In UT200x, ScriptedPawn was replaced by a scheme using some other variety of [[Legacy:Pawn|Pawn]] in conjunction with a [[Legacy:ScriptedController|ScriptedController]], or a subclass thereof.
 
'''''Note:''''' In UT200x, ScriptedPawn was replaced by a scheme using some other variety of [[Legacy:Pawn|Pawn]] in conjunction with a [[Legacy:ScriptedController|ScriptedController]], or a subclass thereof.
Line 16: Line 16:
  
 
An [[Legacy:AlarmPoint|AlarmPoint]] is an actor that the Pawns react to when they are "startled" – or more simply put when they see the player/players.
 
An [[Legacy:AlarmPoint|AlarmPoint]] is an actor that the Pawns react to when they are "startled" – or more simply put when they see the player/players.
 +
 +
===AmbushPoint===
 +
 +
An [[Legacy:AmbushPoint|AmbushPoint]] defines a good place for the Pawn to wait for a player enemy to attack.
  
 
===PatrolPoint===
 
===PatrolPoint===
Line 23: Line 27:
 
===HomeBase===
 
===HomeBase===
  
This is a wonderful little actor. The Tag of this actor should be the same as the tag of the creatures who are to use it.
+
When a pawn is hurt or if its just really chicken it will seek its way to its [[Legacy:HomeBase|HomeBase]] (prefably this is a place out of the way or a place where the pawn can get backup). The Tag of the HomeBase should be the same as the tag of the creatures who are to use it.
 
+
When a pawn is hurt or if its just really chicken it will seek its way to its homebase (prefably this is a place out of the way or a place where the pawn can get backup). This litle actor holds the following propeties:
+
* Extent - Defines how big the homebase is
+
  
 
==Known Subclasses==
 
==Known Subclasses==
  
Many of these creatures also appear in the [[Legacy:Invasion|Invasion]] gametype in UT2004 as subclasses of [[Legacy:Monster|Monster]].
+
Many of these creatures also appear in the [[Legacy:Invasion|Invasion]] gametype in UT200x as subclasses of [[Legacy:Monster|Monster]].
* [[Legacy:Brute|Brute]] >>
+
ScriptedPawn
* [[Legacy:Cow|Cow]] >>
+
  +- [[Legacy:Amoeba|Amoeba]] (aka ParentBlob) >>
* [[Legacy:Devilfish|Devilfish]]
+
  +- [[Legacy:Brute|Brute]]
* [[Legacy:Fly|Fly]]
+
  |  +- Behemoth
* [[Legacy:Follower|Follower]] (ONP)
+
  |  +- LesserBrute
* [[Legacy:Gasbag|Gasbag]]
+
  +- [[Legacy:Cow|Cow]]
* [[Legacy:Krall|Krall]] >>
+
  |  +- BabyCow
* [[Legacy:Manta|Manta]]
+
  +- [[Legacy:Devilfish|Devilfish]]
* [[Legacy:Mercenary|Mercenary]] >>
+
  +- [[Legacy:Fly|Fly]] (aka Razorfly) >>
* [[Legacy:Nali|Nali]]
+
  +- [[Legacy:Follower|Follower]] (ONP)
* [[Legacy:Pupae|Pupae]]
+
  +- [[Legacy:Gasbag|Gasbag]]
* [[Legacy:Queen|Queen]]
+
  |  +- GiantGasbag
* [[Legacy:Skaarj|Skaarj]] >>
+
  +- [[Legacy:Krall|Krall]]
* [[Legacy:Squid|Squid]]
+
  |  +- EliteKrall
* [[Legacy:Slith|Slith]]
+
  |  +- LesserKrall
* [[Legacy:Tentacle|Tentacle]]
+
  +- [[Legacy:Manta|Manta]]
* [[Legacy:Titan|Titan]]
+
  |  +- GiantManta
* [[Legacy:WarLord|WarLord]]
+
  +- [[Legacy:Mercenary|Mercenary]]
 +
  |  +- MercenaryElite
 +
  +- [[Legacy:Nali|Nali]]
 +
  |  +- NaliPriest
 +
  +- [[Legacy:NaliRabbit|NaliRabbit]]
 +
  +- [[Legacy:Predator|Predator]] (aka PackHunter)
 +
  +- [[Legacy:Pupae|Pupae]] (aka SkaarjPupae)
 +
  +- [[Legacy:Queen|Queen]]
 +
  +- [[Legacy:Skaarj|Skaarj]]
 +
  |  +- [[Legacy:FireSkaarj|FireSkaarj]] (UT200x only)
 +
  |  +- [[Legacy:IceSkaarj|IceSkaarj]] (UT200x only)
 +
  |  +- SkaarjTrooper (UT only)
 +
  |  |  +- SkaarjGunner
 +
  |  |  +- SkaarjInfantry
 +
  |  |  +- SkaarjOfficer
 +
  |  |  +- SkaarjSniper
 +
  |  +- SkaarjWarrior (UT only)
 +
  |      +- [[Legacy:IceSkaarj|IceSkaarj]]
 +
  |      +- SkaarjAssassin
 +
  |      +- SkaarjBeserker
 +
  |      +- SkaarjLord
 +
  |      +- SkaarjScout
 +
  +- [[Legacy:Spinner|Spinner]]
 +
  +- [[Legacy:Squid|Squid]]
 +
  +- [[Legacy:Slith|Slith]]
 +
  +- [[Legacy:Tentacle|Tentacle]]
 +
  +- [[Legacy:Titan|Titan]]
 +
  |  +- StoneTitan
 +
  +- [[Legacy:WarLord|WarLord]]
  
 
==Properties==
 
==Properties==
Line 62: Line 91:
 
* ; ATTITUDE_Ignore : The pawn will ignore the player
 
* ; ATTITUDE_Ignore : The pawn will ignore the player
 
* ; ATTITUDE_Friendly : The pawn wont attack the player and, if possible, will fight the players enemies
 
* ; ATTITUDE_Friendly : The pawn wont attack the player and, if possible, will fight the players enemies
* ; ATTITUDE_Follow : Don't think this one works yet
+
* ; ATTITUDE_Follow : Not implemented
 +
* ; ATTITUDE_MAX : Not implemented
  
 
; bool bHateWhenTriggered : If set to true the pawn will start to hate the player when triggered
 
; bool bHateWhenTriggered : If set to true the pawn will start to hate the player when triggered
Line 76: Line 106:
  
 
===Orders===
 
===Orders===
; name AlarmTag : see AlarmPoints
+
; name AlarmTag : See [[Legacy:AlarmPoint|AlarmPoint]].
 
; bool bDelayedPatrol : If set to true the pawn must be triggerd before he starts his patrol. This is done by placeing a trigger and put the tag of the pawn in the event of the trigger.
 
; bool bDelayedPatrol : If set to true the pawn must be triggerd before he starts his patrol. This is done by placeing a trigger and put the tag of the pawn in the event of the trigger.
 
; bool bFixedStart : Used in conjunction with the Ambushing orders, to allow a pawn to optionally enter the level at an alternate location.
 
; bool bFixedStart : Used in conjunction with the Ambushing orders, to allow a pawn to optionally enter the level at an alternate location.
; Orders : According to the script comments, this sets the monster's initial state, and furthermore if the monster changes state it will try and return to the state set here. See the list of states further down this page for possible settings. (how does it react with the Object.InitialState setting? mystery! Why not use Object.InitialState? mystery! )  '''comment''' this is for abstraction reasons thus  allowing the coders to internally change the orders handling code without having to worry about incompatibilities whatsoever...
+
; Orders : According to the script comments, this sets the monster's initial state, and furthermore if the monster changes state it will try and return to the state set here. See the list of states further down this page for possible settings.
 
; name OrderTag : OrderTag defines the actor on which the order set in the "Orders" tab to be carried out
 
; name OrderTag : OrderTag defines the actor on which the order set in the "Orders" tab to be carried out
 
; name SharedAlarmTag : Multiple Pawns can use the same AlarmTags – set the tag of the alarmpoint in this tab
 
; name SharedAlarmTag : Multiple Pawns can use the same AlarmTags – set the tag of the alarmpoint in this tab
Line 95: Line 125:
 
==States==
 
==States==
  
Use these with the '''Orders''' property. ''(question: what happens if these are set with InitialState?)'' A pawn can have one of many different orders. Note that many of the subclasses of ScriptedPawn add new states, for example [[Legacy:WarLord|WarLord]]. See [[Legacy:State|state]] and [[Legacy:InitialState|InitialState]] for more information on states in coding and mapping.  
+
Set these with the '''Orders''' property. A pawn can have one of many different Orders. Note that many of the subclasses of ScriptedPawn add new states, for example [[Legacy:WarLord|WarLord]].
  
; Waiting : This is the default state (though it's not shown in the tab)
+
See also [[Legacy:ScriptedPawn/States|ScriptedPawn/States]] for a complete list of ScriptedPawn states.
; Patroling : This with the OrderTag set to a patrolpoint will let make the pawn (you guessed it) patrol
+
 
; Guarding : Guarding pawns will guard the actor whose tag is in their OrderTag. They won't go far from the actor they are guarding and they will try to get back to the actor after combat. If their attitude is ATTITUDE_Threatening they will try to make outbursts to scare the player to flee. They will try to remain between the player and the actor they guard. If the player touches the actor the pawn will attack.  
+
===Order States===
; Ambushing : The pawn is waiting on something to happen so they are more alert than regular. They may, according to Epics Unrealtech site, play different Idle-anims. If a Ambushpoint is placed whose tag matches the OrderTag of the pawn they may randomly spawn there. There can be multiple Ambushpoints for the same pawn.
+
 
 +
These states are typical Orders for mappers to set.
 +
; Waiting : This is the default state (though it's not shown in the tab).  The creature will stay near it's placed position and randomly wander nearby until an enemy is seen to attack.  After combat, the creature will return to this Waiting state and wander around randomly from that position.
 +
; Ambushing : The pawn is waiting for an enemy to attack so they are more alert than regular. They may, according to Epics Unrealtech site, play different Idle-anims.  If [[Legacy:AmbushPoint|AmbushPoint]]s are placed and their Tags match the OrderTag of the pawn, the creature will be teleported randomly to one of the AmbushPoints at match start if <tt>bFixedStart</tt> is false.  There can be multiple AmbushPoints for the same pawn.
 +
; Guarding : Guarding pawns will guard the actor whose Tag is set to match their OrderTag. They will remain at the placed position and return to that position after combat. If their attitude is ATTITUDE_Threatening they will try to make outbursts to scare the player to flee. They will try to remain between the player and the actor they guard. If the player touches the actor the pawn will attack.
 +
; Patroling : This with the OrderTag set to a [[Legacy:PatrolPoint|PatrolPoint]] will let make the pawn patrol. They will leave the patrol for combat and return to the patrol route afterwards.
  
 
==Custom ScriptedPawns==
 
==Custom ScriptedPawns==
Line 115: Line 150:
 
*** [[Legacy:Pawn (UT)/AI Functions|Pawn (UT)/AI Functions]]
 
*** [[Legacy:Pawn (UT)/AI Functions|Pawn (UT)/AI Functions]]
 
*** [[Legacy:AI Scripting Reference|AI Scripting Reference]]
 
*** [[Legacy:AI Scripting Reference|AI Scripting Reference]]
* [[Legacy:Monster|Monster]] (UT2004 only) &ndash; The parent class for Monster Pawns in UT2004
+
* [[Legacy:Monster|Monster]] (UT200x only) &ndash; The parent class for Monster Pawns in UT200x
* [[Legacy:MonsterController|MonsterController]] (UT2004 only) &ndash; The Controller class for Monsters in UT2004
+
* [[Legacy:MonsterController|MonsterController]] (UT200x only) &ndash; The Controller class for Monsters in UT200x
  
 
==Discussion==
 
==Discussion==
Line 124: Line 159:
 
'''Erdrik:''' (contributed to functions) Just setting up, I'll Return with info on Coding custom attributes, ect for new ScriptedPawns.  Going from memory right now, when I return I'll have a more orginized setup ;)
 
'''Erdrik:''' (contributed to functions) Just setting up, I'll Return with info on Coding custom attributes, ect for new ScriptedPawns.  Going from memory right now, when I return I'll have a more orginized setup ;)
  
'''SuperApe:''' Marked up, minor edits.
+
'''Unknown:''' Question: what happens if (Orders) are set with InitialState?
 +
 
 +
'''Unknown:''' This is for abstraction reasons thus  allowing the coders to internally change the orders handling code without having to worry about incompatibilities whatsoever...
 +
 
 +
'''SuperApe:''' It appears that all the ScriptedPawn states are hidden.  You should not be able to see them in InitialState.  Also, it's important for ScriptedPawn to first go through it's (auto) StartUp state so that basic things like Homebase, AlarmPoint, OrderObject, etc. can be set properly.
 +
 
 +
'''SuperApe:''' Marked up, minor edits.  
  
 
----
 
----

Revision as of 20:50, 9 February 2007

UT :: Actor (UT) >> Pawn (UT) >> ScriptedPawn (Package: UnrealShare)

Note: In UT200x, ScriptedPawn was replaced by a scheme using some other variety of Pawn in conjunction with a ScriptedController, or a subclass thereof.

This class is the abstract base class for UT's NPC "Monsters" (Skaarj, Nali, etc.) Some monsters are treated as a group, for example the BiterFish; these are subclassed from FlockPawn and controlled with a subclass of FlockMasterPawn.

As anyone who has played Unreal I knows, extremely complex behaviour is possible with monsters: they can patrol an area by default, and perform a specific action (such as running to push an alarm button) when they see the player.

This behaviour is set using several other actors that work with ScriptedPawn subclasses.

Related Actors

The main actors you should use when scripting a pawn are the AlarmTag, Patrolpoint and homebase and of course some options in the pawns preferences under the AI and Order property sections. (Please take note that for any of these actors to work you need to pathnode the level first.)

AlarmPoint

An AlarmPoint is an actor that the Pawns react to when they are "startled" – or more simply put when they see the player/players.

AmbushPoint

An AmbushPoint defines a good place for the Pawn to wait for a player enemy to attack.

PatrolPoint

A PatrolPoint is helpful when you need to make your pawns walk about in an area without looking too alarmed. That helps the pawns to look more life like (They just dont stand around and wait for the player). Look at the "Order-Tab" section below to see how you set the pawn to do this.

HomeBase

When a pawn is hurt or if its just really chicken it will seek its way to its HomeBase (prefably this is a place out of the way or a place where the pawn can get backup). The Tag of the HomeBase should be the same as the tag of the creatures who are to use it.

Known Subclasses

Many of these creatures also appear in the Invasion gametype in UT200x as subclasses of Monster.

ScriptedPawn
  +- Amoeba (aka ParentBlob) >>
  +- Brute
  |   +- Behemoth
  |   +- LesserBrute
  +- Cow
  |   +- BabyCow
  +- Devilfish
  +- Fly (aka Razorfly) >>
  +- Follower (ONP)
  +- Gasbag
  |   +- GiantGasbag
  +- Krall
  |   +- EliteKrall
  |   +- LesserKrall
  +- Manta
  |   +- GiantManta
  +- Mercenary
  |   +- MercenaryElite
  +- Nali
  |   +- NaliPriest
  +- NaliRabbit
  +- Predator (aka PackHunter)
  +- Pupae (aka SkaarjPupae)
  +- Queen
  +- Skaarj
  |   +- FireSkaarj (UT200x only)
  |   +- IceSkaarj (UT200x only)
  |   +- SkaarjTrooper (UT only)
  |   |   +- SkaarjGunner
  |   |   +- SkaarjInfantry
  |   |   +- SkaarjOfficer
  |   |   +- SkaarjSniper
  |   +- SkaarjWarrior (UT only)
  |       +- IceSkaarj
  |       +- SkaarjAssassin
  |       +- SkaarjBeserker
  |       +- SkaarjLord
  |       +- SkaarjScout
  +- Spinner
  +- Squid
  +- Slith
  +- Tentacle
  +- Titan
  |   +- StoneTitan
  +- WarLord

Properties

Some of the property groups are defined in the Pawn (UT) class and then receive extra properties in ScriptedPawn. In the interest of clarity, this page lists all the properties from the groups. We'll copy the relevant ones across to Pawn (UT) later...

AI

AttitudeToPlayer 
Determines the current behavior
  •  ; ATTITUDE_Fear : The pawn will try to make a run for it when it sees the player
  •  ; ATTITUDE_Hate : The pawn will attack the player
  •  ; ATTITUDE_Frenzy : The pawn acts a bit less concentrated with less accuracy. The pawn will fight to the end and never flees
  •  ; ATTITUDE_Threaten : The pawn will make hostile motions but will wait for the player to initiate combat.
  •  ; ATTITUDE_Ignore : The pawn will ignore the player
  •  ; ATTITUDE_Friendly : The pawn wont attack the player and, if possible, will fight the players enemies
  •  ; ATTITUDE_Follow : Not implemented
  •  ; ATTITUDE_MAX : Not implemented
bool bHateWhenTriggered 
If set to true the pawn will start to hate the player when triggered
bool bIgnoreFriends 
If set to true the pawn will disregard rank of its team and hunt after the player in their solditude
bool bIsBoss 
Looking quickly at the script, it appears this gives the monster extra health & other things too...
bool bQuiet 
The pawn will play no sounds (good for surprise attacks)
bool bTeamLeader 
If part of a team (more on that later) and this tab is set to true the actor will resume command over the rest of the pawns who holds the same TeamTag as this one
HearingThreshold 
I never messed around with this one
float PheriperalVision 
Inverse Cosine of this number determines how far to each side the pawn can see things. So, -1.0 means that it can even see something directly behind it.
SightRadius 
Defines how far the pawn can see
Skill 
Defines how good the pawn is at fighting. This stretches from their aim to the way and speed they move at. The higher number the better the pawn is.
name TeamTag 
see bTeamLeader

Orders

name AlarmTag 
See AlarmPoint.
bool bDelayedPatrol 
If set to true the pawn must be triggerd before he starts his patrol. This is done by placeing a trigger and put the tag of the pawn in the event of the trigger.
bool bFixedStart 
Used in conjunction with the Ambushing orders, to allow a pawn to optionally enter the level at an alternate location.
Orders 
According to the script comments, this sets the monster's initial state, and furthermore if the monster changes state it will try and return to the state set here. See the list of states further down this page for possible settings.
name OrderTag 
OrderTag defines the actor on which the order set in the "Orders" tab to be carried out
name SharedAlarmTag 
Multiple Pawns can use the same AlarmTags – set the tag of the alarmpoint in this tab

Functions

(incomplete)

SetEnemy() 
AttitudeTowards() 

CustomFollow Functions

CustomMade Attacks

States

Set these with the Orders property. A pawn can have one of many different Orders. Note that many of the subclasses of ScriptedPawn add new states, for example WarLord.

See also ScriptedPawn/States for a complete list of ScriptedPawn states.

Order States

These states are typical Orders for mappers to set.

Waiting 
This is the default state (though it's not shown in the tab). The creature will stay near it's placed position and randomly wander nearby until an enemy is seen to attack. After combat, the creature will return to this Waiting state and wander around randomly from that position.
Ambushing 
The pawn is waiting for an enemy to attack so they are more alert than regular. They may, according to Epics Unrealtech site, play different Idle-anims. If AmbushPoints are placed and their Tags match the OrderTag of the pawn, the creature will be teleported randomly to one of the AmbushPoints at match start if bFixedStart is false. There can be multiple AmbushPoints for the same pawn.
Guarding 
Guarding pawns will guard the actor whose Tag is set to match their OrderTag. They will remain at the placed position and return to that position after combat. If their attitude is ATTITUDE_Threatening they will try to make outbursts to scare the player to flee. They will try to remain between the player and the actor they guard. If the player touches the actor the pawn will attack.
Patroling 
This with the OrderTag set to a PatrolPoint will let make the pawn patrol. They will leave the patrol for combat and return to the patrol route afterwards.

Custom ScriptedPawns

Add your own .u files or how to make origional pawns into new ones here

Tutorials

Related Topics

Discussion

Icedude: (author)

Erdrik: (contributed to functions) Just setting up, I'll Return with info on Coding custom attributes, ect for new ScriptedPawns. Going from memory right now, when I return I'll have a more orginized setup ;)

Unknown: Question: what happens if (Orders) are set with InitialState?

Unknown: This is for abstraction reasons thus allowing the coders to internally change the orders handling code without having to worry about incompatibilities whatsoever...

SuperApe: It appears that all the ScriptedPawn states are hidden. You should not be able to see them in InitialState. Also, it's important for ScriptedPawn to first go through it's (auto) StartUp state so that basic things like Homebase, AlarmPoint, OrderObject, etc. can be set properly.

SuperApe: Marked up, minor edits.


Category:Legacy Class (UT)

Category:Legacy To Do – Fill in most important functions with brief descriptions. Fill in remaining property variable types. Fill in package name.