CATEGORY NAME: GAMEBASE FUNCTIONS GameBase::playSound(Object, Sound, Channel); ARG: Object: The object Id. Example: 8361. Sound: The name of the sound to play. Look in Nsound.cs for an example of setting up a SoundData block. Channel: The channel to play the sound on. The number of avaiable channels for one Object is four the range is 0 through 3. EXPLAIN: Used to play the Sound at the location that the Object is currently at. USED IN: Moveable.cs RETURN: True if succeed or False if failed. GameBase::generatePower(Object, Bool); ARG: Object: The object Id. Example: 8361. Bool: True then Object is generating power. False then Object has stoped generating power. EXPLAIN: Used to set the generator status either working or not. This is used to inform all objects that depend on that generator for power. USED IN: Staticshape.cs RETURN: True if succeed or False if failed. GameBase::isPowerGenerator(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to see if the Object is a generator. USED IN: Currently not used in any script files. RETURN: True if it is a Generator, False if not, or False if failed. GameBase::getPowerCount(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the number of generators powering the Object. If two generators are powering an object and one gets destroyed then the function would return one. USED IN: Currently not used in any script files. RETURN: Number. The number of generators power count. If failed then 0. GameBase::isPowered(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to check if the Object currently has a functioning power source. USED IN: Moveable.cs, Sensor.cs, Station.cs, Turret.cs, ... RETURN: True if the object has a working power source or False on all other accounts. GameBase::getTeam(Object or Client); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. EXPLAIN: Used to get what team the Object or Client is currently assigned to. USED IN: Admin.cs, Ai.cs, Game.cs, Item.cs, Objectives.cs, ... RETURN: Team number in the range 0-7. If failed then -1. GameBase::setTeam(Object or Client, TeamNum); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. TeamNum: Team number. Each team is associated with a number range from -1 to 7. Where -1 is the observer team. EXPLAIN: Used to assign an Object or Client to a particular team defined by the TeamNum value. USED IN: Ai.cs, Game.cs, Item.cs, Observer.cs, Server.cs, ... RETURN: True if succeed or -1 if failed. GameBase::getPosition(Object or Client); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. EXPLAIN: Used to find the current (X Y Z) position of the Object or Client. The X and Y positions are found from the center of the map at 0,0. The Z is the height of the Object or Client. USED IN: Ai.cs, Game.cs, Item.cs, Objectives.cs, Player.cs, ... RETURN: If succeed "X Y Z" position of the Object or Client. Example: "351 -234 33". If failed then "0 0 0". GameBase::getRotation(Object or Client); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. EXPLAIN: Used to find the current (X Y Z) rotation of the Object or Client. X value is the rotation around the X axis, Y value is the rotation around the Y axis, and Z is the rotation around the Z axis. In most cases X and Y will be 0 and Z will be between 3.14 and -3.14. X and Y will be none zero if for example you are in a flyer making a turn or flying up or down. USED IN: Ai.cs, Game.cs, Item.cs, Station.cs, Vehicle.cs RETURN: If succeed "X Y Z" rotation of the Object or Client. Example: "0 0 1.45". If failed then "0 0 0". GameBase::setPosition(Object or Client, Position); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. Position: The "X Y Z" value used to set the position on the map. For Example: Position = "100 -200 40" This will move the Object or Client 100 in the positive X direction(EAST), -200 in the negative Y direction (SOUTH), and 40 in the positive Z direction(UP). The new position is offset from the "0 0 0" location on the map. EXPLAIN: Used to set the Object or Client to the location specified by the Position argument. USED IN: Item.cs, Objectives.cs, Station.cs, Player.cs, Vehicle.cs RETURN: True if succeed or False if failed. GameBase::setRotation(Object or Client, Rotation); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. Rotation: The "X Y Z" value used to set the position on the map. For Example: Position = "1.3 -3.0 0" This will rotate the Object or Client 1.3 in the positive X direction, -3.0 in the negative Y direction, and 0 in the positive Z direction. EXPLAIN: Used to set the Object or Client to the rotation specified by the Rotation argument. USED IN: Item.cs, Station.cs, Vehicle.cs RETURN: True if succeed or False if failed. GameBase::getTransform(Object or Client); ARG: Object: The object Id. Example: 8361. Client: The Client Id. Example: 2049. EXPLAIN: Used to get the Position and Rotation of an Object or Client. The position and rotation will be combined together in with the position before the rotation. USED IN: Currently not used in any script files. RETURN: Transform. Combining the Position and Rotation is called the Transform. Example:"234 -122 43 0 0 2.3". The Position is equal to "234 -122 43". The Rotation is equal to "0 0 2.3". If failed then "0 0 0 0 0 0". GameBase::getDataName(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the data block name of the object. Look in the file Item.cs for the name ItemData. This is defining an item data block. Examples of Data Names are: Flag or Chaingun. Look in Station.cs file for the name StaticShapeData. This is defining a Static Shape data block. Examples of Data Names are: DeployableAmmoStation or DeployableIncStation. USED IN: BaseProjData.cs, Item.cs, Mine.cs, Moveable.cs, Player.cs, ... RETURN: Data block name. Example: "Chaingun". If failed then "". GameBase::isAtRest(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to see if an object is still moving. USED IN: Mine.cs RETURN: True if it is at rest or False if still moving. GameBase::testPosition(Object, Position); ARG: Object: The object Id. Example: 8361. Position: The "X Y Z" value used to set the position on the map. For Example: Position = "100 -200 40" This will move the Object or Client 100 in the positive X direction(EAST), -200 in the negative Y direction (SOUTH), and 40 in the positive Z direction(UP). The new position is offset from the "0 0 0" location on the map. EXPLAIN: Used to see if the Object can move to the desired Position. USED IN: Vehicle.cs RETURN: True if the Object can move to the Position. False if a collision occurs with another object. /////////////////////////////////////////////////////////////// //// ShapeBase object functions. Called GameBase:: to simply //// out public script interface a little. Functions should //// behave gracefully if object is not derived from ShapeBase /////////////////////////////////////////////////////////////// GameBase::setSequenceDirection(Object, Thread, Forward); ARG: Object: The object Id. Example: 8361. Thread: Each object can be assigned up to 4 sequences to be played 0-3. Forward: If a non zero value is passed in then the sequence will go forward. If zero then it will go backwards. EXPLAIN: Used to set the direction of the animation to be played by the object. USED IN: Station.cs RETURN: True if succeed or False if failed. GameBase::stopSequence(Object, Thread); ARG: Object: The object Id. Example: 8361. Thread: Each object can be assigned up to 4 sequences to be played 0-3. EXPLAIN: Used to stop a sequence that is currently playing. USED IN: Staticshape.cs, Station.cs, Turret.cs RETURN: True if succeed or False if failed. GameBase::playSequence(Object, Thread, ); ARG: Object: The object Id. Example: 8361. Thread: Each object can be assigned up to 4 sequences to be played 0-3. Sequence: The Objects animation to be played. If the Sequence argument is passed in then that Sequence will be assigned to that Thread. EXPLAIN: Used to start playing a sequence. If no Sequence argument is passed in then it will play the Sequence that Thread is defined to. USED IN: Mine.cs, Sensor.cs, Staticshape.cs, Station.cs, Turret.cs RETURN: True if succeed or False if failed. GameBase::pauseSequence(Object, Thread); ARG: Object: The object Id. Example: 8361. Thread: Each object can be assigned up to 4 sequences to be played 0-3. EXPLAIN: Used to pause the sequence that defined by the thread. USED IN: Sensor.cs, Station.cs RETURN: True if succeed or False if failed. GameBase::setRechargeRate(Object, Rate); ARG: Object: The object Id. Example: 8361. Rate: Amount to increase energy every second. EXPLAIN: Used to set the Rate at which the Objects energy will recharge every second. USED IN: Player.cs, Sensor.cs, Turret.cs, Vehicle.cs RETURN: True if succeed or False if failed. GameBase::getRechargeRate(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the current rate at which the Objects energy recharges at. USED IN: Currently not used in any script files. RETURN: Rate. The value at which the Objects energy recharges at. If failed then "0". GameBase::setAutoRepairRate(Object, Rate); ARG: Object: The object Id. Example: 8361. Rate: Amount to increase health every second. EXPLAIN: Used to set the Rate at which the Objects health will increase every second. USED IN: BaseProjData.cs RETURN: True if succeed or False if failed. GameBase::getAutoRepairRate(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the rate that the Object is getting repaired at. USED IN: BaseProjData.cs RETURN: Rate. The value at which the Objects energy recharges at. If failed then "0". GameBase::repairDamage(Object, Rate); ARG: Object: The object Id. Example: 8361. Rate: Amount to increase health every second. EXPLAIN: Used to set the Rate at which the Objects health will increase every second. USED IN: Item.cs, Station.cs RETURN: True if succeed or False if failed. GameBase::throw(Item, Object, Vel, Random); ARG: Item: The data block name of the item. Example: Chaingun Object: The object Id. Example: 8361. Vel: Velocity the Item will be thrown at. Random: If True then it will be thrown in a random direction. If False then it will be thrown in the direction the object is facing. EXPLAIN: Used to throw an object. Example: When you die your pack and weapon is thrown random directions. USED IN: Item.cs, Objectives.cs RETURN: True if succeed or False if failed. GameBase::setEnergy(Object, Value); ARG: Object: The object Id. Example: 8361. Value: The amount of energy to set. EXPLAIN: Set the Objects energy level. Example: When they have a shield on and get hit then the damage value is subtracted from the Objects energy. USED IN: BaseProjData.cs, Player.cs, Staticshape.cs RETURN: True if succeed or False if failed. GameBase::getEnergy(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the current energy level of the Object. USED IN: BaseProjData.cs, Player.cs, Staticshape.cs RETURN: Value. The current energy level of the Object. If failed then "0". GameBase::getDamageLevel(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the Objects current health amount. USED IN: BaseProjData.cs, Dm.cs, Item.cs, Mine.cs, ... RETURN: Value. The current health level of the Object. If failed then "0". GameBase::setDamageLevel(Object, Value); ARG: Object: The object Id. Example: 8361. Value: The amount of health left. EXPLAIN: Used to set the health level of an object. USED IN: Dm.cs, Mine.cs, Moveable.cs, Player.cs, Staticshape.cs RETURN: True if succeed or False if failed. GameBase::getDamageState(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to find what state the Object is in. USED IN: Player.cs, Station.cs RETURN: State. There are three predefined states: Enabled: If Object is fully functional. Disabled: If Object is damaged so it cant function. Destroyed: If Object is destroyed. If failed then "0". GameBase::applyDamage(Object, Type, Value, Pos, Vec, Mom, SourceObj); ARG: Object: The object Id of the object getting damaged. Example: 8361. Type: Type of damage: $ImpactDamageType = -1; $LandingDamageType = 0; $BulletDamageType = 1; $EnergyDamageType = 2; $PlasmaDamageType = 3; $ExplosionDamageType = 4; $ShrapnelDamageType = 5; $LaserDamageType = 6; $MortarDamageType = 7; $BlasterDamageType = 8; $ElectricityDamageType = 9; $CrushDamageType = 10; $DebrisDamageType = 11; $MissileDamageType = 12; $MineDamageType = 13; Value: Damage value. Pos: The position where the projectile hit the Object. Vec: The projectiles vector. Mom: Momentum of the projectile. SourceObj: What object is applying the damage or shot the projectile. EXPLAIN: Used to apply damage to an Object. Example of use: getting hit by a projectile, a flier hitting an object, ect. USED IN: BaseProjData.cs, Moveable.cs RETURN: True if succeed or False if failed. GameBase::activateShield(Object, Vector, ); ARG: Object: The object Id. Example: 8361. Vector: A vector from the center of the object to the location where the projectile hit the shield. OffsetZ: Allows you to adjust the height of the shield if needed. EXPLAIN: Used to display the shield effect on shielded objects. USED IN: Player.cs, Staticshape.cs RETURN: True if succeed or False if failed. GameBase::getLOSInfo(Object,Dist,); ARG: Object: The object Id. Example: 8361. Dist: The max distance this function will look for an object. In meters. Rot: Rotation argument optional. If no rotation is passed in then it will use the objects current line of site. Look in Station.cs for an example of the rotation. Example: "0 0 3.14" this will do the LOS directly behind the Object. EXPLAIN: Does a line of site projection Dist meters away and returns what object was found. It sets the following global variables: $los::position: Position the LOS hit the object "X Y Z". $los::normal: LOS vector Normalized. $los::object: The Id of the object that was hit by the LOS. USED IN: Ai.cs, Item.cs, Station.cs RETURN: True if succeed or False if failed. GameBase::setMapName(Object, Name); ARG: Object: The object Id. Example: 8361. Name: The Objects name to be displayed on the command map. EXPLAIN: Used to give Objects a name that will appear on the command map. Also gives a name when LOS is used. USED IN: Item.cs, Station.cs, Turret.cs, Vehicle.cs RETURN: True if succeed or False if failed. GameBase::getMapName(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the Objects map name. The object map name is the name that is displayed on the command map. USED IN: BaseProjData.cs, Station.cs, Turret.cs RETURN: Name. The name used on the command map. If failed then "". GameBase::virtual(Object, Function, ); ARG: Object: The object Id. Example: 8361. Function: The name of the function to be called. Arg1: Arguments that need to be passed to the Function. EXPLAIN: Used to call the Function on the Object . Example: If the object is the Blood Eagle flag that you where carrying. You step out of the mission area and the GameBase::virtual(%obj, "playerLeaveMissionArea",%player); is called. %obj is the Blood Eagle flag so Flag::playerLeaveMissionArea is called. USED IN: BaseProjData.cs, Objectives.cs, Trigger.cs, Turret.cs RETURN: What value Function returns. If failed then "". GameBase::setActive(Object, Bool); ARG: Object: The object Id. Example: 8361. Bool: True if Object is active. False if Object is not active. EXPLAIN: Used to set if the Object is active or not. Used along with the GameBase::isActive() function. USED IN: Mine.cs, Moveable.cs, Sensor.cs, Staticsshape.cs, ... RETURN: True if succeed or False if failed. GameBase::isActive(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to see if the Object is active. USED IN: Mine.cs, Moveable.cs, Station.cs RETURN: True if active or False if not active. GameBase::getMuzzleTransform(Player or Client); ARG: Player: The object Id. Example: 8361. Client: The Client Id. Example: 2049. EXPLAIN: Used to get the Transform of the Players weapon. The transform returned is base on world coordinates. USED IN: Currently not used in any script files. RETURN: Transform of the Players weapon. If failed then "1 0 0 0 1 0 0 0 1 0 0 0". GameBase::startFadeOut(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: This will fade out the object. Example: When a player dies after X amount of time the player will slowly fade away. It takes 2.5 seconds to fade out an object. Keep in mind that even though you have faded out the object it is still there until you delete it. USED IN: Item.cs, Station.cs, Objectives.cs, Player.cs, ... RETURN: True if succeed or False if failed. GameBase::startFadeIn(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: This will fade in the Object. Example: When a flag gets returned back to a base it fades in. USED IN: Item.cs, Objectives.cs, Station.cs, Staticshape.cs, ... RETURN: True if succeed or False if failed. GameBase::applyRadiusDamage(Type, Center, Radius, DValue, Force, Object); ARG: Type: Type of damage: $ImpactDamageType = -1; $LandingDamageType = 0; $BulletDamageType = 1; $EnergyDamageType = 2; $PlasmaDamageType = 3; $ExplosionDamageType = 4; $ShrapnelDamageType = 5; $LaserDamageType = 6; $MortarDamageType = 7; $BlasterDamageType = 8; $ElectricityDamageType = 9; $CrushDamageType = 10; $DebrisDamageType = 11; $MissileDamageType = 12; $MineDamageType = 13; Center: The center of the Object that is causing the Radius Damage. Radius: The radius is a predefined value that was set when the object was created. Use GameBase::getRadius() to find object radius. DValue: The damage value to apply. Force: The max force to apply to surrounding objects. Object: The Id of the object causing the Radius Damage. Example: 8361. EXPLAIN: Used to apply damage to Objects when an Objects explodes. If an object was at the center of the explosion then that object would be damaged by a value of DValue and a force would be applied to it defined by Force. The further away from the center of the explosion the less DValue and Force will be applied the those objects. USED IN: Staticshape.cs RETURN: True if succeed or False if failed. GameBase::getRadius(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the radius of the Object. The radius is a predefined value that was set when the object was created. USED IN: Staticshape.cs RETURN: Float. The radius of the Object. If failed then "False". GameBase::getDisabledDamage(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the level at which the Object becomes disabled. USED IN: Staticshape.cs RETURN: Float. The disable level. //////////////////////////////////////////////////// //// StaticBase object functions, called GameBase:: //////////////////////////////////////////////////// GameBase::setIsTarget(Object, Bool); ARG: Object: The object Id. Example: 8361. Bool: True then set it up to be a target. False no target info. EXPLAIN: Used to set the Object up with target information. The beacon is an example of target information. It has the Triangle and meters away information. USED IN: Beacon.cs RETURN: True if succeed or False if failed. GameBase::getOwnerClient(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the Client Id from the Object Id. USED IN: Player.cs RETURN: Client Id. Example: 2049. If failed then -1. GameBase::getControlClient(Object); ARG: Object: The object Id. Example: 8361. EXPLAIN: Used to get the Client Id from the Object Id. USED IN: Turret.cs, Player.cs, Station.cs, Vehicle.cs, ... RETURN: Client Id. Example: 2049. If failed then -1.