4. MXG Weapon Mod - Advanced Crosshair
by Marcus L · 08/13/2010 (10:50 pm) · 29 comments
Tested on: 1.1b2
This resource will give you an advanced crosshair/reticle like most modern FPS games use (CoD). Parts of this resource is based of this resource.
-Crosshair spread depending on movement speed.
-Crosshair spread depending on pose.
-Crosshair spread depending on rotation speed.
-Crosshair "hit mark" that indicates if you've hit something/one.
-Crosshair image depending on aimed objects team.
--Ally crosshair
--Enemy crosshair
--Neutral crosshair
This resource (unlike the previous ones) does not require that you've installed any of my previous resources :D.
To install this resource you'll first need to download this file.
Then you'll need to place the guiAnimatedCrosshairHud.cpp in folder: T3D/fps/guiAnimatedCrosshairHud.cpp and add it in C++.
And then, some changes here and there, and like the previous, this is how to install this part:
Where it says // Added, it means that the line is added.
Where it says // Removed, it means that the line is removed.
Where it says // Changed, it means that the line is changed.
Where it says ..., it means that there is code between what ever that was last written.
Whenever it says ..., there will be an comment below describing what function it is.
I recommend you using CTRL + F to find where to put the code blocks. Remember to backup before installing.
Then, in T3D/shapeBase.cpp edit the following:
In T3D/shapeBase.h add the following:
Now, in T3D/shapeImage.cpp:
Soon there, only two edits left. Now in T3D/player.cpp:
Can't believe i forgot T3D/player.h (yes, i originally forgot it):
Now (re)build while you add the next part:
Ok, this is the TorqueScript part, first add the following to the bottom of scripts/client/client.cs:
Then add the following in all your player classes "damage" function; default class Armor::damage, located in scripts/server/player.cpp:
Next, add this for all the weapon images that uses a crosshair:
Next last, you'll have to add a team value to the player blocks by adding team = "teamval", where "teamval" is the team string (Ex. "Red" or "Blue").
Lastly, replace the current reticle block with this one:
Done!
Now for some notes:
First off, the prone crosshair is untested and therefore not intended to work, same for swimming. Second, the team system was really quickly and roughly made, so nothing special there. Third, the crosshair is set by reticle.setBitmap(path); and the path should not point to a file, it should point to the crosshair file base, for example:
An advice from me would be to have a look in the zip for a better overview of the structure.
Fourth note; There is something strange with the debug build, so if you're going to use debug, then note that the ticking will be slower.
Fifth note; When mounting vehicles or dismounting your weapon, it will screw up the crosshair. This can be fixed by calling reticle.setBitmap(""); to clear out the reticle. As for using weapons that are mounted to the vehicle it self, will require changes. Not sure how to fix it tho.
Last, oh wait, what's that? I can't hear you form across the interwebs. You demand a video? note: for some strange reason, frapsing slowed down the crosshair, so know that it is faster in-game.
Now lastly, if you stumble upon some issues, let me know.
Also know that my methods might not be correct, nor the most professional. Therefore if you see some silly mistakes please leave a comment with the "fix".
Next resource will be "FPS like inventory system", and no source change required :D.
Other resources in my Weapon Mod:
1. MXG Weapon Mod - Decals Depending on Material
2. MXG Weapon Mod - Explosion and SFX Depending on Material
3. MXG Weapon Mod - Structure and Armor Piercing Projectiles
4. MXG Weapon Mod - Advanced Crosshair
Thanks,
Marcus L.
This resource will give you an advanced crosshair/reticle like most modern FPS games use (CoD). Parts of this resource is based of this resource.
Quote:like most modern FPS gamesTo be exact:
-Crosshair spread depending on movement speed.
-Crosshair spread depending on pose.
-Crosshair spread depending on rotation speed.
-Crosshair "hit mark" that indicates if you've hit something/one.
-Crosshair image depending on aimed objects team.
--Ally crosshair
--Enemy crosshair
--Neutral crosshair
This resource (unlike the previous ones) does not require that you've installed any of my previous resources :D.
To install this resource you'll first need to download this file.
Then you'll need to place the guiAnimatedCrosshairHud.cpp in folder: T3D/fps/guiAnimatedCrosshairHud.cpp and add it in C++.
And then, some changes here and there, and like the previous, this is how to install this part:
Where it says // Added, it means that the line is added.
Where it says // Removed, it means that the line is removed.
Where it says // Changed, it means that the line is changed.
Where it says ..., it means that there is code between what ever that was last written.
Whenever it says ..., there will be an comment below describing what function it is.
I recommend you using CTRL + F to find where to put the code blocks. Remember to backup before installing.
Then, in T3D/shapeBase.cpp edit the following:
... //In ShapeBase::ShapeBase() mMass( 1.0f ), mOneOverMass( 1.0f ), mPose( "StandPose" ), // Added mTeam( "" ), // Addedthat was much O_o
In T3D/shapeBase.h add the following:
...
//In public of ShapeBaseImageData
bool accuFire; ///< Should we automatically make image's aim converge with the crosshair?
bool cloakable; ///< Is this image cloakable when mounted?
// Added ->
F32 maxSpread; ///< MaxSpread, how much should the crosshair spread?
F32 minSpread; ///< MinSpread, how low should it go?
F32 maxCrouchSpread; ///< MaxCrouchSpread, how much should the crosshair spread when crouching?
F32 minCrouchSpread; ///< MinCrouchSpread, how low should it go when crouching?
//F32 maxProneSpread; ///< MaxProneSpread, how much should the crosshair spread when proneing?
//F32 minProneSpread; ///< MinProneSpread, how low should the crosshair go when proneing?
// Added <-
...
//In protected of class ShapeBase
TSThread *mHulkThread;
VectorF damageDir;
const char* mPose; // Added
const char* mTeam; // Added
...
//In public of class ShapeBase
/// @return Damage factor, between 0.0 - 1.0
F32 getDamageValue();
/// Returns the rate at which the object regenerates damage
F32 getRepairRate() { return mRepairRate; }
// Added ->
/// Sets the player's pose.
void setPose(const char* pose) { mPose = pose; }
/// Gets the player's pose.
const char* getPoseString() { return mPose; }
/// Sets the player's team.
void setTeam(const char* team) { mTeam = team; }
/// Gets the player's team.
const char* getTeam() { return mTeam; }
// Added <-Now, in T3D/shapeImage.cpp:
...
//In ShapeBaseImageData::ShapeBaseImageData()
projectile = NULL;
cloakable = true;
maxSpread = 0; // Added ->
minSpread = 0;
maxCrouchSpread = 0;
minCrouchSpread = 0;
//maxProneSpread = 0;
//minProneSpread = 0; // Added <-
...
//In ShapeBaseImageData::initPersistFields()
addField( "minEnergy", TypeF32, Offset(minEnergy, ShapeBaseImageData),
"Minimum Image energy for it to be operable." );
addField( "accuFire", TypeBool, Offset(accuFire, ShapeBaseImageData),
"Flag to control whether the Image's aim is automatically converged with "
"the crosshair.nCurrently unused." );
addField("maxSpread", TypeF32, Offset(maxSpread, ShapeBaseImageData), // Added ->
"The value of the crosshairs max spread.");
addField("minSpread", TypeF32, Offset(minSpread, ShapeBaseImageData),
"The value of the crosshairs min spread.");
addField("maxCrouchSpread", TypeF32, Offset(maxCrouchSpread, ShapeBaseImageData),
"The value of the crosshairs max spread when crouching.");
addField("minCrouchSpread", TypeF32, Offset(minCrouchSpread, ShapeBaseImageData),
"The value of the crosshairs min spread when crouching.");
//addField("maxProneSpread", TypeF32, Offset(maxProneSpread, ShapeBaseImageData),
// "The value of the crosshairs max spread when proneing.");
//addField("minProneSpread", TypeF32, Offset(minProneSpread, ShapeBaseImageData),
// "The value of the crosshairs min spread when proneing."); // Added <-
...
//In ShapeBaseImageData::packData(BitStream* stream)
stream->write(minEnergy);
stream->writeFlag(hasFlash);
// Client doesn't need accuFire
stream->write(maxSpread); // Added ->
stream->write(minSpread);
stream->write(maxCrouchSpread);
stream->write(minCrouchSpread);
//stream->write(maxProneSpread);
//stream->write(minProneSpread); // Added <-
...
//In ShapeBaseImageData::unpackData(BitStream* stream)
stream->read(&minEnergy);
hasFlash = stream->readFlag();
stream->read(&maxSpread); // Added ->
stream->read(&minSpread);
stream->read(&maxCrouchSpread);
stream->read(&minCrouchSpread);
//stream->read(&maxProneSpread);
//stream->read(&minProneSpread); // Added <-Soon there, only two edits left. Now in T3D/player.cpp:
...
//In PlayerData::initPersistFields()
addField( "pickupRadius", TypeF32, Offset(pickupRadius, PlayerData),
"Radius around the player to collide with Items in the scene (on server)." );
addField( "maxTimeScale", TypeF32, Offset(maxTimeScale, PlayerData),
"Maximum time scale for action animations.n"
"Action animations are automatically scaled to match the ground "
"velocity; this field limits the maximum time scale." );
// Added ->
addField( "team", TypeString, Offset(team, PlayerData),
"Player's team variable" );
// Added <-
...
//In Player::onAdd()
mWorkingQueryBox.minExtents.set(-1e9f, -1e9f, -1e9f);
mWorkingQueryBox.maxExtents.set(-1e9f, -1e9f, -1e9f);
// Added ->
if(mDataBlock->team)
Parent::setTeam(mDataBlock->team);
// Added <-
...
//In Player::setPose( Pose pose )
// Not added yet, just assign the pose and return.
if ( !isProperlyAdded() )
return;
Point3F boxSize(1,1,1);
// Changed ->
// Resize the player boxes
switch (pose)
{
case StandPose:
boxSize = mDataBlock->boxSize;
Parent::setPose("StandPose");
break;
case CrouchPose:
boxSize = mDataBlock->crouchBoxSize;
Parent::setPose("CrouchPose");
break;
case PronePose:
boxSize = mDataBlock->proneBoxSize;
Parent::setPose("PronePose");
break;
case SwimPose:
boxSize = mDataBlock->swimBoxSize;
Parent::setPose("SwimPose");
break;
}
// Changed <-Can't believe i forgot T3D/player.h (yes, i originally forgot it):
// Jump off surfaces at their normal rather than straight up bool jumpTowardsNormal; // Added -> // The player's team variable. const char* team; // Added <-
Now (re)build while you add the next part:
Ok, this is the TorqueScript part, first add the following to the bottom of scripts/client/client.cs:
function clientCmdHitMark()
{
Reticle.setHitMark(1);
}Then add the following in all your player classes "damage" function; default class Armor::damage, located in scripts/server/player.cpp:
// Added -> // Render the HitMark commandToClient(%sourceClient, 'HitMark'); // Added <- // Update the numerical Health HUD %obj.updateHealth();
Next, add this for all the weapon images that uses a crosshair:
// Crosshair //MXG: These values are not messured in any way, // these values are only random values that // worked fine for the rifle i used for testing. maxSpread = 6.0; minSpread = 4.0; maxCrouchSpread = 3.5; minCrouchSpread = 2.5; //maxProneSpread = 2.0; //minProneSpread = 3.5;
Next last, you'll have to add a team value to the player blocks by adding team = "teamval", where "teamval" is the team string (Ex. "Red" or "Blue").
Lastly, replace the current reticle block with this one:
new GuiDynamicCrosshairHud(Reticle) {
position = "272 172";
extent = "256 256";
minExtent = "8 8";
horizSizing = "center";
vertSizing = "center";
profile = "GuiModelessDialogProfile";
visible = "0";
active = "1";
tooltipProfile = "GuiToolTipProfile";
hovertime = "1000";
isContainer = "0";
canSave = "1";
canSaveDynamicFields = "0";
bitmap = "art/gui/weaponHud/blank.png";
};Done!
Now for some notes:
First off, the prone crosshair is untested and therefore not intended to work, same for swimming. Second, the team system was really quickly and roughly made, so nothing special there. Third, the crosshair is set by reticle.setBitmap(path); and the path should not point to a file, it should point to the crosshair file base, for example:
defaultCrosshair_right.png defaultCrosshair_bottom.png defaultCrosshair_left.png defaultCrosshair_up.pngif that would be the case, then the setBitmap's path should point to "defaultCrosshair" not "defaultCrosshair_right.png" or "defaultCrosshair.png".
An advice from me would be to have a look in the zip for a better overview of the structure.
Fourth note; There is something strange with the debug build, so if you're going to use debug, then note that the ticking will be slower.
Fifth note; When mounting vehicles or dismounting your weapon, it will screw up the crosshair. This can be fixed by calling reticle.setBitmap(""); to clear out the reticle. As for using weapons that are mounted to the vehicle it self, will require changes. Not sure how to fix it tho.
Last, oh wait, what's that? I can't hear you form across the interwebs. You demand a video? note: for some strange reason, frapsing slowed down the crosshair, so know that it is faster in-game.
Now lastly, if you stumble upon some issues, let me know.
Also know that my methods might not be correct, nor the most professional. Therefore if you see some silly mistakes please leave a comment with the "fix".
Next resource will be "FPS like inventory system", and no source change required :D.
Other resources in my Weapon Mod:
1. MXG Weapon Mod - Decals Depending on Material
2. MXG Weapon Mod - Explosion and SFX Depending on Material
3. MXG Weapon Mod - Structure and Armor Piercing Projectiles
4. MXG Weapon Mod - Advanced Crosshair
Thanks,
Marcus L.
#2
EDIT:
BUG FIX:
There was an precision bug in guiAnimatedCrosshairHud.cpp that I've fixed now. Updated link!
08/14/2010 (10:36 am)
Thank you :D, and thanks for the fix (Updated Resource). I'm not really that familiar with S32 :P.EDIT:
BUG FIX:
There was an precision bug in guiAnimatedCrosshairHud.cpp that I've fixed now. Updated link!
#4
08/15/2010 (8:38 pm)
Looks interesting, gonna have to play around with this one.
#5
08/24/2010 (3:17 am)
The crosshairs don't move out if you shoot while crouching.
#6
08/24/2010 (10:06 am)
O rly? I'll have a look at that some time today, might not be able to post the solution before the end of the week tho.
#7
For those who want to know, I've updated the crosshair files so they're no longer a child of GuiTickCtrl but instead a child of GuiControl what this does is that it makes the crosshair unaffected by prosessor power. Like you saw in the video, it slowed down when frapsing, that is fixed now.
08/26/2010 (4:31 pm)
Actually, this is one bug i can't fix, because there isn't really anything to fix. You see, what really makes the crosshair spread when shooting is the recoil. But when crouching gideon screws up the camPos making the crosshair unable to react to x translation (aiming upwards), so that when you recoil, nothing will happen. The real fix is to use your own player model that doesn't screw up the camPos while crouching.For those who want to know, I've updated the crosshair files so they're no longer a child of GuiTickCtrl but instead a child of GuiControl what this does is that it makes the crosshair unaffected by prosessor power. Like you saw in the video, it slowed down when frapsing, that is fixed now.
#8
This resource is really excellent.
I'm not sure to follow 1 thing, in the implementation you are describing, how the spread is really acting.
I mean I don't see any code change to the projectile creation. So even if on the screen the aim seems bigger & should not aim perfectly, the fire is always in the center (ie match muzzle vector).
did I miss something?
08/26/2010 (6:55 pm)
Hi Marcus,This resource is really excellent.
I'm not sure to follow 1 thing, in the implementation you are describing, how the spread is really acting.
I mean I don't see any code change to the projectile creation. So even if on the screen the aim seems bigger & should not aim perfectly, the fire is always in the center (ie match muzzle vector).
did I miss something?
#9
Of course it is possible to link accuracy with the crosshair, but for now, it's only the visual part that is done.
Thanks elvince, you just gave me an idea for one of my next resources, spread-depending-on-movement-and-pose :D.
Sorry if this is disappointing news D:, I'll try all i can to help you if possible.
08/26/2010 (8:16 pm)
Quote:I mean I don't see any code change to the projectile creation. So even if on the screen the aim seems bigger & should not aim perfectly, the fire is always in the center (ie match muzzle vector).This resource does not modify projectile nor the spread, this is just a visual GUI that changes depending on movement. The weapon you are using should hit center independently from the crosshair.
Of course it is possible to link accuracy with the crosshair, but for now, it's only the visual part that is done.
Thanks elvince, you just gave me an idea for one of my next resources, spread-depending-on-movement-and-pose :D.
Sorry if this is disappointing news D:, I'll try all i can to help you if possible.
#10
About weapon spread: Torque3D weapon onFire() methods already accounts for projectile skew in script if set in the weaponImage datablock -- though I don't think any of the current stock weapons make use of it. Hooking this up to movement speed is fairly simple, taking portions of this Resource is a simple example.
And there was a Forum thread in which movement speed & jumping was used to modify the spread as well as the recoil *trick* I used in early incarnations of the FPS Genre Kit before it was stripped down to the FPS Example.
Something like that would go well with this Resource.
08/26/2010 (9:31 pm)
Forgot about this one, even though had played around with it. Only problem I recall seeing was the sections of the reticle being displayed out of order when the player was mounted to a vehicle of if the weapon was unmounted (by pressing 0) - but truthfully I think that was my fault :DAbout weapon spread: Torque3D weapon onFire() methods already accounts for projectile skew in script if set in the weaponImage datablock -- though I don't think any of the current stock weapons make use of it. Hooking this up to movement speed is fairly simple, taking portions of this Resource is a simple example.
And there was a Forum thread in which movement speed & jumping was used to modify the spread as well as the recoil *trick* I used in early incarnations of the FPS Genre Kit before it was stripped down to the FPS Example.
Something like that would go well with this Resource.
#11
EDIT: File Uploaded! Use the same link.
08/26/2010 (9:46 pm)
Quote:when the player was mounted to a vehicle of if the weapon was unmountedHmm, didn't test vehicles.. I'm not sure why that would happen. I'll have a look that this weekend. The unmount weapon issue I'm at least aware why is happening bad sentence O_o, I can fix this one but, do you really need a crosshair when holding nothing? If not you can call reticle.setBitmap(""); to clear out the crosshair.
Quote:onFire() methods already accounts for projectile skewLol, I knew that :P.
Quote:And there was a Forum thread in which movement speed & jumping was used to modify the spreadThis on the other hand, i didn't know. Thanks Michael, half the work done already :D, still missing pose tho, which is why i actually added an getPose function through this resource, I'll see if i can modify it to modify the accuracy.
EDIT: File Uploaded! Use the same link.
#12
08/26/2010 (10:10 pm)
The unMounted weapon reticle problem was sort of my fault - you're right don't need one if you don't have a weapon - just had to restore the name for the reticle and it once again clears it when unmounting a weapon... I broke my weaponHud code with something silly despite knowing better :D
#13
Right:
Bottom:
Left:
Top:
EDIT: there's actually 4 images there -- just right-click->Save As -- it's hard to see them against the website's white background.
EDIT:A screen shot of it in action:
08/26/2010 (10:42 pm)
Here are the 4 pieces of a crosshair I was using with this Resource which was based on the Rocketlauncher reticle. I had made 6 different sets of reticles for the FPS kit, I may see about breaking them apart for use here if there is interest.Right:
Bottom:
Left:
Top:
EDIT: there's actually 4 images there -- just right-click->Save As -- it's hard to see them against the website's white background.
EDIT:A screen shot of it in action:
#14
I'm not sure it's so easy to implement it. You need to take care of the speed of the player but also on the "timing" of the crosshair. By timing I mean, in which step the crosshair is between max & min spread. It's easy in single player game but in multiplayer, I'm not so sure how to do it without adding workload on the server or add information on the bandwidth.
Another thing you can think of for this resource: Even if you are moving (max spread), if you stick you crosshair on a opponent it can lower down to the min spread. I played a fps game with this, and it was a very interesting feature.
If you need my help to work on this, I will be very pleased as this is clearly a feature I would like to put in my game if possible (I mean without increasing the bandwith or server impact in multiplayer).
[edit]
@Michael,
if you have any idea to implement, don't hesitate :D
08/27/2010 (10:09 am)
I will certainly look forward for your next resources if you implement the spread :DI'm not sure it's so easy to implement it. You need to take care of the speed of the player but also on the "timing" of the crosshair. By timing I mean, in which step the crosshair is between max & min spread. It's easy in single player game but in multiplayer, I'm not so sure how to do it without adding workload on the server or add information on the bandwidth.
Another thing you can think of for this resource: Even if you are moving (max spread), if you stick you crosshair on a opponent it can lower down to the min spread. I played a fps game with this, and it was a very interesting feature.
If you need my help to work on this, I will be very pleased as this is clearly a feature I would like to put in my game if possible (I mean without increasing the bandwith or server impact in multiplayer).
[edit]
@Michael,
if you have any idea to implement, don't hesitate :D
#15
@ Michael
You wouldn't mind if I replaced your crosshair with my "dummy" crosshair that comes with this resource?
08/27/2010 (2:01 pm)
@ elvinceQuote:I'm not sure it's so easy to implement it. You need to take care of the speed of the player but also on the "timing" of the crosshair. By timing I mean, in which step the crosshair is between max & min spread. It's easy in single player game but in multiplayer, I'm not so sure how to do it without adding workload on the server or add information on the bandwidth.Firstly, the timing will not be hard to do when the scale of the crosshair is stored in an varable that i can return. Second, GUIs are pure client stuff, meaning this resouce is also mostly client stuff. The only reason I could create bandwidth issues is if I where to get the spread per tick, which i obviously won't.
Quote:if you stick you crosshair on a opponent it can lower down to the min spread.That does actually sound interesting, I could add that for you, but I'm not saying that it'll happen soon. Maybe a week or so.
Quote:If you need my help to work on thisHelp is always apperciated, so if you can, please do!
Quote:@Michael,Hey! Thats my line! but yeah, ideas are always welcome.
if you have any idea to implement, don't hesitate :D
@ Michael
You wouldn't mind if I replaced your crosshair with my "dummy" crosshair that comes with this resource?
Quote:A screen shot of it in actionLol, "action".
#16
That's was my point. Gui are pure client side and the spread is pure server side. So at some point you need to be able to calculate the spread. What's your first thought to manage this without network transmission?
Do you have a "server side" function that may be able to calculate the spread?
At no time you can trust the client information, so the spread can't be send from the client.
On this, for the moment, if we want to do the server side (client side will be a extension from your gui) we need to be able to calculate the time between "I lock the opponent" and I fire. This difference will give us the information required to calculate the spread. I mean the move from Max to min is linked to time so easy calculation.
To get this time, it might be to fire a ray at each player class tick to see whether a target is aimed when the player have a weapon mounted ? I have no clue how it will cost on cpu time/workload for let say 64/128/256 players.
From what I read ray cast are fast enough to be negligible, but at if done every tick, this might not be true.
08/27/2010 (3:33 pm)
Quote:Firstly, the timing will not be hard to do when the scale of the crosshair is stored in an varable that i can return. Second, GUIs are pure client stuff, meaning this resouce is also mostly client stuff. The only reason I could create bandwidth issues is if I where to get the spread per tick, which i obviously won't.
That's was my point. Gui are pure client side and the spread is pure server side. So at some point you need to be able to calculate the spread. What's your first thought to manage this without network transmission?
Do you have a "server side" function that may be able to calculate the spread?
At no time you can trust the client information, so the spread can't be send from the client.
Quote: Quote:if you stick you crosshair on a opponent it can lower down to the min spread.That's will be awesome! 1 week or so, is pretty quick!
That does actually sound interesting, I could add that for you, but I'm not saying that it'll happen soon. Maybe a week or so.
On this, for the moment, if we want to do the server side (client side will be a extension from your gui) we need to be able to calculate the time between "I lock the opponent" and I fire. This difference will give us the information required to calculate the spread. I mean the move from Max to min is linked to time so easy calculation.
To get this time, it might be to fire a ray at each player class tick to see whether a target is aimed when the player have a weapon mounted ? I have no clue how it will cost on cpu time/workload for let say 64/128/256 players.
From what I read ray cast are fast enough to be negligible, but at if done every tick, this might not be true.
#17
Oh, and btw. I got the spread(-depending-on-crosshair) to work, I'll include it in my next resource.
Michael? Reply regarding the crosshair files plox?
08/27/2010 (5:06 pm)
So, just to clarify what you are saying, you want the crosshair to "shrink" when aiming someone down, but when you're not aiming someone down, you want the crosshair to stay at max spread?Oh, and btw. I got the spread(-depending-on-crosshair) to work, I'll include it in my next resource.
Michael? Reply regarding the crosshair files plox?
#18
08/27/2010 (5:42 pm)
@Marcus: feel free to use them. I'll even give you a few more sometime this weekend.
#19
When you move without aiming at a target, you stay at max spread as in your current implementation.
When you start aiming someone by moving or not, the crosshair should shrink and reach the min spread of your move.
If you loose your target the crosshair should "enlarge" to max spread. Not at once, but maybe faster than the shrink. In term of gameplay, if you keep the focus on a target, you can hit it with a better precision. More, if you loose it for few millisecond, you don't loose all the benefits you get when aiming back on the target.
It could be great if we can have as parameter by pose: Min/Max spread & Time to shrink & Time to enlarge or min/max spread speed of shrinking/speed for enlarging.
I hope this is clearer...
Spread depending on crosshair done: Great!! so quick :D
By the way, thanks for all the 4 resources you made on weapons, they are really excellent and can add great features in game!
08/27/2010 (9:04 pm)
@Marcus,When you move without aiming at a target, you stay at max spread as in your current implementation.
When you start aiming someone by moving or not, the crosshair should shrink and reach the min spread of your move.
If you loose your target the crosshair should "enlarge" to max spread. Not at once, but maybe faster than the shrink. In term of gameplay, if you keep the focus on a target, you can hit it with a better precision. More, if you loose it for few millisecond, you don't loose all the benefits you get when aiming back on the target.
It could be great if we can have as parameter by pose: Min/Max spread & Time to shrink & Time to enlarge or min/max spread speed of shrinking/speed for enlarging.
I hope this is clearer...
Spread depending on crosshair done: Great!! so quick :D
By the way, thanks for all the 4 resources you made on weapons, they are really excellent and can add great features in game!
#20
Change Log? Here:
-Changed class name from GuiAnimatedCrosshairHud to GuiDynamicCrosshairHud.
-Changed the team system, not so messy anymore.
-Changed the naming scheme, no longer _cosshair[index], now it is _[dir] (see ReadMe)
-Optimized/Simplified some code.
-Added console method getSpread to the crosshair.
-Added some fields to the GUI control, these are:
--Debug (bool)
--Use hitmark (bool)
--Use enemy/ally crosshair (bool)
--Use pose change (bool)
--Spread speed when standing/crouching (F32)
--Spread sensitivity when standing/crouching (F32)
@ elvince
Thanks for those kind words. *happyness*
btw. I'm working on your version
@ Michael
Thanks, I've included them in the .rar, can't wait to see what more you've got.
Edit: Also, regarding the vehicle problem, is it crucial? Cuz I can fix it, but it'll not be the easiest task.
@ Jonathan
This is fixed now... Somehow...
08/29/2010 (12:12 pm)
For those following this resource, I've updated the resource to include new features.Change Log? Here:
-Changed class name from GuiAnimatedCrosshairHud to GuiDynamicCrosshairHud.
-Changed the team system, not so messy anymore.
-Changed the naming scheme, no longer _cosshair[index], now it is _[dir] (see ReadMe)
-Optimized/Simplified some code.
-Added console method getSpread to the crosshair.
-Added some fields to the GUI control, these are:
--Debug (bool)
--Use hitmark (bool)
--Use enemy/ally crosshair (bool)
--Use pose change (bool)
--Spread speed when standing/crouching (F32)
--Spread sensitivity when standing/crouching (F32)
@ elvince
Quote:It could be great if we can have as parameter by pose: Min/Max spread & Time to shrink & Time to enlarge or min/max spread speed of shrinking/speed for enlarging.Done.
Thanks for those kind words. *happyness*
btw. I'm working on your version
@ Michael
Thanks, I've included them in the .rar, can't wait to see what more you've got.
Edit: Also, regarding the vehicle problem, is it crucial? Cuz I can fix it, but it'll not be the easiest task.
@ Jonathan
This is fixed now... Somehow...

Torque Owner Alfio Saitta
Collateral Studios
In T3D/player.cpp
//In PlayerData::initPersistFields() addField( "pickupRadius", TypeF32, Offset(pickupRadius, PlayerData), "Radius around the player to collide with Items in the scene (on server)." ); addField( "maxTimeScale", TypeF32, Offset(maxTimeScale, PlayerData), "Maximum time scale for action animations.n" "Action animations are automatically scaled to match the ground " "velocity; this field limits the maximum time scale." ); // Added -> addField( "team", S32, Offset(team, PlayerData), "Player's team variable" ); // CHANGED FROM TypeString to S32 // Added <-Perfect resource, thanks a lot :)