Mod Question Repository... Questions come in, answers go out
Moderator: Moderators
Are you by chance using AAI to playtest? If you are then try the non-obvious like cleaning out those pesky files the AAI creates with each run. Make a batch file that contains something like this:
c:
cd \
cd C:\Progra~1\TASpring\AI\AAI\learn\mod\
del %yourmodnamehere%.dat
Deleting that dat file stops a crash that happens when you change your mod's unit files. I'd recommend looking through your AAI folder and make sure both the mod and map folders have the config files they need, too. The config files don't all get created automatically.
c:
cd \
cd C:\Progra~1\TASpring\AI\AAI\learn\mod\
del %yourmodnamehere%.dat
Deleting that dat file stops a crash that happens when you change your mod's unit files. I'd recommend looking through your AAI folder and make sure both the mod and map folders have the config files they need, too. The config files don't all get created automatically.
I do.rattle wrote:For testing purposes I strongly suggest running spring directly using the Commander script.MadRat wrote:AI blah
I am not 100 percent positive its the FBI file, but I am decently positive because i can have all of the other files in play, but it won't crash until I let another units FBI in... Neither of the two units I have work, they both make it crash...Are you sure the error is in the .fbi and not another file?
Actually, I will just look around a lot, if both FBI's are crashing, then something somewhere else must be screwed up, eh?
Edit: (Not sure if its helpful or not) It crashes when it gets to loading "Units and Weapons"...
- Guessmyname
- Posts: 3301
- Joined: 28 Apr 2005, 21:07
Okay, I dunno what is wrong, but my gunship will not make its lesser turrets aim...
They don't aim, they just wait a second, then start shooting...
Script if ya wanna see (I had my way, then I used smoth's scripting way because it had less characters)
piece base, cannon, barrel1, barrel2, br, brfire, fr, frfire, bl, blfire, fl, flfire;
static-var restore_delay;
#define SIG_AIM 2
#define SIG_AIM2 4
#define SIG_AIM3 8
#define SIG_AIM4 16
#define SIG_AIM5 32
Create()
{
Restore_delay = 5000;
}
RestoreAfterDelay()
{
sleep restore_delay;
turn base to y-axis <0> speed <130>;
}
SweetSpot(piecenum)
{
piecenum = base;
}
AimWeapon1(heading, pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn cannon to x-axis (0-pitch) speed <40>;
turn base to y-axis (heading) speed <80>;
wait-for-turn cannon around x-axis;
wait-for-turn base around y-axis;
return (TRUE);
}
AimFromWeapon1(piecenum)
{
piecenum = cannon;
}
QueryWeapon1(piecenum)
{
piecenum = barrel1;
}
AimWeapon2(heading, pitch)
{
signal SIG_AIM2;
set-signal-mask SIG_AIM2;
turn br to y-axis (heading) speed <70>;
turn br to x-axis (0-pitch) speed <70>;
wait-for-turn br around y-axis;
wait-for-turn br around x-axis;
return (TRUE);
}
AimFromWeapon2(piecenum)
{
piecenum = br;
}
QueryWeapon2(piecenum)
{
piecenum = brfire;
}
AimWeapon3(heading, pitch)
{
signal SIG_AIM3;
set-signal-mask SIG_AIM3;
turn bl to y-axis (heading) speed <70>;
turn bl to x-axis (0-pitch) speed <70>;
wait-for-turn bl around y-axis;
wait-for-turn bl around x-axis;
return (TRUE);
}
AimFromWeapon3(piecenum)
{
piecenum = bl;
}
QueryWeapon3(piecenum)
{
piecenum = blfire;
}
AimWeapon4(heading, pitch)
{
signal SIG_AIM4;
set-signal-mask SIG_AIM4;
turn fl to y-axis (heading) speed <70>;
turn fl to x-axis (0-pitch) speed <70>;
wait-for-turn fl around y-axis;
wait-for-turn fl around x-axis;
return (TRUE);
}
AimFromWeapon4(piecenum)
{
piecenum = fl;
}
QueryWeapon4(piecenum)
{
piecenum = flfire;
}
AimWeapon5(heading, pitch)
{
signal SIG_AIM5;
set-signal-mask SIG_AIM5;
turn fr to y-axis (heading) speed <70>;
turn fr to x-axis (0-pitch) speed <70>;
wait-for-turn fr around y-axis;
wait-for-turn fr around x-axis;
return (TRUE);
}
AimFromWeapon5(piecenum)
{
piecenum = fr;
}
QueryWeapon5(piecenum)
{
piecenum = frfire;
}
AimFromWeapon6(piecenum)
{
piecenum = cannon;
}
QueryWeapon6(piecenum)
{
piecenum = barrel2;
}
edit: Alright, I got it to turn its cannons, but now it turns its main cannon down through its body for no reason every once in a while, and the two cannons on the far side will only turn up or down if the target is on that side...
edit2: Okay, still have the main cannon problem, but none of the other cannons will make it go through itself, but will fire through itself. Are the other cannons problems a placing problem in UpSpring? I'll check on it.
BTW, will weaponmaindir help me with this, does it limit where the unit fires, or where it CAN fire?
Edit3: god, I must suck, it won't even shoot at enemies, WITH ITS CRAPPY AIMING!
They don't aim, they just wait a second, then start shooting...
Script if ya wanna see (I had my way, then I used smoth's scripting way because it had less characters)
piece base, cannon, barrel1, barrel2, br, brfire, fr, frfire, bl, blfire, fl, flfire;
static-var restore_delay;
#define SIG_AIM 2
#define SIG_AIM2 4
#define SIG_AIM3 8
#define SIG_AIM4 16
#define SIG_AIM5 32
Create()
{
Restore_delay = 5000;
}
RestoreAfterDelay()
{
sleep restore_delay;
turn base to y-axis <0> speed <130>;
}
SweetSpot(piecenum)
{
piecenum = base;
}
AimWeapon1(heading, pitch)
{
signal SIG_AIM;
set-signal-mask SIG_AIM;
turn cannon to x-axis (0-pitch) speed <40>;
turn base to y-axis (heading) speed <80>;
wait-for-turn cannon around x-axis;
wait-for-turn base around y-axis;
return (TRUE);
}
AimFromWeapon1(piecenum)
{
piecenum = cannon;
}
QueryWeapon1(piecenum)
{
piecenum = barrel1;
}
AimWeapon2(heading, pitch)
{
signal SIG_AIM2;
set-signal-mask SIG_AIM2;
turn br to y-axis (heading) speed <70>;
turn br to x-axis (0-pitch) speed <70>;
wait-for-turn br around y-axis;
wait-for-turn br around x-axis;
return (TRUE);
}
AimFromWeapon2(piecenum)
{
piecenum = br;
}
QueryWeapon2(piecenum)
{
piecenum = brfire;
}
AimWeapon3(heading, pitch)
{
signal SIG_AIM3;
set-signal-mask SIG_AIM3;
turn bl to y-axis (heading) speed <70>;
turn bl to x-axis (0-pitch) speed <70>;
wait-for-turn bl around y-axis;
wait-for-turn bl around x-axis;
return (TRUE);
}
AimFromWeapon3(piecenum)
{
piecenum = bl;
}
QueryWeapon3(piecenum)
{
piecenum = blfire;
}
AimWeapon4(heading, pitch)
{
signal SIG_AIM4;
set-signal-mask SIG_AIM4;
turn fl to y-axis (heading) speed <70>;
turn fl to x-axis (0-pitch) speed <70>;
wait-for-turn fl around y-axis;
wait-for-turn fl around x-axis;
return (TRUE);
}
AimFromWeapon4(piecenum)
{
piecenum = fl;
}
QueryWeapon4(piecenum)
{
piecenum = flfire;
}
AimWeapon5(heading, pitch)
{
signal SIG_AIM5;
set-signal-mask SIG_AIM5;
turn fr to y-axis (heading) speed <70>;
turn fr to x-axis (0-pitch) speed <70>;
wait-for-turn fr around y-axis;
wait-for-turn fr around x-axis;
return (TRUE);
}
AimFromWeapon5(piecenum)
{
piecenum = fr;
}
QueryWeapon5(piecenum)
{
piecenum = frfire;
}
AimFromWeapon6(piecenum)
{
piecenum = cannon;
}
QueryWeapon6(piecenum)
{
piecenum = barrel2;
}
edit: Alright, I got it to turn its cannons, but now it turns its main cannon down through its body for no reason every once in a while, and the two cannons on the far side will only turn up or down if the target is on that side...
edit2: Okay, still have the main cannon problem, but none of the other cannons will make it go through itself, but will fire through itself. Are the other cannons problems a placing problem in UpSpring? I'll check on it.
BTW, will weaponmaindir help me with this, does it limit where the unit fires, or where it CAN fire?
Edit3: god, I must suck, it won't even shoot at enemies, WITH ITS CRAPPY AIMING!
Weaponmaindir will help with cannons firing through itself, you'll just have to calculate proper directions and max. angles for all turrets.
Also, your script has this:
It's turning one piece around 2 axes at once. I seem to remember this causing problems... Thing to note is your main gun is done differently (it has 2 different pieces).
Also, your script has this:
Code: Select all
turn fr to y-axis (heading) speed <70>;
turn fr to x-axis (0-pitch) speed <70>;
wait-for-turn fr around y-axis;
wait-for-turn fr around x-axis;
Perhaps that is why you don't have problems, each piece has one rotation. :)rattle wrote:Haven't had (or noticed) any problems with turning the same piece around two axes yet, but you should have a turret piece and a barrel one. The latter will aim on the x-axis and the former turn around the y-axis.
Well, I'm trying it, I just got it rigged up to do it (Its kinda confusing cuz two turrets are on their sides and the other two are normal...)
Hope it works!
edit: It didn't work!
The unit is still firing even though its turrets are roughly twenty-five percent off!
It didn't make any difference at all!
Hope it works!
edit: It didn't work!
The unit is still firing even though its turrets are roughly twenty-five percent off!
It didn't make any difference at all!
You know that they should point forward by default (Z+). If they don't, adjust the firepoint's rotation to match the turret's direction (where they actually point to). That should work... i.e. a turret points backward then either rotate the firepoint by 180° around the y-axis or have the turret face forward and rotate the turret then in upspring by 180° instead.
Or you could have everything point straight forward by default and rotate it by script (in Create()).
Or you could have everything point straight forward by default and rotate it by script (in Create()).