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("");
}