Help with tutorial

Unknown AI command errors mean that an object is using a command that it's not designed to use (so if you try AI_IgnoreCollisions on a capship, you'll get the same error; we don't really have a list of what works for what object types, so you usually can only try and see what happens). Put the command inside a ship function instead of a navpoint function, and it will work.
 
AAARRGGHHH.....*rips hair out* This thing is acting crazy! I have tried several things that don't seem to work. The game just crashes right after all enemies are dead. More code, I know, I know. Yes there is a var = Refuel.
function M_Alpha1;
begin
SF_SetObjectFlag (OF_alignment,ALIGN_Confed);
SF_ActivateSelf(0);
SF_PlayerSwitchToCam(CamID_cockpit, Alpha1);
while(1) do begin
AI_WaitSeconds(1);
if(Refuel) then begin
AI_ReplenishMissilesAndFuel;
Refuel := false;
end;
end;
end;
if (setup2) then begin
M_Spawn(2,17,34000,25000,2330);
//M_Spawn(30,10,34222,26222,2330);
M_WaitUntilDead;
M_FRSpawn(22, 2, 13000,13000,455);
M_FPSpawn(38, 3, 14000,13445,455);
Refuel := true;
setup2 := false;
end;
 
No errors given in game or compile, just a basic crash back to the launcher screen. Do you need me to e-mail you the code-big portions I mean like important objects, navs certain functions and vars?
 
No, I don't. Crashes without an error are a nuisance that I don't really have the time for today, so I'm afraid you're on your own with this, at least for now. My advice would be to try undoing, one by one, the changes you made since the last time. This should allow you to pin down the cause of the crash.
 
:D :D :D I FOUND ITT!!!!!! :D :D

It is a problem with the spawning.

Is there a limit on the number you can add to a wing?
 
Yes. Otherwise, the wing formations could get out of hand.

As for that e-mail that you sent, "AIQ::removeFromAIQ remove called on control not in list.", IIRC, is also wing-related, somehow.
 
What was wierd is that it had to do with a bind to sphere, but when I moved the activate to the nav function and it worked. Now I have another problem is has me baffled. What kind of a function is 'SF_WithinRangeObj(Refueler, Alpha1, 5000);'. Is it a wait or a checking of something or a setting of a flag.
 
I'm much too lazy to look up any relevant documentation, and I don't believe I've ever used the function, but I assume it checks if alpha1 is within 5000 units of Refueler. If so, it would return true, if not, false. I may, of course, be horribly horribly wrong.
 
You're correct, TC, except for one detail. All the distances used in functions are multiplied by 10 in the game. So, in this particular case, it would end up checking if Alpha1 is within 50,000 metres of the Refueler.
 
That would of been good to know several weeks ago when I started Pascal! :( :(

Now I have to redo all of my kilometers. Of course this explains it. Thank you. :D
 
Iceblade said:
That would of been good to know several weeks ago when I started Pascal!
Well now, you've only got yourself to blame. This isn't some great big secret, it's mentioned in Thomas' documentation, and which you should have read before even starting to learn.
 
Annoying, but no big

Now to the problem with the wait for the refuel. Here is the code, so what is wrong with it?
while(1) do begin
AI_WaitSeconds(1);
if(Refuel) then begin
AI_ReplenishMissilesAndFuel;
Refuel := false;
end;
end;

if (NAV_WithinSphere(Alpha1)) then begin
Nav_ActivateSelf;
if (setup2) then begin
M_Spawn(2,17,31000,30000,2330);
M_WaitUntilDead;
AI_WaitSeconds(15);
SF_ActivateObject(Refueler,0);
M_FPSpawn(38,3,28400,28440,455);
if(SF_WithinRangeObj(Refueler,Alpha1,500)) then begin
SF_WithinRangeObj(Refueler,Alpha1,500);
AI_RefuelCutscene(Alpha1, Refueler);
Refuel := true;
end;
setup2 := false;
end;
 
I have no idea what's wrong with it - after all, you haven't told us what the problem is. Does it crash or something?

As for your other question, you use the AI_SetAutopilotData(x, y, z) command. The ship that is to autopilot with the player uses the command (if it has wingmen, they will automatically join it, IIRC). The position is relative to the player. Don't forget to make the ship in question actionsphere 0, or it won't actually appear at the next navpoint. Also, when you want the ship to stop autopilotting with the player, use the same command, but with 0,0,0 as the coordinates.
 
Quarto did you even read my message. Well what it is doing is it is telling(nonverbally) that I am not in range and it doesn't make refuel = true. Yet when this SF_range is not inside a while or if line it just skips over this piece of code entirely and makes refuel = true without me being 5,000 clicks from the ship.

Alright, now I have that other thing working.
 
Yeah, I did. If you said that the range-checking doesn't work, you must have said it non-verbally too :p.

I've never actually bothered using the SF_WithinRangeObj command (normally, I use SF_GetDistance(tag)), but looking at the way it's used in SO missions, it appears as though this command may have been described incorrectly in wcp.pas. I believe that this command probably needs to be used by one of the ships in question, and tag2 should actually be a number. Probably the minimum range.
 
Back
Top