Game Development Community

(simple) question

by Very Interactive Person · in Torque Game Engine · 08/20/2001 (11:52 am) · 6 replies

may sound stupid, but i'm no programmer after all.. so i guess i'm alloud to ask stupid questions.. hehe

is it possible to get a text printed on the screen? i'd like to know the simplest way of doing it...

#1
08/20/2001 (12:11 pm)
messageAll(NULL,"holy shazbot"); for all clients
#2
08/20/2001 (12:20 pm)
but for one player alone?
here's what i want to do in server/scripts/game.cs there are these 2 functions:

function onLeaveMissionArea(%obj)
{
echo( "Left mission area" ); //added by me
}

function onEnterMissionArea(%obj)
{
echo( "Entering mission area" ); //idem
}


i used the echo to test if it works... mission area is small , but it works.. so now i want a message on the screen to appear.. and preferably die after hanging around to much outside the mission area...

some comments about the mission area:
it seems extremely small... i think its much bigger in tribes 2.. anyone any ideas on how to fix that?
#3
08/21/2001 (12:02 am)
You can edit the size in the map editor. Press f11. You should read a tutorial on it.

The centerPrint function is an in-your-face kind of message. People won't miss it as easily as they would if it was in the chat hud.

centerPrint(%obj.client, "You have left the mission area.", 5);

The 5 is how long it stays on the screen, I'm not sure if it uses seconds or milliseconds.

I think you can change the fonts and font sizes too. I don't think the v12 came with amny fonts, I haven't checked yet.


Dark
#4
08/21/2001 (12:49 am)
v12 (along with T2) should be able to use any TTF on your system.


It will generate a .gft file for each size you use for distribution.
#5
08/21/2001 (4:06 am)
the centerprint doesn't work for me... even added the echo again to see if it still executes that file properly... and yes, it still apears in the console, but nothing on the screen. Also tried 500 in case it are miliseconds... still no luck.
#6
08/23/2001 (10:52 pm)
in player.cs at about line 907 you will find two functions, onLeaveMissionArea and onEnterMissionArea which are empty. Fill them with the following code:

function onLeaveMissionArea(%obj) 
{ 
   messageClient(%obj.client,"","\c4**WARNING You have left the mission area!**"); 
} 

function onEnterMissionArea(%obj) 
{ 
   messageClient(%obj.client,"","\c4**You have reentered the mission area.**"); 
}