... the hell? (Script problem)

... the hell? (Script problem)

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

... the hell? (Script problem)

Post 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;
	}
}
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post 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..
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post 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.
User avatar
TheRegisteredOne
Posts: 398
Joined: 10 Dec 2005, 21:39

Post 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.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

Where are his pants? :?
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

I think it must be a girl. Only girls wear shorts that short. skanks...
User avatar
Peet
Malcontent
Posts: 4384
Joined: 27 Feb 2006, 22:04

Post by Peet »

They're anim├â┬® girls, remember?
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

P3374H wrote:They're anim├â┬® girls, remember?
Nope, I have no idea what mod this is.
User avatar
FizWizz
Posts: 1998
Joined: 17 Aug 2005, 11:42

Post by FizWizz »

It's KDR_11K's clone army, remember? Here's a link
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post 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.
User avatar
Zoombie
Posts: 6149
Joined: 15 Mar 2005, 07:08

Post 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.
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post 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 >_<
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

SpringSP, foo!
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

Yes but its soo slooooow.
User avatar
NOiZE
Balanced Annihilation Developer
Posts: 3984
Joined: 28 Apr 2005, 19:29

Post by NOiZE »

Moved to mods..


i think mods is the best category..
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post 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 ;)
Post Reply

Return to “Game Development”