Teleport script
by Stefan Beffy Moises · 07/09/2002 (10:11 am) · 44 comments
Download Code File
The basic idea was to combine 2 (or more) triggers, animated dts shapes
for the basic effect, particle effects, a little script
swapping the player location/transform and finally some "buzz" sound.
Okay, so lets start with the function doing the actual teleport...
I've put it into "server/scripts/commands.cs" and it looks like this:
target object indicated by %targetObj, adjusts the z value to prevent the player from
falling through the terrain and sends him to the %finalPos position.
Now lets look at the trigger, I've made a new file "fps/server/teleportTrigger.cs" which I execute in
"fps/server/game.cs" (as always), and it looks like this:
I've got two trigger objects in my mission file named "TeleportTrigger1" and "TeleportTrigger2",
furthermore there are the two shape files, which have their own datablock (btw., I took these shapefiles
and their datablock file "fxShapes.cs" from the latest RWTA build - thanks Phil :-).
Here is the datablock:
recent teleport, and if he was, he has to step out of it (onLeaveTrigger), before he can use it again...
otherwise he would be trapped, I guess... ;-)
To make it more realistic and to not just move the player, I put a little timeout of two seconds in,
and, what adds quite a lot to it, I set
So here is how all that looks in my mission file:
The ParticleEmitter looks like this, I keep all of my particle stuff in a file named "customParticles.cs",
which is also executed in ... well, you guess it!
Okay, so here are the "step-by-step" instructions...
1) download the zip :-P
2) put flame.dts and flame.png in "fps\data\shapes\markers"
3) put electricity.wav in "\fps\data\sound\fx"
4) put fxShapes.cs, teleportTrigger.cs and customParticles.cs in "fps\server\scripts"
5) put
6) put the function serverCmdTeleportPlayer(%client, %targetObj) in "fps\server\scripts\commands.cs"
7) add all the objects needed to your mission file (use the world editor by pressing F11 -> F4)
Note: it may be hard to add and place the particle emitters in the editor, so if you have problems, simply add
the shapes and the triggers with the editor, then save your mission and add the emitters manually - you can copy
the positions of the triggers and then adjust them later in the editor).
Well, as always, hope you enjoyed it - happy teleporting! :-))
PLEASE NOTE: The download file available here comes without the sound file for the effect (too large for the resource), but you can find this tutorial and ALL the files here!
EDIT: Fixed the multiplayer issues, everything is working now in multiplayer, too! The zip files here and on our website have been updated! Thanks to Ed Gardner who helped me out on IRC! :-)
The basic idea was to combine 2 (or more) triggers, animated dts shapes
for the basic effect, particle effects, a little script
swapping the player location/transform and finally some "buzz" sound.
Okay, so lets start with the function doing the actual teleport...
I've put it into "server/scripts/commands.cs" and it looks like this:
function serverCmdTeleportPlayer(%client, %clientId, %targetObj)
{
%player = %clientId.player;
%currPlayerPos = %player.getPosition();
%targetPos = %targetObj.getPosition();
%x = getWord(%targetPos, 0);
%y = getWord(%targetPos, 1);
%z = getWord(%targetPos, 2);
// adjust z value to prevent player from falling through the terrain... :-P
%z += 3.0;
%finalPos = %x SPC %y SPC %z;
echo("Transforing from" SPC %currPlayerPos SPC "to" SPC %finalPos);
%player.setTransform(%finalPos);
}Well, pretty basic, all it does is get the player's position and the position of thetarget object indicated by %targetObj, adjusts the z value to prevent the player from
falling through the terrain and sends him to the %finalPos position.
Now lets look at the trigger, I've made a new file "fps/server/teleportTrigger.cs" which I execute in
"fps/server/game.cs" (as always), and it looks like this:
datablock TriggerData(TeleportTrigger)
{
tickPeriodMS = 500;
};
datablock AudioProfile(TeleportBuzz)
{
fileName = "~/data/sound/fx/electricity.wav";
description = AudioClose3d;
preload = true;
};
function TeleportTrigger::onEnterTrigger(%data, %obj, %colObj)
{
%checkname = %obj.getName();
%client = %colObj.client;
if(!%client)
{
echo("not a client!");
return;
}
echo("Teleport client:" SPC %client);
if(%checkname $= "TeleportTrigger1")
{
// if the player didn't recently beam over here... otherwise
// he would be looping around between the two, I guess...
if(!$from2to1)
{
%target = "TeleportTrigger2";
CommandToClient(%client,'bottomprint',"Teleporter initializing... good luck!!",2,10);
$teleSched = schedule(2000,0,"goScotty",%client,%target);
$teleSound = serverPlay3D(TeleportBuzz,%client.player.getTransform());
%client.player.setCloaked(true);
$from1to2 = true;
$from2to1 = false;
}
}
else
{
if(!$from1to2)
{
%target = "TeleportTrigger1";
CommandToClient(%client,'bottomprint',"Teleporter initializing... good luck!!",2,10);
$teleSched = schedule(2000,0,"goScotty",%client, %target);
$teleSound = serverPlay3D(TeleportBuzz,%client.player.getTransform());
%client.player.setCloaked(true);
$from2to1 = true;
$from1to2 = false;
}
}
}
function TeleportTrigger::onLeaveTrigger(%data, %obj, %colObj)
{
%checkname = %obj.getName();
%client = %colObj.client;
echo("TeleportTrigger::onLeaveTrigger called!");
cancel($teleSched);
alxStop($teleSound);
%client.player.setCloaked(false);
// if the player leaves the target trigger,
// he can use it, too...
if(%checkname $= "TeleportTrigger1")
{
$from2to1 = false;
}
else if(%checkname $= "TeleportTrigger2")
{
$from1to2 = false;
}
}
function goScotty(%client, %target)
{
echo("goScotty called!");
// beam me up!
commandToServer('TeleportPlayer', %client, %target);
}
function TeleportTrigger::onTickTrigger(%data, %obj)
{
}I've got two trigger objects in my mission file named "TeleportTrigger1" and "TeleportTrigger2",
furthermore there are the two shape files, which have their own datablock (btw., I took these shapefiles
and their datablock file "fxShapes.cs" from the latest RWTA build - thanks Phil :-).
Here is the datablock:
datablock StaticShapeData(MeshEffect)
{
category = "Effects";
shapeFile = "~/data/shapes/markers/flame.dts";
};I use two vars "$from1to2" and "$from2to1" to keep track if the player already was teleported to therecent teleport, and if he was, he has to step out of it (onLeaveTrigger), before he can use it again...
otherwise he would be trapped, I guess... ;-)
To make it more realistic and to not just move the player, I put a little timeout of two seconds in,
and, what adds quite a lot to it, I set
%client.player.setCloaked(true);which kinda fades the player out and makes him semi-transparent, and after he's teleported, he "fades back in"... make sure to try it in 3rd person perspective...!! :-)
So here is how all that looks in my mission file:
new StaticShape(TeleportEffect1) {
position = "-27.6876 21.0268 100.362";
rotation = "1 0 0 90.5273";
scale = "1 1 1";
dataBlock = "MeshEffect";
};
new ParticleEmitterNode(TeleportParticle1) {
position = "-27.1392 22.8644 101.253";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "defaultParticleEmitterNode";
emitter = "TeleportEmitter";
velocity = "1";
};
new StaticShape(TeleportEffect2) {
position = "-28.3129 125.469 100.391";
rotation = "1 0 0 90.5273";
scale = "1 1 1";
dataBlock = "MeshEffect";
};
new ParticleEmitterNode(TeleportParticle2) {
position = "-28.3129 127.069 101.391";
rotation = "1 0 0 0";
scale = "1 1 1";
dataBlock = "defaultParticleEmitterNode";
emitter = "TeleportEmitter";
velocity = "1";
};
new Trigger(TeleportTrigger2) {
position = "-29.4077 128.417 99.849";
rotation = "1 0 0 0";
scale = "3 2 2";
dataBlock = "TeleportTrigger";
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";
};
new Trigger(TeleportTrigger1) {
position = "-29.2559 23.685 99.5474";
rotation = "1 0 0 0";
scale = "3 2 2";
dataBlock = "TeleportTrigger";
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";
};The ParticleEmitter looks like this, I keep all of my particle stuff in a file named "customParticles.cs",
which is also executed in ... well, you guess it!
datablock ParticleData(TeleportParticle)
{
dragCoefficient = 1.11437;
gravityCoefficient = -0.735043;
windCoefficient = 0;
inheritedVelFactor = 0.483366;
constantAcceleration = 0;
lifetimeMS = 1056;
lifetimeVarianceMS = 256;
useInvAlpha = 0;
spinRandomMin = -159;
spinRandomMax = 172;
textureName = "fps/data/shapes/rifle/smokeParticle";
times[0] = 0;
times[1] = 1;
colors[0] = "0.102362 0.070866 0.000000 0.370079";
colors[1] = "0.000000 0.102362 0.000000 0.740157";
sizes[0] = 6.08863;
sizes[1] = 0;
};
datablock ParticleEmitterData(TeleportEmitter)
{
ejectionPeriodMS = 10;
periodVarianceMS = 2;
ejectionVelocity = 2.75;
velocityVariance = 1.62;
ejectionOffset = 0;
thetaMin = 47;
thetaMax = 90;
phiReferenceVel = 144;
phiVariance = 360;
overrideAdvances = 0;
orientParticles= 0;
orientOnVelocity = 1;
particles = "TeleportParticle";
};Okay, so here are the "step-by-step" instructions...
1) download the zip :-P
2) put flame.dts and flame.png in "fps\data\shapes\markers"
3) put electricity.wav in "\fps\data\sound\fx"
4) put fxShapes.cs, teleportTrigger.cs and customParticles.cs in "fps\server\scripts"
5) put
exec("./teleportTrigger.cs");
exec("./customParticles.cs");
exec("./fxShapes.cs");in "fps\server\scripts\game.cs"6) put the function serverCmdTeleportPlayer(%client, %targetObj) in "fps\server\scripts\commands.cs"
7) add all the objects needed to your mission file (use the world editor by pressing F11 -> F4)
Note: it may be hard to add and place the particle emitters in the editor, so if you have problems, simply add
the shapes and the triggers with the editor, then save your mission and add the emitters manually - you can copy
the positions of the triggers and then adjust them later in the editor).
Well, as always, hope you enjoyed it - happy teleporting! :-))
PLEASE NOTE: The download file available here comes without the sound file for the effect (too large for the resource), but you can find this tutorial and ALL the files here!
EDIT: Fixed the multiplayer issues, everything is working now in multiplayer, too! The zip files here and on our website have been updated! Thanks to Ed Gardner who helped me out on IRC! :-)
#2
07/07/2002 (8:36 am)
EDIT: Multiplayer probs fixed (see above)! :-)
#3
Okay folks, to increase the fun factor I've written a new trigger file which supports multiple triggers - as many as you want! :-)
And the best thing is, you don't have to change anything in the script, you simply execute it at startup (as always), and you add your trigger, shape and particle objects in the editor (press F11, if you've already added
the objects like I described above, you can simply select a group of them [trigger, particle effect and shape] in the top right
editor pane by holding SHIFT, then CTRL-C, CTRL-V, rename them from "TeleportTrigger2",... to "TeleportTriggerX",...),
and that's it!
The only important thing is that the triggers have to be named "TeleportTrigger1" ... "TeleportTriggerN", cause the script is iterating over the MissionGroup to find them through a string compare function!
Of course, you have to change your trigger datablock from
So here is the new script, but it's also included in the updated zip file (multiTeleportTrigger.cs)!
07/07/2002 (2:43 pm)
UPDATE (08. July 2002, 11:40pm):Okay folks, to increase the fun factor I've written a new trigger file which supports multiple triggers - as many as you want! :-)
And the best thing is, you don't have to change anything in the script, you simply execute it at startup (as always), and you add your trigger, shape and particle objects in the editor (press F11, if you've already added
the objects like I described above, you can simply select a group of them [trigger, particle effect and shape] in the top right
editor pane by holding SHIFT, then CTRL-C, CTRL-V, rename them from "TeleportTrigger2",... to "TeleportTriggerX",...),
and that's it!
The only important thing is that the triggers have to be named "TeleportTrigger1" ... "TeleportTriggerN", cause the script is iterating over the MissionGroup to find them through a string compare function!
Of course, you have to change your trigger datablock from
dataBlock = "TeleportTrigger";to
dataBlock = "MultiTeleportTrigger";
So here is the new script, but it's also included in the updated zip file (multiTeleportTrigger.cs)!
$numTeleports = 0;
datablock TriggerData(MultiTeleportTrigger)
{
tickPeriodMS = 500;
};
function MultiTeleportTrigger::onEnterTrigger(%data, %obj, %colObj)
{
if($numTeleports == 0)
{
// search for Triggers by their name once, so every trigger
// which has "TeleportTrigger" in its name is counted
$numTeleports = getMultiTriggerCount("TeleportTrigger");
echo("$numTeleports:" SPC $numTeleports);
}
%checkname = %obj.getName();
%client = %colObj.client;
if(!%client)
{
echo("not a client!");
return;
}
// if the player didn't recently beam over here... otherwise
// he would be looping around between the two, I guess...
if(%checkname !$= $currMultiTeleTrigger)
{
// pick random number, the teleport names start from 1,
// so if the random number is zere, simply take the last teleport:
%rand = getRandom($numTeleports) == 0 ? 1 : $numTeleports;
%target = "TeleportTrigger" @ %rand;
// we don't want to stay where we are...
if(%target $= %checkName)
{
// ... so increase or decrease the random number by 1
%rand = %rand+1 > $numTeleports ? %rand-1 : %rand+1;
%target = "TeleportTrigger" @ %rand;
}
echo("*** TELEPORT TARGET:" SPC %target);
CommandToClient(%client,'bottomprint',"Teleporter initializing... good luck!!",2,10);
$teleSched = schedule(2000,0,"goScotty",%client,%target);
$teleSound = serverPlay3D(TeleportBuzz,%client.player.getTransform());
%client.player.setCloaked(true);
// save the target - until the teleported client leaves it, then reset
$currMultiTeleTrigger = %target;
}
}
function MultiTeleportTrigger::onLeaveTrigger(%data, %obj, %colObj)
{
%checkname = %obj.getName();
%client = %colObj.client;
cancel($teleSched);
alxStop($teleSound);
%client.player.setCloaked(false);
// if the player leaves the target trigger,
// he can use it again, too... so reset the global var
if(%checkname $= $currMultiTeleTrigger)
{
$currMultiTeleTrigger = "";
}
}
function MultiTeleportTrigger::onTickTrigger(%data, %obj)
{
}
// *********************************
// Helper functions
// *********************************
// do the teleport
function goScotty(%client, %target)
{
echo("goScotty called!");
// beam me up!
commandToServer('TeleportPlayer', %client, %target);
}
// find the number of teleport triggers by name comparison
function getMultiTriggerCount(%name)
{
%dataGroup = "MissionGroup";
%triggerCount = 0;
for(%i = 0; %i < %dataGroup.getCount(); %i++)
{
%obj = %dataGroup.getObject(%i);
if(%obj.getClassName() !$= "Trigger")
{
// no trigger!
continue;
}
if((strStr(%obj.getDatablock().getName(), %name) != -1) && isObject(%obj))
{
echo(%i SPC "Found Trigger:" SPC %obj.getName());
%triggerCount++;
}
}
return %triggerCount;
}
#4
07/08/2002 (11:08 am)
Very nice Stefan! I'm going to try them out post haste :) But couldn't find them on your site :( Nice looking site BTW--you've been making some nice changes.
#5
Yeah, I think you have to be registered to access the tutorials or the downloads on our site (maybe we should change that, at least for the tutorials...?) - you can find it in both sections now after registering (all you need for this is a name and a valid email address to send you the access password) ...
drop me an email if you don't want to register ... (but why shouldn't you... ;-))
07/09/2002 (1:06 am)
Thanks Desmond! :-) iko does a great job on enhancing and extending our site :-)Yeah, I think you have to be registered to access the tutorials or the downloads on our site (maybe we should change that, at least for the tutorials...?) - you can find it in both sections now after registering (all you need for this is a name and a valid email address to send you the access password) ...
drop me an email if you don't want to register ... (but why shouldn't you... ;-))
#6
Very cool. I tried it out last night. Both the 2 teleport and the multi-teleport versions. I could see where both would be useful. The 2 if you want to make sure of the destination and the multi for random - sweet.
Not a big deal, but I didn't see where the electricity sound file was on your site. I'll use my own sfx anyway but thought I'd mention it. I did register :)
Again - nice job.
-Sabrecyd
07/09/2002 (4:55 am)
Hey Stefan,Very cool. I tried it out last night. Both the 2 teleport and the multi-teleport versions. I could see where both would be useful. The 2 if you want to make sure of the destination and the multi for random - sweet.
Not a big deal, but I didn't see where the electricity sound file was on your site. I'll use my own sfx anyway but thought I'd mention it. I did register :)
Again - nice job.
-Sabrecyd
#7
thanks for your positive feedback, I appreciate it! :-)
As for the soundfile, it is in the zip file you can download from our site - either on the tutorial page itself or in our "Downloads/Scripts" section...
If I find out how to find the TriggerObjects in C++, I'll add a GUI with a map showing the trigger locations on it which you can select then as your destination ... so it could become a "futuristic transportation system"... ;-)
07/09/2002 (5:03 am)
Sabrecyd-thanks for your positive feedback, I appreciate it! :-)
As for the soundfile, it is in the zip file you can download from our site - either on the tutorial page itself or in our "Downloads/Scripts" section...
If I find out how to find the TriggerObjects in C++, I'll add a GUI with a map showing the trigger locations on it which you can select then as your destination ... so it could become a "futuristic transportation system"... ;-)
#8
Yeah, that "transportation system" would rock.
Funny, you'll have a bunch of comments before this resource is even officially posted :)
07/09/2002 (5:37 am)
I can tell yesterday was Monday. Just looked at your site again and saw the download section with the zip files. I think what I did was download the zip from the GG site and was looking for just the wav file on your site to add. What can I say other then it was Monday ;)Yeah, that "transportation system" would rock.
Funny, you'll have a bunch of comments before this resource is even officially posted :)
#9
As for the download: yup, the one in the "Scripts" section is new, I just added it there today... but the download on the tutorial page was in there from the start... ;-)
07/09/2002 (5:49 am)
Yeah, that's funny... ;-) don't know what takes so long to get it "official", though ... looks like the GG guys aren't around much lately, everything is going really slow here at the moment - or maybe I'm just impatient... ;-P ?As for the download: yup, the one in the "Scripts" section is new, I just added it there today... but the download on the tutorial page was in there from the start... ;-)
#10
07/09/2002 (12:11 pm)
I think I see why the GG guys haven't been around much lately. Have you checked the newest HEAD (checked in 7-09-02)? I updated my engine to the HEAD version yesterday and there must be another 140 file updates today. Wow... Maybe I'll just wait for the 1.1.2 release to update everything again.
#11
I've added a 'TeleportGUI' which now lets you select the destination - it pops up when you enter a teleport, and after you click on one of the destinations you get teleported over there...
I will post it here as an addon (.cc,.h. files, new trigger file, some test bitmaps) so that you can use all 3 versions (2 teleports, multi-teleports and "multiple-choice-teleport") and don't have to replace anything...
Here is a screenshot of an early version with a temporary (and yet to be improved ;-) GUI ...
07/09/2002 (4:07 pm)
Hey there, got another update for this...I've added a 'TeleportGUI' which now lets you select the destination - it pops up when you enter a teleport, and after you click on one of the destinations you get teleported over there...
I will post it here as an addon (.cc,.h. files, new trigger file, some test bitmaps) so that you can use all 3 versions (2 teleports, multi-teleports and "multiple-choice-teleport") and don't have to replace anything...
Here is a screenshot of an early version with a temporary (and yet to be improved ;-) GUI ...
#12
"TeleportGui", you can find it in the "Tutorials" section of our website ...
All the necessary file are available as zip, so you should be ready to go after downloading!
Let me know if you have any problems!
Have fun! :-)
07/10/2002 (2:20 am)
Ok, so I've written a little tutorial explaining the new"TeleportGui", you can find it in the "Tutorials" section of our website ...
All the necessary file are available as zip, so you should be ready to go after downloading!
Let me know if you have any problems!
Have fun! :-)
#13
07/10/2002 (5:09 am)
You've certainly kept busy the last couple of days :) I'll give this a try tonight. That initial screenshot you show above looks good already. I updated to the HEAD 7-09-02 engine last night and was testing it out. Pretty funny when a bot runs into one of those teleports.
#14
I had some compile problems with the .cc file. It seems like a function - dglDrawBitmapRotated() - is missing or not defined. Does the guiMapCtrlExt stuff that you and Frank did need to be implemented first?
-Sabrecyd
07/11/2002 (4:50 am)
Stefan,I had some compile problems with the .cc file. It seems like a function - dglDrawBitmapRotated() - is missing or not defined. Does the guiMapCtrlExt stuff that you and Frank did need to be implemented first?
-Sabrecyd
#15
Sorry bout that... the function has to be added to "dgl/dgl.cc" (and declared in dgl.h respectively) and looks like this:
thanks for the heads up!
07/11/2002 (5:09 am)
Heck, yes!Sorry bout that... the function has to be added to "dgl/dgl.cc" (and declared in dgl.h respectively) and looks like this:
//*********
void dglDrawBitmapRotated(TextureObject *texture,const RectI& dstRect,const RectI& srcRect,const U32 in_flip,F32 spinAngle)
{
AssertFatal(texture != NULL, "GSurface::drawBitmapStretchSR: NULL Handle");
if(!dstRect.isValidRect())
return;
AssertFatal(srcRect.isValidRect() == true,
"GSurface::drawBitmapRotated: routines assume normal rects");
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, texture->texGLName);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDisable(GL_LIGHTING);
F32 texLeft = F32(srcRect.point.x) / F32(texture->texWidth);
F32 texRight = F32(srcRect.point.x + srcRect.extent.x) / F32(texture->texWidth);
F32 texTop = F32(srcRect.point.y) / F32(texture->texHeight);
F32 texBottom = F32(srcRect.point.y + srcRect.extent.y) / F32(texture->texHeight);
F32 screenLeft = dstRect.point.x;
F32 screenRight = dstRect.point.x + dstRect.extent.x;
F32 screenTop = dstRect.point.y;
F32 screenBottom = dstRect.point.y + dstRect.extent.y;
if(in_flip & GFlip_X)
{
F32 temp = texLeft;
texLeft = texRight;
texRight = temp;
}
if(in_flip & GFlip_Y)
{
F32 temp = texTop;
texTop = texBottom;
texBottom = temp;
}
glColor4ub(sg_bitmapModulation.red,
sg_bitmapModulation.green,
sg_bitmapModulation.blue,
sg_bitmapModulation.alpha);
F32 X = 0;
// calculate the centroid of the rectangle (to use as rotation pivot)
if (screenLeft < screenRight)
{
X = screenLeft + ((screenRight - screenLeft)*0.5f);
}
else
{
X = screenRight + ((screenLeft - screenRight)*0.5f);
};
F32 Y = 0;
if (screenTop < screenBottom)
{
Y = screenTop + ((screenBottom - screenTop)*0.5f);
}
else
{
Y = screenBottom + ((screenTop - screenBottom)*0.5f);
};
// spin angle is in degree's so convert to radians..radians = degrees * pi /180
spinAngle = spinAngle * 3.14 / 180.0f;
Point2F screenPoint(X,Y);
F32 width = dstRect.extent.x;
width *= 0.5;
MatrixF rotMatrix( EulerF( 0.0, 0.0, spinAngle ) );
Point3F offset( screenPoint.x, screenPoint.y, 0.0 );
Point3F points[4];
points[0] = Point3F(-width, -width, 0.0);
points[1] = Point3F(-width, width, 0.0);
points[2] = Point3F( width, width, 0.0);
points[3] = Point3F( width, -width, 0.0);
for( int i=0; i<4; i++ )
{
rotMatrix.mulP( points[i] );
points[i] += offset;
}
glBegin(GL_TRIANGLE_FAN);
glTexCoord2f(texLeft,texTop);
glVertex2fv(points[0]);
glTexCoord2f(texLeft, texBottom);
glVertex2fv(points[1]);
glTexCoord2f(texRight, texBottom);
glVertex2fv(points[2]);
glTexCoord2f(texRight, texTop);
glVertex2fv(points[3]);
glEnd();
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
}Sorry again, I will update my tutorials ...thanks for the heads up!
#16
I'll give this another try tonight.
Thanks for the fast reply.
edit:
Almost forgot, not expecting a reply already :)
Where does the defaultProfiles.cs file come in to play with this? I assume that needs to be executed too. Might want to add that short procedure with your other .cs explanations when you update your tutorial. Maybe I missed it, but I didn't see it mentioned any place.
edit2:
Ahh..found it. replace the defaultProfiles.cs file in the \common\ui folder. Correct?
07/11/2002 (5:34 am)
lol, just looking through the guiMapCtrlExt and Radar/compass stuff again to see what was going on (backtracking through some notes I have) - looks like this came up before :)I'll give this another try tonight.
Thanks for the fast reply.
edit:
Almost forgot, not expecting a reply already :)
Where does the defaultProfiles.cs file come in to play with this? I assume that needs to be executed too. Might want to add that short procedure with your other .cs explanations when you update your tutorial. Maybe I missed it, but I didn't see it mentioned any place.
edit2:
Ahh..found it. replace the defaultProfiles.cs file in the \common\ui folder. Correct?
#17
so I included it in case anybody would need one of the font definitions... but you can always simply change the fonts in the GUI, guess that's easier... does it work for you besides this?
07/11/2002 (10:34 am)
Not necessarily... I just couldn't remember if the fonts profiles I've used are "standard" font profiles or custom stuff I've made sometime...so I included it in case anybody would need one of the font definitions... but you can always simply change the fonts in the GUI, guess that's easier... does it work for you besides this?
#18
I will certainly give it a shot and see how it goes. I'm sure with that added dgl function it will work great :)
07/11/2002 (10:52 am)
I haven't tried it yet today. I'm at work right now, so I won't be able to try it out until later :(I will certainly give it a shot and see how it goes. I'm sure with that added dgl function it will work great :)
#19
Now i have to figger out how to do the multiple teleports so they go to a specified port, right now it seems like its random, (probably cuz i did all 3 tuts in the same head version). You ROCK dude.
thanks
07/15/2002 (6:43 am)
heh, good job man,although it took me three trys to get teleported, i never done any triggers before, so it took me awhile to grasp the concept for them. Now that i have it working i will want to get rid of the the delay and the message print and make it instant.Now i have to figger out how to do the multiple teleports so they go to a specified port, right now it seems like its random, (probably cuz i did all 3 tuts in the same head version). You ROCK dude.
thanks
#20
Well, if you've already implemented the guiTeleportCtrl (just updated it some hours ago, there were some engine changes missing...), all you have to do to change the random teleports to the selectable ones with the GUI is to change
07/15/2002 (6:57 am)
:-) Thanks, ACE, I'm glad you like it!Well, if you've already implemented the guiTeleportCtrl (just updated it some hours ago, there were some engine changes missing...), all you have to do to change the random teleports to the selectable ones with the GUI is to change
dataBlock = "TeleportTrigger";or
dataBlock = "MultiTeleportTrigger";to
dataBlock = "TargetTeleportTrigger";in your mission file - then the gui should come up if you trigger a teleport... getting rid of the delay and the message print shouldn't be any problem... I'm sure you've already found the relevant parts in the scripts... if not, let me know!

Torque Owner Desmond Fletcher
fletcher