Other great resources: Official JS API docs, Scripting Forum
You are viewing an old version of this page. View the current version.
Compare with Current View Page History
« Previous Version 5 Current »
The code snippet below adds an isTransporter() function that returns true if the passed in object is a transport.
var transportTypes = [ DROID_TRANSPORTER, DROID_SUPERTRANSPORTER ] // Determine if an object is a transporter this.isTransport = (typeof enumCargo == "function") ? function(obj) { // WZ 3.2+ return obj.hasOwnProperty("cargoCapacity"); } : function(obj) { // WZ 3.1 return obj.type == DROID && transportTypes.indexOf(obj.droidType) != -1; }
function eventAttacked(victim, attacker) { if ( isTransport(victim) ) { // do stuff specific to transport attack } }
Requires:
See also: Working with Transports
Jump to:
Related objects:
Constants:
Create them:
Organise them:
List or count them:
Tell them what to do:
How to's:
Transfer them between players:
Find out what's happening to droids:
Remove them:
Player Initialisation: