Trying to rip out the Mouse Aim code
by Drew Kario · in 3D Isometric Kit · 08/03/2009 (10:38 pm) · 7 replies
Hey, Im trying my best to rip out the mouse aiming code and plug it into stock AFX. I have the mouse aim resource that was used to implement it in the first place, but i cant seem to get it working.
I have implemented the advanced camera resource with little difficulty and moved on to the mouse aiming snippet.
I took the files from the mouse aiming codes:
gameConnection.ccp, gameConnection.h, gameTSCtrl.cpp, gameTSctrl.h, movelist.cpp, movelist.h, moveManager.ccp, moveManager.h, player.cpp, and player.h.
The only ones with major differences between AFX, the mouse aim code, and the iso kit was player.ccp and player.h
and with the game scripts.
It compiles, but in the game the player controls remain the same as before.
How did you get it working with this AFX?
I have implemented the advanced camera resource with little difficulty and moved on to the mouse aiming snippet.
I took the files from the mouse aiming codes:
gameConnection.ccp, gameConnection.h, gameTSCtrl.cpp, gameTSctrl.h, movelist.cpp, movelist.h, moveManager.ccp, moveManager.h, player.cpp, and player.h.
The only ones with major differences between AFX, the mouse aim code, and the iso kit was player.ccp and player.h
and with the game scripts.
It compiles, but in the game the player controls remain the same as before.
How did you get it working with this AFX?
#2
08/04/2009 (12:41 pm)
what im trying to do is take parts of the kit that i like and install it into stock AFX, since the kit is not multiplayer.
#3
08/04/2009 (8:39 pm)
The kit is multiplayer functional as is. the parts that have not been set up for multiplayer are small things. like making sure stats are transmited to all players ect. If you want to see how to make sure those parts are ghosted to the clients correctly just look at the afx weapon resource and compare the code that was added for the 3d rpg kit to make sure they are set up correctly.
#4
08/05/2009 (6:22 am)
the mouse aim code is held in AFXTSCtrl inside of the function OnMouseMove.
#5
And michael, when i connect multiple clients to the game, the camera is all messed up. secondary clients are connected on first person camera, and trying to switch cameras causes a fatal crash.
and thats a pretty major multiplayer flaw
Unless you know how to fix it? I'd love to know it
08/05/2009 (11:17 pm)
thanks tim! That helps alot.And michael, when i connect multiple clients to the game, the camera is all messed up. secondary clients are connected on first person camera, and trying to switch cameras causes a fatal crash.
and thats a pretty major multiplayer flaw
Unless you know how to fix it? I'd love to know it
#6
08/07/2009 (12:19 am)
I found out why it crashes on multiplayer, i think. The mouse aiming code that tim put in only allows for one client to use it. Right now im trying to figure out how i can make it work with more than one.
#7
to
and now it works! Dunno if this fixes the issue or just works around it. Someone let me know what they think about that.
08/08/2009 (6:02 pm)
I think i found out how to keep it working in multiplayer, in afxTSCTRL.h i changed the declared variables fromvirtual void onMouseMove(const GuiEvent&); virtual void onMouseDragged(const GuiEvent&);
to
virtual void onMouseMove(const GuiEvent &evt); virtual void onMouseDragged(const GuiEvent &evt);
and now it works! Dunno if this fixes the issue or just works around it. Someone let me know what they think about that.
Torque Owner Timothy Castagna
TK Games LLC