any way to get the experience value in the script?
Moderator: Moderators
- Optimus Prime
- Posts: 755
- Joined: 03 Oct 2005, 14:31
any way to get the experience value in the script?
Is there any way to have a function like get_exp so that we can check the experience of a unit? I would need such a function.
And i remember that in the past you told me, that in a futuer version it would be possible, to create our own exp system (for example add special prenames like general or veteran with extra damage or speed boost). Is something like this still in discussion, or is it to difficult?
thx
And i remember that in the past you told me, that in a futuer version it would be possible, to create our own exp system (for example add special prenames like general or veteran with extra damage or speed boost). Is something like this still in discussion, or is it to difficult?
thx
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
There is a script thing to detect veteran status. Hold on a moment...
Code: Select all
Monitor()
{
var lastcheck, check;
lastcheck = 0;
check = 0;
while(TRUE)
{
sleep 100; // a delay, so the engine doesn't choke.
check = check + 1; // time the delay between shots
if (firecheck != lastcheck) // if weapon has been fired...
{
if (check < 14) // change this number to 1/10 of reload
// in weapon .tdf file.
{
// place changes to unit here, fex additional weapons,
// ARMORED on, ACTIVATION on (radar/jamming), or just
// more pieces on the model, for decoration.
return(0); // kills the script after this happens.
}
check = 0; // "resets the clock" each time weapon is fired.
}
lastcheck = firecheck; // if the weapon is not fired, run the clock.
}
}
Create()
{
firecheck = 0;
start-script Monitor();
}
FirePrimary()
{
firecheck = !firecheck; // this signals "Monitor()" that the weapon has been fired.
return(0);
}
- Optimus Prime
- Posts: 755
- Joined: 03 Oct 2005, 14:31
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
*Digs into his changelog once again*
I'm guessing the exact code would be0.67b1
...
-COB support for Getting/Setting veteran level and unit speed.
The returned veteran level is unit experience multiplied by 100
...
Code: Select all
GET VETERAN_LEVEL
SET VETERAN_LEVEL
- Optimus Prime
- Posts: 755
- Joined: 03 Oct 2005, 14:31
-
- Posts: 854
- Joined: 28 Jan 2005, 18:15
Didn't someone dig around in the code and discover that experience doesen't affect accuracy?Guessmyname wrote:I think you're wrong.
TA units reach veterancy level after 5 kills.
With each increment accuracy increases and reload times decrease.
This veterancy detection script checks the reloadtime, and detects when it has decreased because the unit has reached veteran level
EXPERIENCE IN SPRING DOES AFFECT ACCURACY.
EXPERIENCE IN SPRING DOES NOT LEVEL AFTER 5 KILLS.
EXPERIENCE IN SPRING IS PER SUCCESSFUL ATTACK.
EXPERIENCE INCREASES A UNIT'S HITPOINTS.
Now everything's clear
To be a bit more specific about point three, experience is based on amount of damage done, right?
EXPERIENCE IN SPRING DOES NOT LEVEL AFTER 5 KILLS.
EXPERIENCE IN SPRING IS PER SUCCESSFUL ATTACK.
EXPERIENCE INCREASES A UNIT'S HITPOINTS.
Now everything's clear

To be a bit more specific about point three, experience is based on amount of damage done, right?
What?!? It affects accuracy, too? Given this is SJ telling me, I have to assume that's right.
That makes things extra interesting. I could make a unit with reeeeeally low hitpoints, then have the script bump Experience way up, and end up with an accurate shooter with non-insane hitpoints.
Oh, but wait... it gets more interesting than that. Given what I have seen in terms of how Spring handles accuracy, it clearly moves the origin of the shots around sometimes, not just the angle (I believe it turns the Piecenum named as the AimFromPrimary, but not visually)... any inaccuracy introduced via Experience might explain a lot of the problems people are having with units shooting each other.
So, if you want to have a mod that has ultra-accurate shooting, or shooting where any innaccuracy is introduced by the weapon... there's a solution, and you just need to scale everything appropriately. I guess my next question would be... is there a cap on this accuracy improvement, or is it some sort've scalar relationship, where it almost, but never quite equals one?
That makes things extra interesting. I could make a unit with reeeeeally low hitpoints, then have the script bump Experience way up, and end up with an accurate shooter with non-insane hitpoints.
Oh, but wait... it gets more interesting than that. Given what I have seen in terms of how Spring handles accuracy, it clearly moves the origin of the shots around sometimes, not just the angle (I believe it turns the Piecenum named as the AimFromPrimary, but not visually)... any inaccuracy introduced via Experience might explain a lot of the problems people are having with units shooting each other.
So, if you want to have a mod that has ultra-accurate shooting, or shooting where any innaccuracy is introduced by the weapon... there's a solution, and you just need to scale everything appropriately. I guess my next question would be... is there a cap on this accuracy improvement, or is it some sort've scalar relationship, where it almost, but never quite equals one?
Experience only affects accuracy by scaling the accuracy and sprayangle parameters so it would probably be a lot easier to change these then messing with some default experience. The cap for accuracy improvement is 90% reduction of (in)accuracy (reached at infinite experience)
Spring shouldnt give shots any random position offset at the origin, if it does its a bug.
Spring shouldnt give shots any random position offset at the origin, if it does its a bug.