Radar/Map/Compass Control Update (GuiRadarCtrl)
by James Laker (BurNinG) · 07/03/2006 (11:33 am) · 74 comments
Download Code File
Just updated and cleaned the Scrolling Map, Radar, Compass gui Control resource a little.
- Now Works with TGE 1.4 to TGE 1.5.1 out of the box.
- Can Turn the Radar, Map and Compass On/Off in the GUI Editor
- Select Bitmaps in the GUI Editor (not Hardcoded anymore)
- Can Change Blip Colors in the GUI Editor
- Can Change ViewAngleLine Colors of the Map in the GUI Editor
- Can Turn the ViewAngle On and Off in GUI Editor
- Can Set the Radar Range in GUI Editor (F10)
To install and use:
1) Backup old guiRadarCtrl.h/guiRadarCtrl.cc
2) Add the files from this resource (Note that the gui Directories in TGE1.4 changed)
3) Recompile
4) In the GUI editor (F10) add the GuiRadarCtrl
Advanced Camera: - Thanx OneST8
To use with the advanced camera just change line 312 in guiRadarCtrl.cc:
Credits Thor Zollinger/Matt Webster for the original resources!
Just updated and cleaned the Scrolling Map, Radar, Compass gui Control resource a little.
- Now Works with TGE 1.4 to TGE 1.5.1 out of the box.
- Can Turn the Radar, Map and Compass On/Off in the GUI Editor
- Select Bitmaps in the GUI Editor (not Hardcoded anymore)
- Can Change Blip Colors in the GUI Editor
- Can Change ViewAngleLine Colors of the Map in the GUI Editor
- Can Turn the ViewAngle On and Off in GUI Editor
- Can Set the Radar Range in GUI Editor (F10)
To install and use:
1) Backup old guiRadarCtrl.h/guiRadarCtrl.cc
2) Add the files from this resource (Note that the gui Directories in TGE1.4 changed)
3) Recompile
4) In the GUI editor (F10) add the GuiRadarCtrl
Advanced Camera: - Thanx OneST8
To use with the advanced camera just change line 312 in guiRadarCtrl.cc:
//conn->getControlCameraTransform(0,&cam); // store camera informationto this:
control->getEyeTransform(&cam);
Credits Thor Zollinger/Matt Webster for the original resources!
About the author
#2
If so. What does your console.log say?
I'll try it on a clean installation and see if i have missed anything.
04/28/2006 (12:25 am)
Rar? You Mean the Zip?If so. What does your console.log say?
I'll try it on a clean installation and see if i have missed anything.
#3
05/02/2006 (12:00 am)
console.log say nothing about guiRadarControl. I've tried on a clean installation, add guiRadarControl.h and guiRadarControl.cc to project, then I recompiled it. Then i run my game, go into Gui Editor and add the GuiRadarCtrl, and it still crashed
#4
TextureObject* texture = (TextureObject *) mRadarTextureHandle;
glBindTexture(GL_TEXTURE_2D, texture->texGLName);
it can't create the texture object here, so when you use texture->texGLName, it crashed :D
05/02/2006 (12:49 am)
i debugged the program and found that error is in function onRender()TextureObject* texture = (TextureObject *) mRadarTextureHandle;
glBindTexture(GL_TEXTURE_2D, texture->texGLName);
it can't create the texture object here, so when you use texture->texGLName, it crashed :D
#5
{
mBitmapName = StringTable->insert(name);
if (*mBitmapName)
{
mMap = TextureHandle(mBitmapName, BitmapTexture, true);
// Path to radar images
mCompass = TextureHandle("fps/client/ui/compass", BitmapTexture, true);
mTextureHandle = TextureHandle("fps/client/ui/radar_base", BitmapTexture, true);
}
else
{
// Reset handles if UI object is hidden
mTextureHandle = NULL;
mCompass = NULL;
mMap = NULL;
}
setUpdate();
}
when i created a GuiRadarCtrl in game, *name = "", so this function will set mTextureHandle = NULL, that's the problem. How can i fix this ???
05/02/2006 (4:31 am)
void GuiRadarCtrl::setBitmap(const char *name){
mBitmapName = StringTable->insert(name);
if (*mBitmapName)
{
mMap = TextureHandle(mBitmapName, BitmapTexture, true);
// Path to radar images
mCompass = TextureHandle("fps/client/ui/compass", BitmapTexture, true);
mTextureHandle = TextureHandle("fps/client/ui/radar_base", BitmapTexture, true);
}
else
{
// Reset handles if UI object is hidden
mTextureHandle = NULL;
mCompass = NULL;
mMap = NULL;
}
setUpdate();
}
when i created a GuiRadarCtrl in game, *name = "", so this function will set mTextureHandle = NULL, that's the problem. How can i fix this ???
#6
I'll bring the correct stuph tomorrow...
You can smack me around now ;)
05/02/2006 (5:43 am)
That's the old code.... I think I zipped up my backups :-oI'll bring the correct stuph tomorrow...
You can smack me around now ;)
#7
05/02/2006 (12:33 pm)
thank you. Can you send your new files to my mail box (tibuchivn@gmail.com)? :D, thankx in advanced! :)
#8
05/03/2006 (1:14 am)
Updated the file, and mailed you a copy...
#9
05/03/2006 (3:03 am)
are GuiRadarCtrl.cc (14.616kb) and GuiRadarCtrl.h (2.410) correct?
#10
05/03/2006 (3:42 am)
Yup...
#11
05/03/2006 (3:56 am)
hmmm...still crashes, but thats maybe because im using 1.3
#13
05/03/2006 (7:22 am)
ive already corrected the things he said and it compiles fine, but when i add the radar control to the playGUI the game crashes
#14
05/03/2006 (9:30 am)
still be crashed at the same time, same reason :(
#15
05/03/2006 (9:38 am)
there's no difference between your first files and these files :( (i used WinMerge to check diff, and no diff :()
#16
//if (mMap) {
if (mMapTextureHandle && mMap) { //TUNG EDIT
//else if (mRadar) {
else if (mRadarTextureHandle && mRadar) { //TUNG EDIT
if (mCompassTextureHandle && mCompass) {
plz check it for me., thankx :D
05/03/2006 (10:38 am)
i edited these lines, no crash but sth wrong :D//if (mMap) {
if (mMapTextureHandle && mMap) { //TUNG EDIT
//else if (mRadar) {
else if (mRadarTextureHandle && mRadar) { //TUNG EDIT
if (mCompassTextureHandle && mCompass) {
plz check it for me., thankx :D
#17
05/03/2006 (11:11 am)
hehe, it's ok now
#18
Still works on my version, so I hope that is the only problem...
BTW! There must've been a difference between the 2 sets of files! I have nothing hardcoded.
Updated Files (and included the Images)
05/04/2006 (12:25 am)
Aha... well spotted... Thanx!Still works on my version, so I hope that is the only problem...
BTW! There must've been a difference between the 2 sets of files! I have nothing hardcoded.
Updated Files (and included the Images)
#19
05/04/2006 (2:48 am)
ok cool, its working now :-)
#20
05/29/2006 (10:21 pm)
Nice worked for me out of the box (err if there was a box), and saved a lot of time for me (<= (: I is a greatful rookie :)=>).
Torque Owner Tuanlucky