Author Topic: Trouble with transparent textures and triggers  (Read 678 times)

How exactly do you create a transparent texture on a staticshape .dts? If it counts for anything I'm using Port's .dts exporter. I have an orange-y material right now but it'd be better if it was 50% transparent.



I'm also having trouble detecting when someone enters the sphere. It's awkward because triggers can only be square, as far as I know. I'd still be fine with a square though, but the trigger isn't even going in the right place. I tracked the edges of the trigger with orange/blue colors, and the red brick is the origin of the staticshape and the trigger.




The problem is that instead of the origin (where the player stands when they place it) being in the center of the trigger, it's at the edge. Is there an easier way to make these triggers, or just a way to center the trigger? Can I somehow visualize the trigger?

Code:
if(isObject(%client.healZone)){
   %client.healZone.delete();
   %client.healZoneTrigger.delete();
}

%client.healZone = new StaticShape(%client.name @ "HealZone")
{
       position = %client.player.getHackPosition();
       rotation = %client.player.rotation;
   scale = "1 1 1";
      dataBlock = "HealShield";
   canSetIFLs = "0";
};
missionCleanup.add(%client.healZone);

%t = new Trigger(%client.name @ "HealZoneTrigger")
{
   datablock = HealZoneTrigger;
   polyhedron = "0 0 0 1 0 0 0 -1 0 0 0 1"; //shape
   position = %client.player.getHackPosition();
   rotation = %client.player.rotation;
};
missionCleanup.add(%t);
%client.healZoneTrigger = %t;
//%t.setTransform(%client.player.getHackPosition());
%t.setScale("6 6 6");

schedule(60000, 0, eval, %client.healZone @ ".delete();");
schedule(60000, 0, eval, %client.healZoneTrigger @ ".delete();");

Datablocks:
datablock StaticShapeData(HealShield)
{
   shapeFile = "./shield.dts";
};

datablock TriggerData(HealZoneTrigger)
{
    tickPeriodMS = 100;
};
function HealZoneTrigger::onEnterTrigger(%this, %trigger, %obj)
{
    talk("You entered the zone!");
    %obj.client.centerPrint("\c5You're in the zone!");
}
function HealZoneTrigger::onLeaveTrigger(%this, %trigger, %obj)
{
   talk("You left the zone!");
    %obj.client.centerPrint("");
}
« Last Edit: May 14, 2016, 12:42:50 PM by Johnny Blockhead »

You can use this polyhedron instead to make the trigger centered on the origin:

"-0.5 -0.5 -0.5 1 0 0 0 1 0 0 0 1"

Thanks! That works like a charm. I was able to figure out transparency, too. I just used this tutorial:
https://www.youtube.com/watch?v=SrZe0B0ra0U
It makes my model look like stuff now, so I'm going to have to go back and change something.

Edit: To clarify, the actual texture is transparent too.
« Last Edit: May 14, 2016, 07:13:23 PM by Johnny Blockhead »

The transparency *might* render better if you make every of those hexagons a seperate object in blender.