Page 1 of 1

... the hell? (Script problem)

Posted: 11 Sep 2006, 23:23
by KDR_11k
I've got some weird problems (and we REALLY need that damn scripting forum since I have no idea if this goes in Help&Bugs or Mods or Art or General). My infantry is aiming completely incorrectly. Somehow they confuse heading and pitch and they don't turn around properly either (at least not at the proper angles). It worked without any changes to the aiming part before, though I don't know if that was before I installed build 2097. WTF is happening there? Why are they switching heading and pitch?

Image
Image

This is the script causing that:

Code: Select all

PoseAimUpper(heading,pitch)
{
	signal SIG_AnimUpper;

	turn chest to x-axis (0 - pitch / 2) speed <720>;
	turn chest to y-axis (heading - <40>) speed <720>;
	turn chest to z-axis 0 speed <720>;
	
	turn head to x-axis (0 - pitch / 2) speed <720>;
	turn head to y-axis <40> speed <720>;
	turn head to z-axis 0 speed <720>;
	
	turn rarm0 to x-axis (<-20> - pitch/2) speed <720>;
	turn rarm0 to y-axis <40> speed <720>;
	
	turn rarm1 to x-axis <-120> speed <720>;
	turn rarm1 to z-axis 0 speed <720>;
	
	turn rhand to x-axis <50> speed <720>;

	turn larm0 to x-axis (<-80> - pitch/2) speed <720>;
	turn larm0 to y-axis 0 speed <720>;
	turn larm0 to z-axis 0 speed <720>;
	
	turn larm1 to x-axis <-10> speed <720>;
	turn larm1 to z-axis 0 speed <720>;
	
	turn lhand to z-axis 0 speed <720>;
}


AimWeapon1(h,p)
{
	signal SIG_Aim;
	set-signal-mask SIG_Aim;
	if (weapontype) return FALSE;
	if (ammunition <= 0) {
		show ammosymbol;
		return FALSE;
	}

	oldreverse=reverse;
	reverse=0;
	if (h > <130> && h < <300>) {
		h = h - <180>;
		reverse = TRUE;
	}
	if(oldreverse!=reverse) {
		if (moving) {
			start-script AnimRun(reverse);
		} else {
			start-script AnimIdleLower();
		}
	}
	
	start-script PoseAimUpper(h,p);
	start-script ResetAim();
	return TRUE;
}
For comparison, the tank script works properly despite using the parameters in the same way:

Code: Select all

AimWeapon1(h,p)
{
	signal SIG_Aim1;
	set-signal-mask SIG_Aim1;
	if (ammunition > 0)
	{
		mainheading = h;
		turn turret to y-axis h speed <80>;
		turn cannon to x-axis 0-p speed <60>;
		wait-for-turn turret around y-axis;
		wait-for-turn cannon around x-axis;
		return TRUE;
	}
	else
	{
		show ammosymbol;
		return FALSE;
	}
}

Posted: 12 Sep 2006, 01:52
by Snipawolf
Ehh. +1 for a scripting forum, we seriously need that, and a few tutorials for people like me who are learning the ropes.. The tank one was good, but thats only the simple stuff..

Posted: 12 Sep 2006, 02:31
by Argh
Are you using restricted aiming arcs? If so... go read the aiming sections of the scripts I had in NanoBlobs 0.54b, where I addressed those problems.

Posted: 12 Sep 2006, 02:36
by TheRegisteredOne
wooh! i wanna play spring just for that mod. looks good. I'd help you, but I am too lazy. and i dont what they changes they made to the syntax in spring.

Posted: 12 Sep 2006, 02:41
by Das Bruce
Where are his pants? :?

Posted: 12 Sep 2006, 02:50
by Caydr
I think it must be a girl. Only girls wear shorts that short. skanks...

Posted: 12 Sep 2006, 02:54
by Peet
They're anim├â┬® girls, remember?

Posted: 12 Sep 2006, 02:59
by Das Bruce
P3374H wrote:They're anim├â┬® girls, remember?
Nope, I have no idea what mod this is.

Posted: 12 Sep 2006, 07:21
by FizWizz
It's KDR_11K's clone army, remember? Here's a link

Posted: 12 Sep 2006, 07:24
by KDR_11k
Argh: No, the aim is completely unrestricted. They should avoid unnatural torso rotations by turning around when firing at something behind them, even walk backwards if necessary. It did work before the aiming got screwed up like that.

The rest of you: It's this mod. I'm currently not working much on it because I've got exams at the University.

Posted: 12 Sep 2006, 07:35
by Zoombie
Even anime girls need pants, every now and again.

Also that bug is damned odd. I have no idea how to fix it, so why i'm posting here is a complete mystery.

Posted: 12 Sep 2006, 08:02
by Das Bruce
FizWizz wrote:It's KDR_11K's clone army, remember? Here's a link
I have seen this before, infact I have it, I just hadn't tested it yet since spring doesn't let you single player test without corcom >_<

Posted: 12 Sep 2006, 08:34
by KDR_11k
SpringSP, foo!

Posted: 12 Sep 2006, 08:51
by Das Bruce
Yes but its soo slooooow.

Posted: 12 Sep 2006, 08:54
by NOiZE
Moved to mods..


i think mods is the best category..

Posted: 12 Sep 2006, 09:04
by Argh
I have seen this before, infact I have it, I just hadn't tested it yet since spring doesn't let you single player test without corcom >_<
Yes it does. I do not have corcom in NanoBlobs. Or any "com" for that matter ;)