Assault Mapping Tutorial/Adding Vehicles And Turrets
In assault vehicles can be used in more ways that any other gametype and can seriously affect gameplay so you should be careful when placing vehicles see Vehicle Gameplay for more information on where and why to place vehicles.
Previous Section: /Other Objectives
Next Section: /WrapUp
Setting Up a vehicle
When placing an ONS vehicle (the standard ones) in an AS map there are no specific factories for each of the vehicles they must be set in a property of an ASVehicleFactory. Unless you set it up in the display options there will only be an actor in the UEd viewport until the vehicle spawns inside the actual game.
Vehicles designed only for assault though (the turrets) have individual factories, this will be discussed further on.
Placing the actor
Go into the actor browser and in Actor>>SVehicle there will be ASVehicleFactory take this and put one into your map (use the root level of this to add a standard vehicle)
It will appear as a car icon and when the paths are rebuilt a navigation point will appear under it
Setting which Vehicle you want
To set which vehicle to use go to the SVehicleFactory sub-menu and select in the vehicleclass list. See Vehicle Gameplay for the names that you should use.
Properties that you might want to change
Open the properties of the ASVehicleFactory and browse the the ASVehicleFactory sub-menu there are a list of options all unique to the assault gametype:
- bEnterteamunlocks
- If the vehicle is locked (when bVehicleTeamLock is set to true) the vehicle will unlock if a player gets in and out of the vehicle and this is set to true
- bVehicleTeamLock
- When the vehicle spawns and this is set to true only the team specified in VehicleTeam will be able to enter it
- bRespawnwhenDestroyed
- When set to true the vehicle will respawn when it is destroyed after the time specified in the RespawnDelay field
- bSpawnProtected
- If set to true the vehicle cannot be damaged before a player enters it
- VehicleHealth
- You can specify the health of the vehicle here if you don't want it at the default specified in coding (setting it to 0 will be default)
- VehicleTeam
- Sets the initial team of the vehicle (see bEnterteamunlocks) 0 = Attackers, 1 = Defenders
That's about it for setting up a basic vehicle, there is a list of other properties and what they do further down
Setting up a Sentinel or Turret
To place a sentinel or turret expand the ASVehicleFactory branch and place one of the following:
- ASVehicleFactory_IonCannon - Massive Ion Cannon (as in RobotFactory)
- ASVehicleFactory_MinigunTurret - (As in Convoy)
- ASVehicleFactory_SentinelCeiling - You cannot get into these and are generally used as spawn protection or objectives to destroy
- ASVehicleFactory_SentinelFloor - As above but you place them of the floor
- ASVehicleFactory_Turret - Turrets as in the ones on Mothership
- ASVehicleFactory_LinkTurret - Link Turrets - can heal other vehicles but also destroy them very quickly
Once place they can be setup as in the vehicles section but there are a few more properties to take into account for turrets
- AIVisiblity
- This is how far the turret (and bots in it) can 'see' - If it is a sentinel, link turret or a mothership turret it will automatically shoot at anyone in the other team within that range (the others will not) setting it to 0 will mean that it will not automatically shoot at anyone. In other turrets it will limit how far the bot can 'see' and fire at targets.
Making bots use turrets
Bots will not use the control panels (below) and therefore will never use the Mothership Turrets (ASVehicleFactory_Turret) and Link Turrets (ASVehicleFactory_LinkTurret). You therefore need to set the AIVisiblity (see above) if you want the turrets to fire in bot matches.
Bots will manually get into both the ion cannon and minigun turrets if both of the following apply:
- There is a path to the turret and space to get in (applies mostly to ion cannon as you can only get in at the ladder)
- The current objectives tag is listed under ASVehicleFactory_IonCannon/MinigunTurret (maximum of 6 objectives - cannot be increased without recoding)
Making the turret 'remote controlled'
If you want the turret to be controlled through a wall panel (as in mothership) you have to do the following:
- Place a Triggers>>SVehicleTrigger>>Trigger_ASUseandPossess>>Trigger_ASTurretControlPanel
Set the following properties in the Trigger_ASTurretControlPanel:
- Trigger_ASUseandPossess>>AssaultTeam
- Only the team (or all) will be able to use this panel
- Trigger_ASUseandPossess>>PawnTag
- This must be the same as the ASVehicleFactory>>VehicleTag of the turret
- Make sure that in addition to setting the Trigger_ASUseandPossess>>AssaultTeam that you set the team correctly on the turret itself (see above (bVehicleTeamLock etc.) as you either may not be able to get into the turret using the panel.
- You can also get into both the link turrets and Mothership turrets manually (if the bVehicleTeamLock etc... (see above) is set correctly) by standing on top of the turret and pressing your 'use' key
- You can only remote control the mothership turrets and link turrets the others will not work!
Making the Vehicle Spawn or 'Unspawn' when triggered
This applies to both sentinels, turrets and vehicles.
- bEnabled states if the vehicle will spawn at the beginning of the game. If not true it will only spawn when triggered and depending on the TriggeredFunction may change during the game.
- TriggeredFunction can be set in one of the following states
- EVASF_ToggleEnabled - When the factory is triggered it will switch between being enabled and disabled (depending on what bEnabled starts at)
- EVASF_TriggeredSpawn - When the factory is triggered it will switch between being enabled and disabled (depending on what bEnabled starts at) BUT WILL DESTROY THE VEHICLE WHEN DISABLED!!!
Force Destroy
When a factory is triggered from enabled to disabled it will not destroy the vehicle but only stop it from respawning when it is next destroyed. This means that if you want to force a vehicle to destroy you must do the following. In the PlayerSpawnManager used previously in the tutorial there is a field called DisabledVehicleFactoriesTag adding a field here and entering the Events>>Tag of any VehicleFactory, when the PlayerSpawnManager is disabled the vehicle will not only vanish (no explosions) but the factory will set bEnabled to false. Which is essential when using sentinel for spawn areas that are used by both teams.
Extra Properties
These might be useful when doing more complex things with vehicles
- AIVisibility
- only used for turrets (see below)
- Announcement_Destroyed
- Put the name of a sound file in here and when the vehicle is destroyed everyone will here it
- bHighScoreKill
- When set to true this will earn the person who destroys the vehicle a trophy and some points
- bHUDTrackVehicle
- When set to true the vehicle will have a visible icon on the HUD showing health and position (It is only posible to have one vehicle (that is spawned) at a time with this, if you have more than one it will rotate as the vehicle with it dies)
- bKeyVehicle
- When set to true the vehicle will have a health bar above it for all players
- bSpawnBuildEffect
- When the vehicle is about to spawn or respawn you will get the nice red or blue rings and a warning if you are in the way (the time of the warning can be set in MaxSpawnBlockCount (in seconds))
- VehicleEvent
- This is triggered when the vehicle is destroyed
- VehicleLinkHealMult
- How much the link gun heals the vehicle, 0 = link gun won't heal it, 1 = link gun will heal vehicles very quickly
The few that I have left out need only be changed in very strange circumstances...
If you need help please email blip2@dogmatix.net or comment below - I check fairly regularly.
Discussion
SuperApe: This is an excellent series of tutorials. Well done.
Blip2: meh I only did this page
FreshMeat: Followed these directions exactly, my remote control turret doesn't work. You can't get in, though it will shoot automatically. When the turret is killed, the correct panel explodes like it would if the thing were remote control. Any tips?
Herr General:I can't help you with that, even though it works in my map
Blip2: Freshmeat: see above - I've added a bit