Game Development Community

WoW Player Control Emulation

by James Spellman · 09/05/2006 (11:22 pm) · 88 comments

Download Code File

Objectives

1. Mouse-over usable objects. Highlights them and change the cursor.
2. Select things with the left mouse-down/up.
3. Use things with the right mouse-down/up.
4. Drag with either left or right mouse-down handles yaw/pitch.
5. Cursor should be visible for all but item 4.

References

The object selection code came from Updated Object Selection (with TLK bonus). Other code came from playing with the World Editor and probably other forum posts I've since forgotten about.

Assets

CUR_blank.png - Blank cursor placed in the client\ui folder.
CUR_grab.png - Found in creator\editor, placed in the client\ui folder.
CUR_hand.png - Found in creator\editor, placed in the client\ui folder.

Engine Files Affected

engine\game\gameTSCtrl.h
engine\game\gameTSCtrl.cc
engine\game\shapeBase.h
engine\game\shapeBase.cc
engine\gui\core\guiCanvas.h
engine\gui\core\guiCanvas.cc

Script Files Affected

client\scripts\client\config.cs
client\scripts\default.bind.cs
client\ui\defaultGameProfiles.cs
client\ui\playGui.gui
client\config.cs

Directions

Changed code will be in bold.

Step 1 - Replace gameTSCtrl

Completely replace gameTSCtrl.cc and gameTSCtrl.h. Be warned! You'll lose the snapToggle debug code in the process.

File: gameTSCtrl.h
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

#ifndef _GAMETSCTRL_H_
#define _GAMETSCTRL_H_

#ifndef _DGL_H_
#include "dgl/dgl.h"
#endif
#ifndef _GAME_H_
#include "game/game.h"
#endif
#ifndef _GUITSCONTROL_H_
#include "gui/core/guiTSControl.h"
#endif
#ifndef _EDITTSCTRL_H_
#include "editor/editTSCtrl.h"
#endif
#ifndef _ITICKABLE_H_
#include "core/iTickable.h"
#endif

class ShapeBase;

//----------------------------------------------------------------------------
class GameTSCtrl : public GuiTSCtrl, public virtual ITickable {
private:
   typedef GuiTSCtrl Parent;

	// cursor constants
	enum {
		DefaultCursor = 0,
		HandCursor,
		UseCursor,
		MoveCursor,
		//
		NumCursors
	};

	Point3F	smCamPos;
	Gui3DMouseEvent mLastEvent;
	Point2I	lastCursor;

	bool doUpdate;	// Limits the update rate to the tick rate
	bool canDrag;	// Allows dragging only if MouseDown was on this object
	ShapeBase* mTrackObject;	// Last mouse-down object
	ShapeBase* mCursorObject;	// The object under cursor

protected:
    // These three methods are the interface for ITickable
    virtual void interpolateTick( F32 delta);
    virtual void processTick( void);
    virtual void advanceTime( F32 timeDelta);

public:
	F32	mProjectDistance;	// Distance we can select things

	GuiCursor*	mCursors[NumCursors];
	GuiCursor*	mCurrentCursor;

	GameTSCtrl( void);

	bool processCameraQuery( CameraQuery *query);
	void renderWorld( const RectI &updateRect);

	void onMouseDown( const GuiEvent &event);
	void onMouseUp( const GuiEvent &event);
	void onMouseMove( const GuiEvent &evt);
   void onMouseDragged( const GuiEvent &event);

	void onRightMouseDown( const GuiEvent &event);
	void onRightMouseUp( const GuiEvent &event);
   void onRightMouseDragged( const GuiEvent &event);

	void onRender( Point2I offset, const RectI &updateRect);

	DECLARE_CONOBJECT(GameTSCtrl);

	bool onAdd( void);

	bool grabCursors( void);
	void setCursor( U32 cursor);

	void make3DMouseEvent( Gui3DMouseEvent &gui3DMouseEvent, const GuiEvent &event);
	void on3DMouseMove( const Gui3DMouseEvent &event);

	ShapeBase* collide( const Gui3DMouseEvent &event);
};

#endif

File: gameTSCtrl.cc
//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------

#include "game/gameTSCtrl.h"
#include "game/gameConnection.h"
#include "gui/core/guiCanvas.h"

bool useObjectHighlite = true;

//----------------------------------------------------------------------------
// Class: GameTSCtrl
//----------------------------------------------------------------------------
IMPLEMENT_CONOBJECT(GameTSCtrl);

GameTSCtrl::GameTSCtrl() {
	mProjectDistance = 50.f;	// Distance we can select things

	mCursorObject = NULL;	// Last mouse-down object
	mTrackObject = NULL;		// The object under cursor
	
	doUpdate = false;	// Limits the update rate to the tick rate
	canDrag = false;	// Allows dragging only if MouseDown was on this object

   mProcessTick = true;	// Enables processTick calls
}

//---------------------------------------------------------------------------
bool GameTSCtrl::processCameraQuery( CameraQuery *camq) {
	GameUpdateCameraFov();
	bool ret = GameProcessCameraQuery( camq);

	// Record the camera's position
	camq->cameraMatrix.getColumn( 3, &smCamPos);

	return ret;
}

//---------------------------------------------------------------------------
void GameTSCtrl::renderWorld( const RectI &updateRect) {
   GameRenderWorld();
   dglSetClipRect( updateRect);
}

void GameTSCtrl::make3DMouseEvent(Gui3DMouseEvent & gui3DMouseEvent, const GuiEvent & evt) {
	(GuiEvent&)(gui3DMouseEvent) = evt;

	// get the eye pos and the mouse vec from that...
	Point3F sp( evt.mousePoint.x, evt.mousePoint.y, 1);

	Point3F wp;
	unproject( sp, &wp);

	gui3DMouseEvent.pos = smCamPos;
	gui3DMouseEvent.vec = wp - smCamPos;
	gui3DMouseEvent.vec.normalize();
}

//---------------------------------------------------------------------------

void GameTSCtrl::onMouseDown( const GuiEvent &evt) {
	lastCursor = Canvas->getCursorPos();
	canDrag = true;

	// Get a new Cursor Object
	make3DMouseEvent( mLastEvent, evt);
	on3DMouseMove( mLastEvent);

	// New Track Object
	mTrackObject = (ShapeBase*)mCursorObject;

	if (mTrackObject)
		setCursor( UseCursor);
}

void GameTSCtrl::onMouseUp( const GuiEvent &evt) {
	make3DMouseEvent( mLastEvent, evt);
	on3DMouseMove( mLastEvent);

	if (mTrackObject) {
		// Select only objects we've tracked
		if (mTrackObject == mCursorObject)
			ShapeBase::setSelected( mTrackObject);
		else
			ShapeBase::setSelected( mTrackObject = NULL);
	} else
		ShapeBase::setSelected( NULL);
	
	// Restore last cursor position
	if (canDrag) {
		Canvas->setCursorPos( lastCursor);
		canDrag = false;
	}
	
	// Keep hand cursor if we've got a Cursor Object
	if (mCursorObject)
		setCursor( HandCursor);
	else
		setCursor( DefaultCursor);
}

void GameTSCtrl::onMouseDragged( const GuiEvent &evt) {
	if (canDrag) {
	
		static const char *argv[2];
		Point2I diff( evt.mousePoint - lastCursor);
	
		// Use Move Cursor if moving
		if (!diff.isZero()) {
			setCursor( MoveCursor);
			
			// If you don't want to continue tracking, use the following:
			// mTrackObject = NULL;
		}
	
		// Perform script-based yaw and pitch callbacks
		if (diff.x) {
			argv[0] = "yaw";
			argv[1] = Con::getFloatArg( diff.x);
			Con::execute( 2, argv);
		}
		if (diff.y) {
			argv[0] = "pitch";
			argv[1] = Con::getFloatArg( diff.y);
			Con::execute( 2, argv);
		}
	
		// HACK - Have GuiCanvas skip next MouseMoveEvent
		Canvas->ignoreNextMove = true;
		Canvas->setCursorPos( lastCursor);
	}
}

void GameTSCtrl::onMouseMove( const GuiEvent &evt) {
	if (doUpdate && useObjectHighlite) {
		doUpdate = false;
	
		// Get a new Cursor Object
		make3DMouseEvent( mLastEvent, evt);
		on3DMouseMove( mLastEvent);

		// Restore Default Cursor if no selectable object under the cursor		
		if (!mCursorObject)
			setCursor( DefaultCursor);
	}
}

//---------------------------------------------------------------------------

void GameTSCtrl::onRightMouseDown( const GuiEvent &evt) {
	lastCursor = Canvas->getCursorPos();
	canDrag = true;

	// Get a new Cursor Object
	make3DMouseEvent( mLastEvent, evt);
	on3DMouseMove( mLastEvent);

	// New Track Object
	mTrackObject = (ShapeBase*)mCursorObject;
	
	if (mTrackObject)
		setCursor( UseCursor);
}

void GameTSCtrl::onRightMouseUp( const GuiEvent &evt) {
	make3DMouseEvent( mLastEvent, evt);
	on3DMouseMove( mLastEvent);

	if (mTrackObject) {
		// Use only objects we've tracked
		if (mTrackObject == mCursorObject)
			mTrackObject->onUse();
		else
			mTrackObject = NULL;
	}

	// Restore last cursor position
	if (canDrag) {
		Canvas->setCursorPos( lastCursor);
		canDrag = false;
	}
	
	// Keep hand cursor if we've got a Cursor Object
	if (mCursorObject)
		setCursor( HandCursor);
	else
		setCursor( DefaultCursor);
}

void GameTSCtrl::onRightMouseDragged( const GuiEvent &evt) {
	onMouseDragged( evt);
}

void GameTSCtrl::onRender( Point2I offset, const RectI &updateRect) {
	CameraQuery camq = mLastCameraQuery;

	// check if should bother with a render
	GameConnection * con = GameConnection::getConnectionToServer();
	bool skipRender = !con || (con->getWhiteOut() >= 1.f) || (con->getDamageFlash() >= 1.f) || (con->getBlackOut() >= 1.f);

	if (!skipRender)
		Parent::onRender( offset, updateRect);

	dglSetViewport( updateRect);

	if (GameProcessCameraQuery( &camq))
		GameRenderFilters( camq);

	// Draw controls after so they aren't affected by the filters. (If we're doing that.)
	if (!skipRender && !mApplyFilterToChildren)
		Parent::renderChildControls( offset, updateRect);
}

bool GameTSCtrl::grabCursors() {
	struct _cursorInfo {
		U32 index;
		const char * name;
	} infos[] = {
		{ DefaultCursor,	"DefaultCursor" },
		{ HandCursor,	"HandCursor" },
		{ UseCursor,	"UseCursor" },
		{ MoveCursor,	"MoveCursor" }
	};

	//
	for(U32 idx = 0; idx < (sizeof(infos) / sizeof(infos[0])); idx++) {
		SimObject * obj = Sim::findObject(infos[idx].name);
		if (!obj) {
			Con::errorf(ConsoleLogEntry::Script, "GameTSCtrl::grabCursors: failed to find cursor '%s'.", infos[idx].name);
			return(false);
		}

		GuiCursor *cursor = dynamic_cast<GuiCursor*>(obj);
		if(!cursor) {
			Con::errorf(ConsoleLogEntry::Script, "GameTSCtrl::grabCursors: object is not a cursor '%s'.", infos[idx].name);
			return(false);
		}

		//
		mCursors[infos[idx].index] = cursor;
	}

	//
	mCurrentCursor = mCursors[DefaultCursor];
	
	return true;
}

void GameTSCtrl::setCursor( U32 cursor) {
	AssertFatal(cursor < NumCursors, "GameTSCtrl::setCursor: invalid cursor");

	mCurrentCursor = mCursors[cursor];
	Canvas->setCursor( mCurrentCursor);
}

ShapeBase* GameTSCtrl::collide( const Gui3DMouseEvent &event) {
   GameConnection* conn = GameConnection::getConnectionToServer();
	if (!conn)
		return false;

	SceneObject* controlObj = conn->getControlObject();
	if (controlObj)
		controlObj->disableCollision();

	//
	Point3F startPnt = event.pos;
	Point3F endPnt = event.pos + event.vec * mProjectDistance;

	//
   static U32 losMask = TerrainObjectType | InteriorObjectType | ShapeBaseObjectType;
	RayInfo ri;
	bool hit = gClientContainer.castRay( startPnt, endPnt, losMask, &ri);

	if (controlObj)
		controlObj->enableCollision();

	if (hit && (ri.object->getTypeMask() & ShapeBaseObjectType))
		return (ShapeBase*)ri.object;
	else
		return NULL;
}

bool GameTSCtrl::onAdd() {
	if (!Parent::onAdd())
		return false;

	// grab all the cursors
	if (!grabCursors())
		return false;

	return true;
}

void GameTSCtrl::on3DMouseMove( const Gui3DMouseEvent & event) {
	if (mCursorObject = collide( event)) {
		// Set Hand Cursor over selectable objects
		if (mCursorObject->IsSelectable())
			setCursor( HandCursor);
		else
			mCursorObject = NULL;
	}
	
	ShapeBase::setHighlighted( mCursorObject);
}

// These three methods are the interface for ITickable
void GameTSCtrl::interpolateTick( F32 delta) {
}

void GameTSCtrl::processTick() {
	// Attempt to provide better performance by limiting the rate collisions are tested
	doUpdate = true;
}

void GameTSCtrl::advanceTime( F32 timeDelta) {
}

Step 2 - ShapeBase Object Selection

I've added a variable called isSelectable to make it easier to make certain derivatives of ShapeBase highlightable and selectable. I did not go to the trouble of making a persistent field out of it. In my project, I'll probably end up subclassing ShapeBase and dealing with it that way.

You might also want to look into this thread on drawing a selection ring around an object as a complimentary selection display method.

In ShapeBase.h, around line 852, insert the following code:

F32 mLastRenderDistance;
   U32 mSkinHash;
[b]
	// object selection
	bool isSelectable;
	static ShapeBase* highlighted;
	static ShapeBase* selected;
[/b]
   /// This recalculates the total mass of the object, and all mounted objects
   void updateMass();

In ShapeBase.h, around line 1499, insert the following code:

virtual bool isValidCameraFov(F32 fov);
   /// @}
[b]
   bool IsSelectable( void) { return isSelectable; };
   
	static void setSelected( ShapeBase* obj);
   static void setHighlighted( ShapeBase* obj);
   
  	virtual void onSelect( void);
	virtual void onDeselect( void);
   virtual void onUse( void);
[/b]
   void processTick(const Move *move);
   void advanceTime(F32 dt);

In ShapeBase.cc, around line 52, insert the following code:

F32  ShapeBase::sDamageFlashDec = 0.007;
U32  ShapeBase::sLastRenderFrame = 0;
[b]
ShapeBase* ShapeBase::highlighted = NULL;
ShapeBase* ShapeBase::selected = NULL;
[/b]	
static const char *sDamageStateName[] =
{

In ShapeBase.cc, around line 704, insert the following code:

mLightTime = 0;
   damageDir.set(0, 0, 1);
[b]
	isSelectable = true;[/b]
}

In ShapeBase.cc, around line 907, insert the following code:

//----------------------------------------------------------------------------
[b]
void ShapeBase::setSelected( ShapeBase* obj) {
	if (selected == obj)
		return;

	if (selected && (selected != obj))
		selected->onDeselect();
	
	selected = obj;
	
	if (selected)
		selected->onSelect();
}

void ShapeBase::setHighlighted( ShapeBase* obj) {
	highlighted = obj;
}

void ShapeBase::onSelect() {
	Con::printf( "Object Selected");

	Con::executef( this, 1, "onSelect");
}

void ShapeBase::onDeselect() {
	Con::printf( "Object Deselected");

	Con::executef( this, 1, "onDeselect");
}

void ShapeBase::onUse() {
	Con::printf( "Use Object");

	Con::executef( this, 1, "onUse");
}
[/b]
//----------------------------------------------------------------------------

void ShapeBase::processTick(const Move* move) {

In ShapeBase.cc, around line 2340, insert the following code:

RectI viewport;
   dglGetViewport(&viewport);
[b]
	if ((selected == this) || (highlighted == this))
	   sgLightManager::sgGlobalBlendColor = ColorF( 5.0, 5.0, 5.0, 5.0);
[/b]
   installLights();

In ShapeBase.cc, around line 2480, insert the following code:

uninstallLights();
[b]
	if ((selected == this) || (highlighted == this))
	   sgLightManager::sgGlobalBlendColor = ColorF( 1.0, 1.0, 1.0, 1.0);
[/b]
   // Debugging Bounding Box
   if (!mShapeInstance || gShowBoundingBox) {

Step 3 - GuiCanvas - Cursor Event Hack

I'm using the setCursorPos fix from this thread. This may or may not affect this issue. The problem is that I will be performing calculations based upon the cursors current and previous position, then manually moving the cursor back to the latter position. In doing so, the next MouseMoveEvent I receive will be the same as the position I just moved it to, resulting in loss of control. The hack basically tells the GuiCanvas to skip the next event.

In GuiCanvas.h, around line 143, insert the following code:

public:[b]
	bool ignoreNextMove;	// Force next MouseMoveEvent to be ignored
[/b]
   DECLARE_CONOBJECT(GuiCanvas);
   GuiCanvas();

In GuiCanvas.cc, around line 217, insert the following code:

mShowCursor = true;
   rLastFrameTime = 0.0f;[b]
	ignoreNextMove = false;
[/b]
   mMouseCapturedControl = NULL;
   mMouseControl = NULL;

In GuiCanvas.cc, around line 321, insert the following code:

void GuiCanvas::processMouseMoveEvent( const MouseMoveEvent *event) {[b]
	if (ignoreNextMove) {
		ignoreNextMove = false;
		return;
	}
[/b]
   if (cursorON) {
   	// Copy the modifier into the new event

Step 4 - Script Changes

We're removing the binds to the mouse movement and left mouse button. We're adding the new cursors to the system. We're turning the cursor on by default in PlayGui.gui. And lastly, we're commenting out GuiShapeNameHud because it conflicts with what we're doing out of the box. I'll leave fixing that as an exercise for the student.

In default.bind.cs, around line 123, comment out the following code:

moveMap.bind( keyboard, s, movebackward);
moveMap.bind( keyboard, space, jump);[b]
//moveMap.bind( mouse, xaxis, yaw);
//moveMap.bind( mouse, yaxis, pitch);[/b]


//------------------------------------------------------------------------------
// Mouse Trigger
//------------------------------------------------------------------------------

In default.bind.cs, around line 141, comment out the following code:

$mvTriggerCount1++;
}
[b]
//moveMap.bind( mouse, button0, mouseFire );[/b]
//moveMap.bind( mouse, button1, altTrigger );


//------------------------------------------------------------------------------
// Zoom and FOV functions
//------------------------------------------------------------------------------

In defaultGameProfiles.cs, around line 124, add the following code:

[b]//--------------------------------------
// Cursors

new GuiCursor( HandCursor) {
   hotSpot = "1 1";
   renderOffset = "0 0";
   bitmapName = "./CUR_hand";
};

new GuiCursor( UseCursor) {
   hotSpot = "1 1";
   renderOffset = "0 0";
   bitmapName = "./CUR_grab";
};

new GuiCursor( MoveCursor) {
   hotSpot = "1 1";
   renderOffset = "0 0";
   bitmapName = "./CUR_Blank";
};[/b]

In playGui.gui, around line 16, change the following code:

forceFOV = "0";
      helpTag = "0";
[b]      noCursor = "0";[/b]

In playGui.gui, around line 82, comment out the following code:

[b]//   new GuiShapeNameHud() {
//      Profile = "GuiDefaultProfile";
//      HorizSizing = "width";
//      VertSizing = "height";
//      position = "0 0";
//      Extent = "653 485";
//      MinExtent = "8 8";
//      Visible = "1";
//      fillColor = "0 0 0 0.25";
//      frameColor = "0 1 0 1";
//      textColor = "0 1 0 1";
//      showFill = "0";
//      showFrame = "0";
//      verticalOffset = "0.2";
//      distanceFade = "0.1";
//         damageFillColor = "0.000000 1.000000 0.000000 1.000000";
//         helpTag = "0";
//         damageRect = "30 4";
//         damageFrameColor = "1.000000 0.600000 0.000000 1.000000";
//   };
[/b]


Step 5 - Delete both config.cs files

This will make sure your key binds will be up to date.

Conclusion

That should get you running. I think there are several directions you can take this code, but I won't be exploring them yet. I just wanted to get the basics out there so you all can start using it. If you have any comments or suggestions, you know what to do!
Page «Previous 1 2 3 4 5 Last »
#1
09/06/2006 (12:05 am)
LOL we both came up with this at the same time.
My collide function is identical except for a few minor differences, and the fact that I allow continous collision and sort them out in script, I also switch my cursors in script.
Finally, just a tip, instead of commenting out the ShapeNameHud, you could just have it pass the mouse events up to the Parent playgui, and then you would have name display as well.
Anyways, excellent work!

Regards,
Dreamer
#2
09/06/2006 (9:51 am)
Thanks for the compliment! We chatted about this back in Feb, I think. I was going to wait for your SDK, but I thought I would try it solo first, then look at your stuff and then pick the better tech.

I added the Tickable bit in an attempt to save some performance. I have no idea if it really helps, but it was fun to try. I use a NetEvent to tell the Server when I've right-clicked on something.

I found ShapeNameHud to be broken, which is to say that A, it didn't do what I thought it did and B, I don't think the example was implemented properly. In a nutshell, I changed the visDistance to a constant (25)rather than basing it on the Visible Distance. The DistanceFade works better for me as .9 rather than .1. I changed the text render to have a drop shadow and I use the colors defined in the GuiControlProfile instead of mTextColor. Most importantly, by setting the GuiControlProfile's modal to false, it won't eat events.
#3
09/08/2006 (12:51 am)
Nice resource.
#4
09/13/2006 (3:53 pm)
Sorry to bother but i have this working only if i skip around the fact my playGui will not load (an Unknown object trying to call a ID method). Is there something i forgot to do? other than that i believe it is working..
#5
09/13/2006 (3:55 pm)
I'm also interested on how i actually bind the movement of a mousedown drag to the pitch/yaw of my camera (i am using the orbit version of the advanced camera)
#6
09/15/2006 (10:06 am)
Do to an unfortunate choice of variable names, following line in the resource got munched in the GrabCursors method:

SimObject * obj = Sim::findObject(infos.name);

it should be:

SimObject * obj = Sim::findObject(infos[b][i][/b].name);
#7
09/16/2006 (10:50 am)
I figured out why my playGui is crashing... It has an error while trying to load "Handcursor"

"guiTSCrtl::grabCursors: failed to find cursor HandCursor" so the object registration fails and the gui never loads

I am looking into this issue right now.
#8
09/16/2006 (11:13 am)
LOL.. ok i feel like an idiot :P

if anyone else gets this issue.... execute your defaultGameProfiles before your Gui's... i guess now i know this resource inside and out from my own dumb mistake :P

And binding to the advCamera in code using

F32 cameraSpeed = Con::getFloatVariable( "$cameraYawSpeed");
Con::setFloatVariable( "$advCamera::Yaw", diff.x * cameraSpeed);

works like a charm

Jon
#9
09/30/2006 (2:12 am)
It looks like this is exactly the kind of function I was looking for, but I don't know if I can test it fully until I figure out why I can't compile TGE :/

I'm hoping (not a programmer, and never tried compiling or using a compiler before) that if I'm making changes to .cc and .h files and saving those changes, then I can at least play around with it? As long as I'm not adding NEW .cc and .h files to the project?

Anyway, thanks for sharing this, I can see that a lot of work has gone into this. Cheers!

Dan (kaffeend)
#10
09/30/2006 (9:44 am)
If you need help compiling this, feel free to email me at the address in my profile.
#11
10/13/2006 (8:07 pm)
Any chance of getting a TSE version?
#12
10/16/2006 (9:48 pm)
NM I got it working in TSE (still a couple small bugs).

Also modded the controls to mimic WoW more closely.

Left Click selects
Left Drag turns player
Right Drag turns camera
Left + Right Drag moves forward and turns player
#13
10/31/2006 (6:35 am)
Thanks!!!

But, How to use it in the TGE 1.5? :(
Help me....plz......

Follow Error Message....

c:\torque\sdk\engine\game\shapebase.cc(2339) : error C2653: 'sgLightManager' : is not a class or namespace name
c:\torque\sdk\engine\game\shapebase.cc(2339) : error C2065: 'sgGlobalBlendColor' : undeclared identifier
c:\torque\sdk\engine\game\shapebase.cc(2339) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class ColorF' (or there is no acceptable conversion)
c:\torque\sdk\engine\game\shapebase.cc(2409) : error C2653: 'sgLightManager' : is not a class or namespace name
c:\torque\sdk\engine\game\shapebase.cc(2409) : error C2679: binary '=' : no operator defined which takes a right-hand operand of type 'class ColorF' (or there is no acceptable conversion)
#14
10/31/2006 (9:08 am)
I'll take a look at the changes for 1.5 and TGEA as soon as I can. I think Mr. Kabus recently posted the fix for the lighting changes in another thread.
#15
11/02/2006 (2:12 pm)
John has a fix for the Global Blend Color here.
#16
11/03/2006 (8:52 am)
:(

Why my program is stop? after Loading Objects...

Just stop.....--;

"guiTSCrtl::grabCursors: failed to find cursor HandCursor" so the object registration fails and the gui never loads"

I am used Startkit.FPS MOD...

Help me...plz.....!!!

Follow Error Message....
#17
11/04/2006 (9:43 am)
I am got it..... :) Happy Happy.....

but, It's code so slowly..... :(
#18
11/20/2006 (12:57 am)
This is just the thing I wanted... Thankyou very much for sharing this with us! :D

One thing I'm having trouble with is this:

I'd like to bind toggleFreelook (is that what it's called?) - you know, where z is bound out of the box - to the Lmouse button. That is, instead of holding down the 'z' key to rotate the camera instead of the player. So Rmouse would grab the screen and move the player, and Lmouse is for looking around.

I edited DefaultBind.cs to accommodate this functionality, and deleted the config files, but it seems that the Lmouse is stuck to the same control as the Rmouse button - thus having both buttons doing the same job.

I was wondering if anyone knew how this should be done. I guess it requires modification of some engine files?

And how does selection work with this resource? I have to check the console to see if an item is selected or not. I tested it with a health pack, with the hand and grab cursors working fairly well, but I found that you need to be facing away from the item to get the cursors working properly.... small thing really.

Ideally, I would like to see a "item selected" in the chat hud. If anyone knows how I should go about this please give me a hint. :D

I'm going to check out http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=10359 to see if that shows me what I need to know to get started. If it works for me I'll post my results.

Thanks again for this resource.

Dan
#19
11/20/2006 (12:59 am)
Oh, and BTW James, thanks for the offer, but TGE is compiling fine as opposed to Eclipse, so it's all hunky dory now.. ;)
#20
11/28/2006 (1:47 pm)
First of all, I want to say thanks... I have learned alot by stepping through this code. I am however still having a compile issue. I noticed a poster above had had similar errors in his build:

7>..\engine\game\shapeBase.cc(2332) : error C2653: 'sgLightManager' : is not a class or namespace name
7>..\engine\game\shapeBase.cc(2332) : error C2065: 'sgGlobalBlendColor' : undeclared identifier
7>..\engine\game\shapeBase.cc(2402) : error C2653: 'sgLightManager' : is not a class or namespace name

I have implemented the updates under the Global Blend Color as suggested above as well... but I'm still getting these errors. I would really like to see this in action under 1.5, but just can't seem to get there, any suggestions would be welcome.

Thanks again,
Matt
Page «Previous 1 2 3 4 5 Last »