Other great resources: Official JS API docs, Scripting Forum
Working with Transports
- Aubergine
What are transports?
Transports are special Droids that can transport other droids in their cargo holds.
There are currently two types of transport:
<pics & info>
The main benefit of using transports is their ability to travel in a straight line to their destination, even if that destination is not accessible by land or hover propulsions:
- They can reach inaccessible high ground to build artillery, sensors or gain access to oil resources
- They will often reach the destination faster than land units could, because they can fly over obstacles rather than having to traverse them
However, transports have little or no defence capability (in Warzone 3.1 they have a machine gun, in 3.2 and above they don't have a weapon) and they are the slowest of all airborne vehicles. This makes them particularly susceptible to any form of AA weapons, and currently that means that once the enemy has AA weapons transports are effectively obsolete.
How do I build transports?
<I have no idea!!>
How do I get droids on to a transport?
First, check if the transport is the correct type for the droid:
- A .droidType of DROID_CYBORG can go on either DROID_TRANSPORTER or DROID_SUPERTRANSPORTER
- Non-cyborg droids can only go on a DROID_SUPERTRANSPORTER
Next, check if there's enough room in the cargo hold:
- The size of the droid can be determined from it's .bodySize property
- The amount of cargo space remaining on the transport can be determined by it's .cargoSpace property
- If .cargoSpace ≥ .bodySize, the transport has enough room for the droid
Finally, make sure the transport is landed and that the droid can reach it:
- Move the transport to a location using orderDroidLoc() with an order of DORDER_MOVE.
- The transport's .order will be DORDER_NONE when it's landed (eventDroidIdle() should also be fired when the transport lands)
- You can check if a droid can reach the transports location using droidCanReach().
If the above requirements are met, you can move the droid on to the transport:
- Use orderDroidObj() with an order of DORDER_EMBARK
How do I know what droids are on a transport?
You can find out if there are any droids on a transport by inspecting the transport's .cargoCount property, which returns the number of droids in its cargo hold (an integer that's ≥0).
If the are droids in the cargo hold, you can get a list of them using enumCargo().
Droids in the cargo hold are no longer on the map, meaning that they will not appear in the results of functions such as enumDroid(), enumRange() and enumArea(), although they will still be counted in functions such as countDroid().
How do I get droids off a transport?
The transport must be landed in an area where the surrounding terrain is accessible to the droids that are on the transport:
- Use enumCargo() to get a list of droids and then determine their propulsion type via their .propulsion property
- Check whether the droids will be able to access land around the transport using propulsionCanReach()
If the droids are cable of reaching map tiles around the transport, disembark them:
- Use orderDroid() with an order of DORDER_DISEMBARK
How do I repair transports?
Sending a transport to a rearming pad is a bad idea – not only will the transport take up waay too much room, but it will also hog the rearm pad for a very long time.
Instead, it's better to find the nearest repair facility and make the transport hover over it:
- Use enumStruct() filtered to REPAIR_FACILITY to get a list of repair stations (Tip: Allied repair facilities also repair your droids)
- Use distBetweenTwoPoints() to find the facility nearest to your transport
- Use orderDroidLoc() to move the transport to the repair facility
- Use queue() to periodically check the transports .health property
How do I script transports for away missions?
<to follow>
Availability 3.1 B5+
Requires:
- Warzone 3.1 Beta 5 or above
- Warzone 3.2 strongly recommended
Contents
Jump to:
Trivia
Transports weren't part of the original Warzone game.
A female fan called Toricat came up with the idea, and about 3 weeks later Pumpkin Studios released a patch adding transports to the game!
Scripting: Droids
Related objects:
Constants:
- .action – what action is the droid doing?
- .droidType – what category of droid is it?
- .order – what is the droids order?
Create them:
- makeTemplate() – check various things before building a droid
- componentAvailable() – is a component (propulsion, body or turret) available?
- addDroid() – instantly add a droid to the map
- buildDroid() – produce a droid at a factory
- getDroidProduction() – find out what droid a factory is currently producing
- setDroidExperience() – set experience of a droid
Organise them:
List or count them:
- hackGetObj() – get a single droid
- enumDroid() – list droids on the map
- enumArea() – list droids in specific area
- enumRange() – list droids near a location
- enumGroup() – list droids in a group
- enumSelected() – list droids that are selected
- countDroid() – count droids
Tell them what to do:
- orderDroid() – give a basic order
- droidCanReach() – can the droid reach it's destination?
- propulsionCanReach() – can a specific propulsion travel between two points?
- orderDroidBuild() – build a structure
- orderDroidLoc() – move to a location the map
- orderDroidObj() – do something to another object (attack, repair, etc)
How to's:
- Working with Commanders
- Working with Factories
- Working with Repairs & Rearming
- Working with Sensors
- Working with Transports
- Working with Construction
- Working with VTOLs
Transfer them between players:
- donateObject() – donate a droid to an ally
- eventObjectTransfer() – a droid was transferred or assimilated
Find out what's happening to droids:
- eventDroidBuilt() – droid built or added
- eventDroidIdle() – current orders completed
- eventSelectionChange() – human (de)selects droids
- eventArea<Label>() – droid enters a labelled area
- eventObjectSeen() – droid appears on your sensors
- eventAttacked() – cluster was attacked
- eventAttackedUnthrottled() – same as above, but unthrottled
- eventPickup() – picked up an artifact or oil drum
- eventDestroyed(), bind() – destroyed or recycled
Remove them:
- removeObject() – instantly remove a droid
- DORDER_DESTRUCT – an alternate method
- DORDER_RECYCLE – recycle a droid
- enableTemplate() – allow construction trucks to be built before HQ
- enableComponent() – make a droid component available to research
- makeComponentAvailable() – make a droid component available
- setDesign() – enable or disable design mode
- setDroidLimit() – limit the number of droids a player can make
- getDroidLimit() – determine the limits set for droids
- setExperienceModifier() – change rate at which droids gain experience