Page 2 of 4

Posted: 12 Oct 2006, 16:44
by SpikedHelmet
Sheesh, yes of course I tried it by making him kill enemy units... I'm not that much of an idiot. I set it to < 10 (and had him gain 10 exp).

Posted: 12 Oct 2006, 17:16
by rattle
Experience < 10 or Experience < 0.1? The latter is 10 XP (at least I think so).
You could take a look at OP's War Evo, it's full for XP based weaponry.

Posted: 12 Oct 2006, 18:03
by KDR_11k
I've had infantry in GINTA gain additional firepower and infinite ammo if their experience was > 1.00 and that worked perfectly.

Posted: 12 Oct 2006, 21:15
by SpikedHelmet
We got it working. 10 is very hard to get (for these infantry atleast) but we'll try to work something out..!

Posted: 12 Oct 2006, 21:18
by Argh
Code?

Posted: 12 Oct 2006, 22:14
by Guessmyname
SpikedHelmet wrote:infantry having limbs torn in showers of blood
I have, actually, already managed this.

Posted: 12 Oct 2006, 22:15
by Zoombie
I demand a demonstration!

Posted: 12 Oct 2006, 22:22
by rattle
Red CDirt for the win, eh? :)

Posted: 12 Oct 2006, 22:29
by KDR_11k
SpikedHelmet wrote:We got it working. 10 is very hard to get (for these infantry atleast) but we'll try to work something out..!
When get VETERAN_LEVEL returns 10 the unit has 0.10 experience.

Posted: 12 Oct 2006, 22:32
by Snipawolf
lol...

Posted: 12 Oct 2006, 23:04
by rattle
Simple script calculating the angle a unit turned

Code: Select all

// Add GPL header here, I'm lazy I know
#define ANIM_SPEED 37.5

TurnControl()
{
	var RefreshRate, UnitHeading, TurnAngle;
	RefreshRate = ANIM_SPEED;

	UnitHeading = get XZ_ATAN(7); // XZ_ATAN(0) or any other small value do all return the angle from the current heading to the north. If the unit is facing to the north the angle is 0, if it is facing to the south it's 32768 (or 180° or <180>).

	
	while (TRUE)
	{
		sleep RefreshRate;

		UnitHeading = get XZ_ATAN(7) - UnitHeading; // This is the distance the unit turned after time RefreshRate. The value of UnitHeading can vary. The lower RefreshRate the smaller the value; the higher the TurnRate (in the FBI), the larger the value. edit: Changed this so that left is in the negatives and right is positive.

		if (UnitHeading != 0) // UnitHeading is 0 when the unit stands still
		{
			// Reset if the directions change
			if ((UnitHeading < 0 AND TurnAngle > 0) OR (UnitHeading > 0 AND TurnAngle < 0)) TurnAngle = 0;
			
			// Adding to the angle over time
			TurnAngle = TurnAngle + UnitHeading;
			
			// Do stuff if TurnAngle >= 45° to the left
			else if (TurnAngle <= -8192)
			{

			}
			// Do stuff if TurnAngle >= 45° to the right
			else if (TurnAngle >= 8192)
			{

			}
			else
			{
				// Do stuff other stuff, like resetting something.
			}
		}
		else
		{
			TurnAngle = 0;
			// Do other stuff, like resetting something.
		}
		UnitHeading = get XZ_ATAN(7); // New last heading of the next iteration
	}
}
Create()
{
	...
	start-script TurnControl();
}
It's not a complete unit script but a small function get the real TurnAngle of a unit when it's turning, even when it's rotating in place. It doesn't need any other pieces on the model nor does it depend on a fixed refresh rate.

Can have various uses, I'm using it to reverse the tracks on a tank when it's turning and it works just fine (finally).

Also some thanks fly out to zwzsg, probably wouldn't be a bit further if he didn't explain some stuff to me (concerning XZ_ATAN) and KDR as well, that counter rawks 8)

Posted: 13 Oct 2006, 00:13
by Snipawolf
Could FloZi or someone put how to make tank treads look like they roll?

Posted: 13 Oct 2006, 00:18
by PauloMorfeo
This stuff will get lost whenever people stop posting in it and, eventually, gets out of 1st page...

Stick it or add all that code samples to the wiki?

Posted: 13 Oct 2006, 00:21
by Snipawolf
I don't think so, It will get stickied most likely, if not I'll bump it to life... A lot.. I don't wanna see these peoples time and effort wasted..

Posted: 13 Oct 2006, 00:23
by SpikedHelmet
Snipawolf wrote:Could FloZi or someone put how to make tank treads look like they roll?
I second that :S

Posted: 13 Oct 2006, 00:26
by Snipawolf
I thought you knew how to do that. o.0

Posted: 13 Oct 2006, 00:26
by FLOZi
SpikedHelmet wrote:
Snipawolf wrote:Could FloZi or someone put how to make tank treads look like they roll?
I second that :S
It's really Argh's tread script implemented in a slightly different manner.

Where he changes geometry, I keep geometry and offset the texture.

Posted: 13 Oct 2006, 00:27
by Snipawolf
Well then could Argh post it? Either way doesn't matter, but I would rather the most efficient one..

Posted: 13 Oct 2006, 00:38
by FLOZi
It really depends on the model which method is likely to be better.

i.e. simple treads lend themselves more to mine, but complex modelling of the treads lends itslef to Arghs. Also I imagine thingymajigs script with the reversing treads won't work with mine.

Posted: 13 Oct 2006, 00:56
by Snipawolf
Both of ya can post em up then, I guess.