Once I get that upgrade to 36-hour days, I will tackle that. – Mychaeel

Difference between revisions of "User:Crusha/UltimateMappingTools/UltimateONSFactory"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
(Moved to sub page)
 
(First revision of page. Checked for correctness.)
Line 1: Line 1:
 +
=UltimateONSFactory=
 
by Crusha K. Rool, thanks to iwanpompier for help at getting the radar to work.
 
by Crusha K. Rool, thanks to iwanpompier for help at getting the radar to work.
 
{{infobox class
 
{{infobox class
| class   = UltimateONSFactory
+
| class = UltimateONSFactory
 +
| game = UT2004
 +
| engine = UE2
 +
| package = UltimateMappingTools
 
| parent1 = ONSVehicleFactory
 
| parent1 = ONSVehicleFactory
 
| parent2 = SVehicleFactory
 
| parent2 = SVehicleFactory
 
| parent3 = Actor
 
| parent3 = Actor
 
| parent4 = Object
 
| parent4 = Object
| game    = UT2004
+
| custom = yes
| engine  = UE2
+
| custom = yes
+
 
}}
 
}}
  
An ONS-mapper's jack of all trades device. This allows the mapper to tweak the vehicle balance of the match right down to the last detail.
+
An ONS-mapper's jack of all trades device. This allows the mapper to tweak the vehicle balance of the match right down to the last detail. Allows to specify an individual vehicle list for both teams from which the next vehicle can be chosen randomly or sequentially. Each individual vehicle entry in a list can be further modified, also with the ability to track the vehicle on the RadarMap.
Allows to specify an individual vehicle list for both teams from which the next vehicle can be chosen randomly.
+
Each individual vehicle entry in a list can be further modified, also with the ability to track the vehicle on the RadarMap.
+
 
+
 
+
==Variables==
+
  
 +
==Properties==
 
===Property group 'Events'===
 
===Property group 'Events'===
====Tag====
 
'''Type:''' [[name]]
 
 
Triggering the factory will enable it, i.e. set '''bEnabled''' to True.
 
 
UnTriggering it will disable it, i.e. setting it to False.
 
 
====Event====
 
'''Type:''' [[name]]
 
 
The default event is triggered whenever a vehicle is spawned by this factory.
 
 
 
====PreSpawnEvent====
 
====PreSpawnEvent====
 
'''Type:''' [[name]]
 
'''Type:''' [[name]]
  
This is triggered before the vehicle spawns, when the '''SpawnBuildEffect''' is played. (see '''PreSpawnTime''')
+
Event to trigger before spawn. Not activated when the vehicle was trigger-spawned.
 
+
====VehicleDestroyedEvent====
+
'''Type:''' [[name]]
+
 
+
Triggered whenever a vehicle that was spawned by this factory gets destroyed.
+
 
+
  
 
===Property group 'ONSVehicleFactory'===
 
===Property group 'ONSVehicleFactory'===
Line 46: Line 26:
 
'''Type:''' [[int]]
 
'''Type:''' [[int]]
  
If bReverseBlueTeamDirection, the vehicle will not turn by 180° for the blue team, but by this value. Negative values will rotate in the opposite direction.
+
If bReverseBlueTeamDirection, the Vehicle will not turn by 180 degrees but by this value.
  
 
8192 = 45°; 16384 = 90°; 32768 = 180°; etc..
 
8192 = 45°; 16384 = 90°; 32768 = 180°; etc..
 +
Negative values will rotate in the opposite direction.
  
 
+
===Property group 'UltimateONSFactory'===
===Property group 'UltimateVehicleFactory'===
+
====bCrushable====
====bUseStaticTeams====
+
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
The factory will not belong to the team that controls the closest team, but to the predefined team. If the other team holds the node, then this factory won't spawn any vehicles for that team.
+
Allow spawning over colliding actors.
  
====StaticTeamNum====
+
====bEnabled====
'''Type:''' [[byte]]
+
'''Type:''' [[bool]]
  
The factory will only work for this team.
+
Factory is triggered "on" at the beginning.
  
0= red, 1= blue, 255= neutral/none
+
'''Default value:''' True
  
 
====bIndependentFactory====
 
====bIndependentFactory====
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
The closest PowerNode or Core has no influence on this factory's activity or teamnumber. It will spawn the vehicles right away, even if the closest Node is disabled. The teamnumber of the vehicle will be the StaticTeamNum. Neutral vehicles are possible too.
+
PowerNode has no influence on the factory's activity or team number.
 
+
This property overrides bUseStaticTeams.
+
  
 
====bRandomFlip====
 
====bRandomFlip====
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
If the spawned vehicle is neutral (because of bIndependentFactory), then there is a 50:50 chance that the spawned vehicle uses the BlueTeamRotation.
+
Neutral vehicles may face in BlueTeamRotation.
  
====NotLockedForTeam====
+
====bTriggeredSpawn====
'''Type:''' [[byte]]
+
'''Type:''' [[bool]]
  
The spawned vehicle is ALWAYS locked for the team that is NOT entered here. This is mainly a hack for AS_MinigunTurrets, use this with them to keep them closed.
+
If True, this factory will immediately spawn a vehicle when being triggered.
  
255 is normal ONS, 0 will always lock this for Blue, 1 always for Red
+
If False, triggering will enable the factory and untriggering will disable it.
  
'''Default value:''' 255
+
====bUniqueVehicle====
 
+
====bEnabled====
+
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
Whether the factory is enabled at the beginning or not.
+
Factory spawns only a limited number of vehicles, there will be no second one when they are destroyed.
 +
MaxVehicleCount determines the number of vehicles that can be spawned.
  
====bToggleTrigger====
+
====bUseStaticTeams====
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
Instead of the Trigger/UnTrigger-functionality will this only react to TriggerEvents, which will toggle the factory between enabled and disabled.
+
Factory works only for one team.
  
====bUniqueVehicle====
+
====NotLockedForTeam====
'''Type:''' [[bool]]
+
'''Type:''' [[byte]]
  
The factory spawns only a limited number of vehicles, then it stops working for the rest of the round. The number of vehicles that can be spawned can be set via '''MaxVehicleCount'''.
+
This will always lock the Vehicles for the TeamNum that is NOT entered here.
 +
255 is normal ONS, 0 will always lock this for Blue, 1 always for Red.
 +
 
 +
(Hack for Minigun turrets - it makes pretty much only sense to use this with them at the team's Core)
 +
 
 +
'''Default value:''' 255
  
 
====PreSpawnTime====
 
====PreSpawnTime====
 
'''Type:''' [[float]]
 
'''Type:''' [[float]]
  
How many seconds before the vehicle spawn the SpawnBuildEffect and PreSpawnEvent is triggered.
+
Time before spawn to trigger PrepSpawn-Event and -Effect.
  
 
'''Default value:''' 2.0
 
'''Default value:''' 2.0
 
====bCrushable====
 
'''Type:''' [[bool]]
 
 
Allows spawning over colliding actors. Means any player that is in the collision radius of the vehicle when the ''RespawnTime'' is over will be crushed.
 
  
 
====RetrySpawnTime====
 
====RetrySpawnTime====
 
'''Type:''' [[float]]
 
'''Type:''' [[float]]
  
If not bCrushable and the spawn location is blocked, then try to spawn again after this many seconds.  
+
Interval to wait if spawn area is blocked.
  
 
'''Default value:''' 1.0
 
'''Default value:''' 1.0
  
====LinksetupException====
+
====StaticTeamNum====
'''Type:''' [[array]]<[[String]]>
+
'''Type:''' [[byte]]
  
Enter the name of a [[UE2:ONSPowerLinkOfficialSetup (UT2004)|Linksetup]] to disable this factory when that Linksetup is active. Leave this array empty to enable the factory for all Linksetups.
+
0= red, 1= blue, 255= neutral / none
 +
 
 +
TeamNums are switched automatically on Reset, if necessary. This is primarily used in combination with bIndependentFactory.
 +
 
 +
====VehicleListBlue====
 +
'''Type:''' [[array]]<{{tl|SpawnedVehicleProperties}}>
 +
 
 +
List for random vehicle spawn if blue has the factory
  
 
====VehicleListRed====
 
====VehicleListRed====
'''Type:''' [[array]]<'''SpawnedVehicleProperties'''>
+
'''Type:''' [[array]]<{{tl|SpawnedVehicleProperties}}>
  
List of vehicles that are available for spawn if the red team has the factory or it's a neutral independent factory.
+
List for random vehicle spawn if red or neutral has the factory
  
====VehicleListBlue====
+
====VehicleSelectionType====
'''Type:''' [[array]]<'''SpawnedVehicleProperties'''>
+
'''Type:''' {{tl|EVehicleSelectionType}}
  
List of vehicles that are available for spawn if the blue team has the factory.
+
Which method should be used to select the vehicle for spawning.
  
 +
===Internal variables===
 +
====bInitiallyEnabled====
 +
'''Type:''' [[bool]]
  
===Struct 'SpawnedVehicleProperties'===
+
Needed for Reset().
====Vehicle====
+
'''Type:''' [[class]]<[[UE2:Vehicle (UT2004)|Vehicle]]>
+
  
The class of the vehicle to spawn.
+
====RadarRI====
 +
'''Type:''' {{cl|UltimateONSRadarHUDRI}}
  
====SpawnEffectSize====
+
Takes care of spawning the HUDOverlay on the client.
'''Type:''' [[enum]]<'''ESpawnSize'''>
+
  
Size of the SpawnEffect to use with this vehicle.
+
====RandomArrayNumber====
 +
'''Type:''' [[int]]
  
====Health====
+
For accessing the properties of the individual vehicle
 +
 
 +
====SequentialArrayNumberRed====
 
'''Type:''' [[int]]
 
'''Type:''' [[int]]
  
Health value that the spawned vehicle should have. 0 uses the vehicle's default health.
+
Same, but in a sequential order.
  
====bEjectDriver====
+
====SequentialArrayNumberBlue====
'''Type:''' [[bool]]
+
'''Type:''' [[int]]
  
Eject the driver when the vehicle gets destroyed instead of killing him.
+
Need seperate ones for Red and Blue.
  
====bSpawnProtected====
+
===Default values===
'''Type:''' [[bool]]
+
{| class="list defaults"
 +
! Property
 +
! Value
 +
|-
 +
| [[UE2:Actor properties (UT2004)#DrawType|DrawType]]
 +
| [[UE2:Actor enums (UT2004)#EDrawType|DT_Sprite]]
 +
|}
 +
 
 +
==Enums==
 +
====ESpawnSize====
 +
The size of the spawneffect particle ring around the vehicle to use.
 +
;SIZE_None :
 +
;SIZE_Scorpion :
 +
;SIZE_Manta :
 +
;SIZE_Raptor :
 +
;SIZE_Hellbender :
 +
;SIZE_Goliath :
 +
;SIZE_Leviathan :
 +
 
 +
====EVehicleSelectionType====
 +
Which method should be used to select the vehicle for spawning.
 +
; VST_Random : Random from list, equal chances for everyone.
 +
; VST_Probability : Use Probability values of the vehicle, so some vehicles are more likely than others.
 +
; VST_Sequential : Always select the next entry from the list when spawning a new vehicle.
 +
; VST_OnceRandom : Random as above, just that the choice will be used for the whole match.
 +
; VST_OnceProbability : Use Probablity as above, just that the choice will be used for the whole match.
 +
 
 +
==Structs==
 +
===SpawnedVehicleProperties===
 +
A load of customization and you need to do it for every entry in the list and for red and blue separately. But it pays out.
 +
; [[class]]<[[UE2:Vehicle (UT2004)|Vehicle]]> Vehicle : The vehicle that is spawned with this entry.
 +
; [[int]] Health : Give the spawned Vehicle a custom Health value. 0 will use the Vehicle's default.
 +
; [[float]] SpawnProbability : Used with bUseSpawnProbability. You can enter whatever you like, just the relative difference between the entries counts.
 +
; [[name]] VehicleSpawnedEvent : Tag to be triggered upon spawning of this particular vehicle (additionally to the one of the factory itself). The vehicle will be the instigator.
 +
; [[name]] VehicleDestroyedEvent : Tag to be triggered upon destruction of the vehicle. Vehicle must be a subclass of ONSVehicle for this to happen.
 +
; {{tl|ESpawnSize}} SpawnEffectSize : The size of the spawneffect around the vehicle to use.
 +
; [[bool]] bEjectDriver : Eject driver when vehicle gets destroyed instead of killing him.
 +
; [[bool]] bEnterringDoesNotUnlock : Vehicle is not unlocked when a player enters it.
 +
; [[float]] SpawnProtectionTime : The vehicle is shielded from any damage for this many seconds after spawn (spawn protection is lift immediately when a driver enters). 0 disables this, -1 means the vehicle is protected until someone enters it.
 +
; [[bool]] bChangeMaxDesireability : If True, use a custom MaxDesirability value to tell bots if they should use the vehicle or not.
 +
; [[float]] MaxDesireability : Default values are: Scorpion - 0.4; Hellbender - 0.5; Raptor, Cicada, Manta, SPMA, Paladin - 0.6; Goliath, Ion Tank - 0.8; Leviathan - 2.0. Go figure what matches your vehicle best.
 +
; [[bool]] bTrackVehicleOnRadar : The vehicle's location will be shown in realtime on the RadarMap.
 +
; [[bool]] bRadarVisibleToDriver : Should the vehicle be shown on the radar to it's driver? Only useful if you have a large delay between the updates and want to estimate where your team sees you on the radar.
 +
; [[bool]] bRadarNeutralWhenEmpty : If true, the vehicle is drawn with white team color when it's left.
 +
; [[bool]] bRadarHideWhenEmpty : If true, the vehicle is not drawn when it's empty.
 +
; {{tl|ERadarVehicleVisibility|UltimateRadarVehicleLRI}} RadarVehicleVisibility : Here you set to which players the vehicle is shown on the RadarMap.
 +
; [[float]] RadarOwnerUpdateTime : How many seconds have to pass before the location of vehicle is updated for the owning team.
 +
; [[float]] RadarEnemyUpdateTime : Same as above, just for enemies.
 +
; [[bool]] bRadarFadeWithOwnerUpdateTime : If True, the icon on the radar map will interpolate between opaque and translucent as time passes between location updates on the radar.
 +
; [[bool]] bRadarFadeWithEnemyUpdateTime : If False, the icon will always stay fully opaque.
 +
; [[UE2:Material (UT2004)|Material]] RadarTexture : The texture that represents the vehicle on the radar. It should have an alpha channel and be set to TC_Clamp. A bunch of vehicle textures for the radar are delivered in the texture package that comes with this toolset.
 +
; [[float]] RadarTextureScale : The image will be scaled by this factor.
 +
; [[int]] RadarTextureRotationOffset : The image will be rotated by this (in Rotation Units), in case your texture doesn't face the right way (up is the direction the vehicle is driving to).
 +
 
 +
==Functions==
 +
===Events===
 +
====PostBeginPlay====
 +
{{code|event '''PostBeginPlay''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#PostBeginPlay|ONSVehicleFactory.PostBeginPlay]]
 +
 
 +
Performs a check to notify the mapper if this actor is useless.
 +
References the one and only VehicleLRIMaster in the map. If it doesn't exist yet, a new one is spawned.
 +
Sets some inherited variables to the correct values, enables the factory if necessary and precaches all the vehicles in the array.
 +
 
 +
====PostNetBeginPlay====
 +
{{code|event '''PostNetBeginPlay''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#PostNetBeginPlay|ONSVehicleFactory.PostNetBeginPlay]]
 +
 
 +
Activates the factory, either according to the closest ONSPowerNode (uses super function) or with a fixed team number, making the factory effectively independent from a PowerNode.
 +
 
 +
====SetInitialState====
 +
{{code|event '''SetInitialState''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:Actor events (UT2004)#SetInitialState|Actor.SetInitialState]]
 +
 
 +
Remove this factory from the PowerCore's dynamic 'CloseActors'-array.
 +
By doing this, destroying the closest Node will no longer disable this factory.
 +
Executing at this point makes sure that the PostNetBeginPlay() of the PowerCore has been called already.
 +
 
 +
====Timer====
 +
{{code|event '''Timer''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#Timer|ONSVehicleFactory.Timer]]
 +
 
 +
The main function of this actor. It handles when to call which other function.
 +
 
 +
====Trigger====
 +
{{code|event '''Trigger''' ([[UE2:Actor (UT2004)|Actor]]&nbsp;'''Other''', [[UE2:Pawn (UT2004)|Pawn]]&nbsp;'''EventInstigator''')}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#Trigger|ONSVehicleFactory.Trigger]]
 +
 
 +
Either enable or spawn directly if bTriggeredSpawn.
 +
 
 +
====UnTrigger====
 +
{{code|event '''UnTrigger''' ([[UE2:Actor (UT2004)|Actor]]&nbsp;'''Other''', [[UE2:Pawn (UT2004)|Pawn]]&nbsp;'''EventInstigator''')}}
 +
 
 +
'''Overrides:''' [[UE2:Actor events (UT2004)#UnTrigger|Actor.UnTrigger]]
 +
 
 +
Disable if not bTriggeredSpawn.
 +
 
 +
====VehicleDestroyed====
 +
{{code|event '''VehicleDestroyed''' ([[UE2:Vehicle (UT2004)|Vehicle]]&nbsp;'''V''')}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#VehicleDestroyed|ONSVehicleFactory.VehicleDestroyed]]
 +
 
 +
VehicleCount gets reduced (if wished) and the LinkedReplicationInfo for the radar is removed, if one for this vehicle existed.
 +
 
 +
===Other instance functions===
 +
====Activate====
 +
{{code|function '''Activate''' ([[byte]]&nbsp;'''T''')}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#Activate|ONSVehicleFactory.Activate]]
 +
 
 +
Activation depending on close Nodes.
 +
 
 +
====ChooseVehicle====
 +
{{code|function '''ChooseVehicle''' ()}}
 +
 
 +
Sets the VehicleClass to a Vehicle from the currently valid array. The class can be chosen randomly or sequential. In any case is RandomArrayNumber the index of the chosen entry in the array, so that we can find the matching properties for this vehicle when it's spawned.
 +
 
 +
====Deactivate====
 +
{{code|function '''Deactivate''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#Deactivate|ONSVehicleFactory.Deactivate]]
 +
 
 +
Deactivation depending on close Nodes.
 +
 
 +
====Reset====
 +
{{code|function '''Reset''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:Actor instance functions (UT2004)#Reset|Actor.Reset]]
 +
 
 +
Adjust this actor if the sides are switched in ONS and deletes all remaining vehicles on the map.
 +
 
 +
====SidesAreSwitched====
 +
{{code|function [[bool]]&nbsp;'''SidesAreSwitched''' ()}}
 +
 
 +
Just to make the code more surveillable.
 +
 
 +
====SpawnBuildEffect====
 +
{{code|function '''SpawnBuildEffect''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#SpawnBuildEffect|ONSVehicleFactory.SpawnBuildEffect]]
 +
 
 +
Spawns the BuildEffect emitter.
 +
 
 +
====SpawnVehicle====
 +
{{code|function '''SpawnVehicle''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#SpawnVehicle|ONSVehicleFactory.SpawnVehicle]]
 +
 
 +
Spawns the chosen VehicleClass and applies the properties from the matching entry in the array. The creation of a LinkedReplicationInfo for the radar is also handled here, if necessary.
 +
 
 +
If the ChooseVehicle function chose an entry with an empty vehicle class, then the Timer is set back to the length of a RespawnTime to try it again.
 +
 
 +
====UpdatePrecacheMaterials====
 +
{{code|simulated function '''UpdatePrecacheMaterials''' ()}}
 +
 
 +
'''Overrides:''' [[UE2:ONSVehicleFactory (UT2004)#UpdatePrecacheMaterials|ONSVehicleFactory.UpdatePrecacheMaterials]]
 +
 
 +
Loads all vehicles in the arrays into cache to have fast access during the game.
 +
 
 +
====VehicleArrayPrecache====
 +
{{code|simulated function '''VehicleArrayPrecache''' ()}}
 +
 
 +
Loads all vehicles in the arrays into cache to have fast access during the game.
 +
 
 +
 
 +
 
 +
=UltimateONSRadarHUDRI=
 +
{{infobox class
 +
| class = UltimateONSRadarHUDRI
 +
| game = UT2004
 +
| engine = UE2
 +
| package = UltimateMappingTools
 +
| parent1 = ReplicationInfo
 +
| parent2 = Info
 +
| parent3 = Actor
 +
| parent4 = Object
 +
| custom = yes
 +
}}
 +
{{autogenerated}}
  
Vehicle can't be damaged before it has been possessed.
+
Creates the HUDOverlay for the Ultimate ONS radar map. For the vehicle stuff
 +
and so on.
  
====bEnterringDoesNotUnlock====
+
==Properties==
 +
====bCreatedOverlay====
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
Vehicle is not unlocked to enemies when a player enters it.
+
<!-- enter variable description -->
  
====bTrackVehicleOnRadar====
+
====bRadarMutatorEnabled====
 
'''Type:''' [[bool]]
 
'''Type:''' [[bool]]
  
The vehicle's location will be shown in realtime on the RadarMap.
+
Disable radar functionality in that case.
  
====RadarVisibleToTeam====
+
===Default values===
'''Type:''' [[byte]]
+
{| class="list defaults"
 +
! Property
 +
! Value
 +
|-
 +
| [[UE2:Actor internal variables (UT2004)#NetUpdateFrequency|NetUpdateFrequency]]
 +
| 1.0
 +
|}
  
The vehicle will be shown on the Radar to 255= both teams; 0= own team; 1= enemy team
+
==Functions==
 +
===Events===
 +
====PostBeginPlay====
 +
{{code|event '''PostBeginPlay''' ()}}
  
====RadarVisibleToHijack====
+
'''Overrides:''' [[UE2:Actor events (UT2004)#PostBeginPlay|Actor.PostBeginPlay]]
'''Type:''' [[byte]]
+
  
When being hijacked, vehicle will be shown on the Radar to 255= both teams; 0= old owner team; 1= hijacker team
+
<!-- enter event description -->
  
====RadarOwnerUpdateTime====
+
====Tick====
 +
{{code|simulated event '''Tick''' ([[float]]&nbsp;'''DeltaTime''')}}
 +
 
 +
'''Overrides:''' [[UE2:Actor events (UT2004)#Tick|Actor.Tick]]
 +
 
 +
<!-- enter event description -->
 +
 
 +
===Other instance functions===
 +
====HasRadarMutator====
 +
{{code|function [[bool]]&nbsp;'''HasRadarMutator''' ()}}
 +
 
 +
<!-- enter function description -->
 +
 
 +
====HealDamage====
 +
{{code|function [[bool]]&nbsp;'''HealDamage''' ([[int]]&nbsp;'''Amount''', [[UE2:Controller (UT2004)|Controller]]&nbsp;'''Healer''', [[class]]<[[UE2:DamageType (UT2004)|DamageType]]>&nbsp;'''DamageType''')}}
 +
 
 +
'''Overrides:''' [[UE2:Actor instance functions (UT2004)#HealDamage|Actor.HealDamage]]
 +
 
 +
<!-- enter function description -->
 +
 
 +
 
 +
 
 +
=UltimateRadarVehicleHUDOverlay=
 +
{{infobox class
 +
| class = UltimateRadarVehicleHUDOverlay
 +
| game = UT2004
 +
| engine = UE2
 +
| package = UltimateMappingTools
 +
| parent1 = HudOverlay
 +
| parent2 = Actor
 +
| parent3 = Object
 +
| custom = yes
 +
}}
 +
{{autogenerated}}
 +
HUDOverlay for UltimateONSFactory
 +
 
 +
This Overlay displays the location of a Vehicle on the RadarMap in realtime.
 +
 
 +
==Properties==
 +
====ONSHUD====
 +
'''Type:''' [[UE2:ONSHUDOnslaught (UT2004)|ONSHUDOnslaught]]
 +
 
 +
<!-- enter variable description -->
 +
 
 +
====OnsIconScale====
 
'''Type:''' [[float]]
 
'''Type:''' [[float]]
  
How many seconds have to pass before the location of vehicle is updated for the owning team.
+
<!-- enter variable description -->
  
====RadarEnemyUpdateTime====
+
====PCOwner====
 +
'''Type:''' [[UE2:PlayerController (UT2004)|PlayerController]]
 +
 
 +
<!-- enter variable description -->
 +
 
 +
====RadarPosX====
 
'''Type:''' [[float]]
 
'''Type:''' [[float]]
  
Same as above, just for enemies.
+
<!-- enter variable description -->
  
====RadarTexture====
+
====RadarPosY====
'''Type:''' [[UE2:Material (UT2004)|Material]]
+
'''Type:''' [[float]]
  
This image will represent the vehicle on the Radar.
+
<!-- enter variable description -->
  
====RadarTextureScale====
+
====RadarRange====
 
'''Type:''' [[float]]
 
'''Type:''' [[float]]
  
The image will be scaled by this factor.
+
<!-- enter variable description -->
 +
 
 +
====RadarScale====
 +
'''Type:''' [[float]]
 +
 
 +
<!-- enter variable description -->
 +
 
 +
====RadarTrans====
 +
'''Type:''' [[float]]
 +
 
 +
<!-- enter variable description -->
 +
 
 +
====VehicleLRIMaster====
 +
'''Type:''' {{cl|UltimateRadarVehicleLRIMaster}}
 +
 
 +
<!-- enter variable description -->
 +
 
 +
==Functions==
 +
===Events===
 +
====Tick====
 +
{{code|simulated event '''Tick''' ([[float]]&nbsp;'''DeltaTime''')}}
 +
 
 +
'''Overrides:''' [[UE2:Actor events (UT2004)#Tick|Actor.Tick]]
 +
 
 +
<!-- enter event description -->
 +
 
 +
===Other instance functions===
 +
====bDrawRadar====
 +
{{code|simulated function [[bool]]&nbsp;'''bDrawRadar''' ()}}
 +
 
 +
<!-- enter function description -->
 +
 
 +
====DrawRadar====
 +
{{code|simulated function '''DrawRadar''' ([[UE2:Canvas (UT2004)|Canvas]]&nbsp;'''C''', [[float]]&nbsp;'''CenterRadarPosX''', [[float]]&nbsp;'''CenterRadarPosY''', [[float]]&nbsp;'''RadarWidth''', [[UE2:Object structs (UT2004)#Vector|Object.Vector]]&nbsp;'''MapCenter''')}}
 +
 
 +
<!-- enter function description -->
 +
 
 +
====Render====
 +
{{code|simulated function '''Render''' ([[UE2:Canvas (UT2004)|Canvas]]&nbsp;'''C''')}}
 +
 
 +
'''Overrides:''' [[UE2:HudOverlay (UT2004)#Render|HudOverlay.Render]]
 +
 
 +
<!-- enter function description -->

Revision as of 15:44, 12 October 2011

UltimateONSFactory

by Crusha K. Rool, thanks to iwanpompier for help at getting the radar to work.

UT2004 Object >> Actor >> SVehicleFactory >> ONSVehicleFactory >> UltimateONSFactory (custom)

Contents

Package: 
UltimateMappingTools

An ONS-mapper's jack of all trades device. This allows the mapper to tweak the vehicle balance of the match right down to the last detail. Allows to specify an individual vehicle list for both teams from which the next vehicle can be chosen randomly or sequentially. Each individual vehicle entry in a list can be further modified, also with the ability to track the vehicle on the RadarMap.

Properties

Property group 'Events'

PreSpawnEvent

Type: name

Event to trigger before spawn. Not activated when the vehicle was trigger-spawned.

Property group 'ONSVehicleFactory'

BlueTeamRotation

Type: int

If bReverseBlueTeamDirection, the Vehicle will not turn by 180 degrees but by this value.

8192 = 45°; 16384 = 90°; 32768 = 180°; etc.. Negative values will rotate in the opposite direction.

Property group 'UltimateONSFactory'

bCrushable

Type: bool

Allow spawning over colliding actors.

bEnabled

Type: bool

Factory is triggered "on" at the beginning.

Default value: True

bIndependentFactory

Type: bool

PowerNode has no influence on the factory's activity or team number.

bRandomFlip

Type: bool

Neutral vehicles may face in BlueTeamRotation.

bTriggeredSpawn

Type: bool

If True, this factory will immediately spawn a vehicle when being triggered.

If False, triggering will enable the factory and untriggering will disable it.

bUniqueVehicle

Type: bool

Factory spawns only a limited number of vehicles, there will be no second one when they are destroyed. MaxVehicleCount determines the number of vehicles that can be spawned.

bUseStaticTeams

Type: bool

Factory works only for one team.

NotLockedForTeam

Type: byte

This will always lock the Vehicles for the TeamNum that is NOT entered here. 255 is normal ONS, 0 will always lock this for Blue, 1 always for Red.

(Hack for Minigun turrets - it makes pretty much only sense to use this with them at the team's Core)

Default value: 255

PreSpawnTime

Type: float

Time before spawn to trigger PrepSpawn-Event and -Effect.

Default value: 2.0

RetrySpawnTime

Type: float

Interval to wait if spawn area is blocked.

Default value: 1.0

StaticTeamNum

Type: byte

0= red, 1= blue, 255= neutral / none

TeamNums are switched automatically on Reset, if necessary. This is primarily used in combination with bIndependentFactory.

VehicleListBlue

Type: array<SpawnedVehicleProperties>

List for random vehicle spawn if blue has the factory

VehicleListRed

Type: array<SpawnedVehicleProperties>

List for random vehicle spawn if red or neutral has the factory

VehicleSelectionType

Type: EVehicleSelectionType

Which method should be used to select the vehicle for spawning.

Internal variables

bInitiallyEnabled

Type: bool

Needed for Reset().

RadarRI

Type: UltimateONSRadarHUDRI

Takes care of spawning the HUDOverlay on the client.

RandomArrayNumber

Type: int

For accessing the properties of the individual vehicle

SequentialArrayNumberRed

Type: int

Same, but in a sequential order.

SequentialArrayNumberBlue

Type: int

Need seperate ones for Red and Blue.

Default values

Property Value
DrawType DT_Sprite

Enums

ESpawnSize

The size of the spawneffect particle ring around the vehicle to use.

SIZE_None 
SIZE_Scorpion 
SIZE_Manta 
SIZE_Raptor 
SIZE_Hellbender 
SIZE_Goliath 
SIZE_Leviathan 

EVehicleSelectionType

Which method should be used to select the vehicle for spawning.

VST_Random 
Random from list, equal chances for everyone.
VST_Probability 
Use Probability values of the vehicle, so some vehicles are more likely than others.
VST_Sequential 
Always select the next entry from the list when spawning a new vehicle.
VST_OnceRandom 
Random as above, just that the choice will be used for the whole match.
VST_OnceProbability 
Use Probablity as above, just that the choice will be used for the whole match.

Structs

SpawnedVehicleProperties

A load of customization and you need to do it for every entry in the list and for red and blue separately. But it pays out.

class<Vehicle> Vehicle 
The vehicle that is spawned with this entry.
int Health 
Give the spawned Vehicle a custom Health value. 0 will use the Vehicle's default.
float SpawnProbability 
Used with bUseSpawnProbability. You can enter whatever you like, just the relative difference between the entries counts.
name VehicleSpawnedEvent 
Tag to be triggered upon spawning of this particular vehicle (additionally to the one of the factory itself). The vehicle will be the instigator.
name VehicleDestroyedEvent 
Tag to be triggered upon destruction of the vehicle. Vehicle must be a subclass of ONSVehicle for this to happen.
ESpawnSize SpawnEffectSize 
The size of the spawneffect around the vehicle to use.
bool bEjectDriver 
Eject driver when vehicle gets destroyed instead of killing him.
bool bEnterringDoesNotUnlock 
Vehicle is not unlocked when a player enters it.
float SpawnProtectionTime 
The vehicle is shielded from any damage for this many seconds after spawn (spawn protection is lift immediately when a driver enters). 0 disables this, -1 means the vehicle is protected until someone enters it.
bool bChangeMaxDesireability 
If True, use a custom MaxDesirability value to tell bots if they should use the vehicle or not.
float MaxDesireability 
Default values are: Scorpion - 0.4; Hellbender - 0.5; Raptor, Cicada, Manta, SPMA, Paladin - 0.6; Goliath, Ion Tank - 0.8; Leviathan - 2.0. Go figure what matches your vehicle best.
bool bTrackVehicleOnRadar 
The vehicle's location will be shown in realtime on the RadarMap.
bool bRadarVisibleToDriver 
Should the vehicle be shown on the radar to it's driver? Only useful if you have a large delay between the updates and want to estimate where your team sees you on the radar.
bool bRadarNeutralWhenEmpty 
If true, the vehicle is drawn with white team color when it's left.
bool bRadarHideWhenEmpty 
If true, the vehicle is not drawn when it's empty.
UltimateRadarVehicleLRI.ERadarVehicleVisibility RadarVehicleVisibility 
Here you set to which players the vehicle is shown on the RadarMap.
float RadarOwnerUpdateTime 
How many seconds have to pass before the location of vehicle is updated for the owning team.
float RadarEnemyUpdateTime 
Same as above, just for enemies.
bool bRadarFadeWithOwnerUpdateTime 
If True, the icon on the radar map will interpolate between opaque and translucent as time passes between location updates on the radar.
bool bRadarFadeWithEnemyUpdateTime 
If False, the icon will always stay fully opaque.
Material RadarTexture 
The texture that represents the vehicle on the radar. It should have an alpha channel and be set to TC_Clamp. A bunch of vehicle textures for the radar are delivered in the texture package that comes with this toolset.
float RadarTextureScale 
The image will be scaled by this factor.
int RadarTextureRotationOffset 
The image will be rotated by this (in Rotation Units), in case your texture doesn't face the right way (up is the direction the vehicle is driving to).

Functions

Events

PostBeginPlay

event PostBeginPlay ()

Overrides: ONSVehicleFactory.PostBeginPlay

Performs a check to notify the mapper if this actor is useless. References the one and only VehicleLRIMaster in the map. If it doesn't exist yet, a new one is spawned. Sets some inherited variables to the correct values, enables the factory if necessary and precaches all the vehicles in the array.

PostNetBeginPlay

event PostNetBeginPlay ()

Overrides: ONSVehicleFactory.PostNetBeginPlay

Activates the factory, either according to the closest ONSPowerNode (uses super function) or with a fixed team number, making the factory effectively independent from a PowerNode.

SetInitialState

event SetInitialState ()

Overrides: Actor.SetInitialState

Remove this factory from the PowerCore's dynamic 'CloseActors'-array. By doing this, destroying the closest Node will no longer disable this factory. Executing at this point makes sure that the PostNetBeginPlay() of the PowerCore has been called already.

Timer

event Timer ()

Overrides: ONSVehicleFactory.Timer

The main function of this actor. It handles when to call which other function.

Trigger

event Trigger (Actor Other, Pawn EventInstigator)

Overrides: ONSVehicleFactory.Trigger

Either enable or spawn directly if bTriggeredSpawn.

UnTrigger

event UnTrigger (Actor Other, Pawn EventInstigator)

Overrides: Actor.UnTrigger

Disable if not bTriggeredSpawn.

VehicleDestroyed

event VehicleDestroyed (Vehicle V)

Overrides: ONSVehicleFactory.VehicleDestroyed

VehicleCount gets reduced (if wished) and the LinkedReplicationInfo for the radar is removed, if one for this vehicle existed.

Other instance functions

Activate

function Activate (byte T)

Overrides: ONSVehicleFactory.Activate

Activation depending on close Nodes.

ChooseVehicle

function ChooseVehicle ()

Sets the VehicleClass to a Vehicle from the currently valid array. The class can be chosen randomly or sequential. In any case is RandomArrayNumber the index of the chosen entry in the array, so that we can find the matching properties for this vehicle when it's spawned.

Deactivate

function Deactivate ()

Overrides: ONSVehicleFactory.Deactivate

Deactivation depending on close Nodes.

Reset

function Reset ()

Overrides: Actor.Reset

Adjust this actor if the sides are switched in ONS and deletes all remaining vehicles on the map.

SidesAreSwitched

function bool SidesAreSwitched ()

Just to make the code more surveillable.

SpawnBuildEffect

function SpawnBuildEffect ()

Overrides: ONSVehicleFactory.SpawnBuildEffect

Spawns the BuildEffect emitter.

SpawnVehicle

function SpawnVehicle ()

Overrides: ONSVehicleFactory.SpawnVehicle

Spawns the chosen VehicleClass and applies the properties from the matching entry in the array. The creation of a LinkedReplicationInfo for the radar is also handled here, if necessary.

If the ChooseVehicle function chose an entry with an empty vehicle class, then the Timer is set back to the length of a RespawnTime to try it again.

UpdatePrecacheMaterials

simulated function UpdatePrecacheMaterials ()

Overrides: ONSVehicleFactory.UpdatePrecacheMaterials

Loads all vehicles in the arrays into cache to have fast access during the game.

VehicleArrayPrecache

simulated function VehicleArrayPrecache ()

Loads all vehicles in the arrays into cache to have fast access during the game.


UltimateONSRadarHUDRI

UT2004 Object >> Actor >> Info >> ReplicationInfo >> UltimateONSRadarHUDRI (custom)
Package: 
UltimateMappingTools


Creates the HUDOverlay for the Ultimate ONS radar map. For the vehicle stuff and so on.

Properties

bCreatedOverlay

Type: bool


bRadarMutatorEnabled

Type: bool

Disable radar functionality in that case.

Default values

Property Value
NetUpdateFrequency 1.0

Functions

Events

PostBeginPlay

event PostBeginPlay ()

Overrides: Actor.PostBeginPlay


Tick

simulated event Tick (float DeltaTime)

Overrides: Actor.Tick


Other instance functions

HasRadarMutator

function bool HasRadarMutator ()


HealDamage

function bool HealDamage (int Amount, Controller Healer, class<DamageTypeDamageType)

Overrides: Actor.HealDamage



UltimateRadarVehicleHUDOverlay

UT2004 Object >> Actor >> HudOverlay >> UltimateRadarVehicleHUDOverlay (custom)
Package: 
UltimateMappingTools

HUDOverlay for UltimateONSFactory

This Overlay displays the location of a Vehicle on the RadarMap in realtime.

Properties

ONSHUD

Type: ONSHUDOnslaught


OnsIconScale

Type: float


PCOwner

Type: PlayerController


RadarPosX

Type: float


RadarPosY

Type: float


RadarRange

Type: float


RadarScale

Type: float


RadarTrans

Type: float


VehicleLRIMaster

Type: UltimateRadarVehicleLRIMaster


Functions

Events

Tick

simulated event Tick (float DeltaTime)

Overrides: Actor.Tick


Other instance functions

bDrawRadar

simulated function bool bDrawRadar ()


DrawRadar

simulated function DrawRadar (Canvas C, float CenterRadarPosX, float CenterRadarPosY, float RadarWidth, Object.Vector MapCenter)


Render

simulated function Render (Canvas C)

Overrides: HudOverlay.Render