WorldBuilding/MissionEditor/PhysicalZone

From TDN

This page is a Work In Progress.


Contents

Introduction

Physical Zones (p-zones) are areas that modify the player's gravity and/or velocity and/or applied force.

Setup

A Physical Zone is simply created in the MissionEditor, but then applied through the combine use of some scripting and triggers. Please read the Trigger section to also understand this area of Torque.

Typical zone:

new PhysicalZone(Booster) {
      position = "-158.282 968.511 195.767";
      rotation = "1 0 0 0";
      scale = "1 1 1";
      velocityMod = "10";
      gravityMod = "1";
      appliedForce = "0 4000 0";
      polyhedron = "0.0000000 0.0000000 0.0000000 1.0000000 
                             0.0000000 0.0000000 0.0000000 -1.0000000 
                             0.0000000 0.0000000 0.0000000 1.0000000";
   };

Types

VelocityMod


GravityMod


AppliedForce

Game Usage

Boosters

Teleporters

To be detailed at a later stage.

Killzones

datablock TriggerData(KillZoneTrigger)
{
   tickPeriodMS = 100;
};

function KillZoneTrigger::onEnterTrigger(%this,%trigger,%obj)
{
  commandToServer('suicide');
}

// .. i'm not sure what the intention behind the above code snippet is, but it seems flawed to me.
// onEnterTrigger() is a server-side call, not client side, so commandToServer() is not appropriate.
// as well, having the client be authoritative for killing itself is just bad design and subject to exploit.