any way to get the experience value in the script?

any way to get the experience value in the script?

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

any way to get the experience value in the script?

Post by Optimus Prime »

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
Gnomre
Imperial Winter Developer
Posts: 1754
Joined: 06 Feb 2005, 13:42

Post by Gnomre »

I *think* they implemented VETERAN_LEVEL in one of the revisions, but I'm not sure off the top of my head. I think it was one of the TAK identifier things. No way to change the unit's display name though.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

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);
	}
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

this script doesnt check if the weapon hits an enemy or not. So you can easily abuse it by shooting the ground. (if im right)
So i have to wait for a real implementation for that...
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

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
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Post by Archangel of Death »

*Digs into his changelog once again*
0.67b1
...
-COB support for Getting/Setting veteran level and unit speed.
The returned veteran level is unit experience multiplied by 100
...
I'm guessing the exact code would be

Code: Select all

GET VETERAN_LEVEL
SET VETERAN_LEVEL
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

whoa! That sounds cool :)
Have to make some test in the next days. Than i will post my result...
Thanks you two
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Wait, wait, wait...

Does SET VETERAN_LEVEL actually work?
Archangel of Death
Posts: 854
Joined: 28 Jan 2005, 18:15

Post by Archangel of Death »

I imagine it is just as untested as GET/SET speed.
User avatar
kujeger
Posts: 91
Joined: 07 Oct 2004, 14:46

Post by kujeger »

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
Didn't someone dig around in the code and discover that experience doesen't affect accuracy?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

EXPERIENCE IN SPRING DOES NOT AFFECT ACCURACY.

EXPERIENCE IN SPRING DOES NOT LEVEL AFTER 5 KILLS.

EXPERIENCE IN SPRING IS PER SUCCESSFUL ATTACK.

EXPERIENCE INCREASES A UNIT'S HITPOINTS.



Everybody clear now? ;)
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Experience affects accuracy among other things...
User avatar
FizWizz
Posts: 1998
Joined: 17 Aug 2005, 11:42

Post by FizWizz »

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 :wink:
To be a bit more specific about point three, experience is based on amount of damage done, right?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

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?
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

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.
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

what about reloadtime.. ?
Post Reply

Return to “Engine”