Invalid Projectile
by Robert Stewart · in RTS Starter Kit · 08/07/2005 (10:52 am) · 18 replies
Ok so I have my debugger working finally, so I think I found my Projectile problem.
When I put a breakpoint under RTSProjectile::onAdd it go's right past it the first time and appears to work, but the second time it gets to this spot possibly to fire a second shot, it just stops right in OnAdd. Now before this second OnAdd was called I had this message appear in the Autos in VC2003 and it was in red. Located in SimObject::onAdd mNameSpace
Here is the different things I see in both RTSProjectile::OnAdd calls
First
Hmm I know my debugger has the awnser but I just cant spot it right now, help would be nice.
When I put a breakpoint under RTSProjectile::onAdd it go's right past it the first time and appears to work, but the second time it gets to this spot possibly to fire a second shot, it just stops right in OnAdd. Now before this second OnAdd was called I had this message appear in the Autos in VC2003 and it was in red. Located in SimObject::onAdd mNameSpace
0x0112d5c0 {mNumActivePackages=3 mOldNumActivePackages=3 mActivePackages=0x0086b4f0 char const * * Namespace::mActivePackages ...} If I click to expand the mNameSpace I get mPackage 0x00000000 <Bad Ptr> const char *and as a unamed child
CXX0030: Error: expression cannot be evaluated const char
Here is the different things I see in both RTSProjectile::OnAdd calls
First
0x015515d0 {mTargetPos={x=300.05899 y=302.36499 z=226.29100 } mSpeed=20.000000 dynClassRep={...} }
RTSProjectile * constSecond0x0325dd80 {mTargetPos={x=-1.0737418e+008 y=-1.0737418e+008 z=-1.0737418e+008 } mSpeed=0.00000000 dynClassRep={...} } RTSProjectile * constThe console in game gives me this error Connectiong Error: Invalid PacketHmm I know my debugger has the awnser but I just cant spot it right now, help would be nice.
About the author
#2
08/07/2005 (1:12 pm)
Er... what problem are you trying to solve?
#3
08/07/2005 (1:46 pm)
My RTS units wont fire on other units without booting me from the game saying I dont have the proper version or art. And the console in game gives me this error Connectiong Error: Invalid Packet. Basically im trying to make my units fire at each other. I am using a heavily modified version of the RTS Pack.
#4
08/07/2005 (2:10 pm)
Probably a datablock issue, ie, referencing non-existant art or somesuch?
#5
08/07/2005 (2:17 pm)
Im using the default Crossbow.cs though.. and it fires the first time, its only the second shot that it disconnect on..
#6

and under GameConnection::sendAttackEvent here is a screenshot.
Yes I have merged RTSConnection with gameConnection
08/07/2005 (3:04 pm)
I checked gameConnection class RTSUnitAttackEvent : public NetEvent under RTSUnitAttackEvent() and here is a screenshot. 
and under GameConnection::sendAttackEvent here is a screenshot.
Yes I have merged RTSConnection with gameConnection
#7
08/07/2005 (5:03 pm)
Er... very nice screenshots. Have you tried identifying where the invalid packet notice is getting set, and tracking back to find what's causing it?
#8
EDIT: Nope searched all the .cs files too, nothing other than my console.log has the error, the error message must be generated partialy dynamic. Searching for just connection and the only thing I find is
08/07/2005 (5:28 pm)
I have searched the whole engine and could not find my message, it must be in script somewhere. Ill have to download something to search all my .cs files.EDIT: Nope searched all the .cs files too, nothing other than my console.log has the error, the error message must be generated partialy dynamic. Searching for just connection and the only thing I find is
//-----------------------------------------------------------------------------
// Server connection error
//-----------------------------------------------------------------------------
addMessageCallback( 'MsgConnectionError', handleConnectionErrorMessage );
function handleConnectionErrorMessage(%msgType, %msgString, %msgError)
{
// On connect the server transmits a message to display if there
// are any problems with the connection. Most connection errors
// are game version differences, so hopefully the server message
// will tell us where to get the latest version of the game.
$ServerConnectionErrorMessage = %msgError;
}Inside of serverconnection.cs
#9
08/07/2005 (6:48 pm)
You said you are using the default crossbow.cs? IIRC, that's a left over artifact from TGE, and is -not- supported with art within the RTS-SK. Check to make sure that the artwork is actually in the proper directories server and client side, and more importantly realize that RTSProjectile is not setup/used the same way as projectiles are in TGE.
#10
08/07/2005 (7:36 pm)
Sorry I meant default RTS Kit crossbow, I grabbed it from the RTSKit, along with all the Art and scripts. Its only the Engine that came from TGE.
#11
08/07/2005 (10:01 pm)
The RTS Kit cross bow isn't going to work well with stock TGE, either...
#12
08/08/2005 (2:52 pm)
But what if im using RTS Units with RTS Crossbow inside TGE? Can someone give me a very simple projectile to test?
#14
08/08/2005 (4:02 pm)
Ok so my problem is almost gone, I notice that my Player class can shoot projectiles and it dosent crash. When my player shoots where is the projectile created? NOTE: For anyone who caught my last post, It appeard to work only because the Projectile Data block wasent loading and it was just damaging the target without projectile.
#15
08/08/2005 (4:11 pm)
That's because the RTS projectile code doesn't work that way. You really need to understand how the RTS projectile code works in situ before trying to put it somewhere else.
#16
08/08/2005 (5:33 pm)
Where do I find out where the projectile is been created? I found this %p = new RTSProjectile() inside game.cs on client side, but nothing on server end. Is this because it is not tracked on the server?
#17
08/08/2005 (6:39 pm)
Acually, Ive managed to get the to shoot Projectiles, i think if the perfomance is not to bad I would like to keep it that way.
#18
08/09/2005 (11:58 am)
Correct. RTSProjectiles are never created on the server.
Torque Owner Robert Stewart
First
mDataBlock
0x034403e0 {projectileShapeName=0x012b7f00 "starter.fps/data/shapes/crossbow/projectile.dts" hasLight=true lightRadius=4.0000000 ...} GameBaseData *this0x0349d790 {mTargetPos={x=-1.0737418e+008 y=-1.0737418e+008 z=-1.0737418e+008 } mSpeed=0.00000000 dynClassRep={...} } GameBase * constSecondmDataBlock
0x00000000 {packed=??? category=??? className=??? ...} GameBaseData *this0x015515d0 {mTargetPos={x=300.05899 y=302.36499 z=226.29100 } mSpeed=20.000000 dynClassRep={...} } GameBase * const