More WCP Pascal Questions

Jason_Ryock

Vice Admiral
1) Is it possible (and if so sample code) to arrive at a Nav Point and have a ship there turn around and fly away and then disappear after a few seconds (Like he autonaved away or something)?

2) How exactly does the SF_BindToActionSphere option work?

3) What kind of code do I use to make it NECESSARY for a specific (or more then one specific) ship to survive a mission?

4) What code do I use to make it necessary to kill a capship before re-engaging autopilot?

5) Lastly, where can I get a more detailed explanation of the commands in the WCP.Pas file? Thomas' site doesn't list them all.
 
1) Is it possible (and if so sample code) to arrive at a Nav Point and have a ship there turn around and fly away and then disappear after a few seconds (Like he autonaved away or something)?
Any object can disappear using DeActivateObject (don't remember if that is AI or SF command)
To fly away you can use goto's function.

2) How exactly does the SF_BindToActionSphere option work?
Try you understand the "bind" word. It mean attached to navpoint or all navpoints if you put 0 value. Next, "attached" mean that if the nav is deactivate, the object too(if the object is into that nav point of course).

3) What kind of code do I use to make it NECESSARY for a specific (or more then one specific) ship to survive a mission?
I don't remember excatcly the function name, in one hand, for pilots don't dead search some as "inmortal" on functions names, in other hand use the parameter OF_Vulnerable on the function to setflags of objects.

4) What code do I use to make it necessary to kill a capship before re-engaging autopilot?
SF_AutoPilot in your 3 variants, diabled, enabled and resummenormal.

5) Lastly, where can I get a more detailed explanation of the commands in the WCP.Pas file? Thomas' site doesn't list them all.
That I'm questioning myself :). There are not enough documentation more than that you look in Thomas Page, all remaining is test, test, and text again. :D
If you is a programmer (I don't say only in wcpascal), some functions you can imagine how work.
A simple way to test is to use SYS_Message function between the code that you write, so you can know if the code flow by that place or not.
 
TanGO said:
That I'm questioning myself :). There are not enough documentation more than that you look in Thomas Page, all remaining is test, test, and text again. :D
I know, I know... :p
 
Quarto, we could write begining with SF_ functions, because AI functions already are write on Thomas page. :). I could write that I know and next you complete others... what think about? :D
 
Well, even the AI function descriptions on Thomas' page are fairly incomplete, so they'd have to be done too. I've made a start on expanding those. Once I've got enough (at least ten or fifteen functions), I'll send them to KillerWave to upload onto his page. Later on, we can continually update the page with more functions. And yeah, if you could write the descriptions of some of the SF functions, that would be great - just email them to me, and I'll put it all together ;).
 
There's a file with WCP Pascal that has some clues in it, WCPPAS.TXT, I think it's called. It's been helpful, but still damned confusing.
 
You mean wcp.pas - that's the file where all the functions are declared, so that WCPPas knows how to use them.
 
Anyway:

function M_NAV3;
begin
while(1) do begin
if (NAV_WithinSphere(Player)) then begin
NAV_ActivateSelf;
AI_WaitSeconds(4);
while(NAV_WithinSphere(Player)) do begin
****AI_WaitSeconds(4);****
SF_SetMissionSuccess;
end;
NAV_DeactivateSelf;
end;
AI_WaitSeconds(1);
end;
end;

For my Nav, the line with ****'s around it was missing from the sample text, and apparently it's necessary if the object is going to appear only at a single nav. Same deal with my Ship's Function. Needed the AI_WaitSeconds before and after the "Bindto actionsphere command" for it to work right. Took me a few hours to figure out.
 
Jason_Ryock said:
No I don't. I mean WCPC.TXT. That's right, .txt. Go peek at it. It's useful.
Ah, that one. Yeah, that's pretty useful, although you have to be careful, since it talks about WCP C syntax, which is slightly different to WCP Pascal.
 
Jason_Ryock said:
Anyway:
For my Nav, the line with ****'s around it was missing from the sample text, and apparently it's necessary if the object is going to appear only at a single nav. Same deal with my Ship's Function. Needed the AI_WaitSeconds before and after the "Bindto actionsphere command" for it to work right. Took me a few hours to figure out.

Many times you will use the AI_Waitseconds to ensure that the function run next of execute other functions. That's, as the engine is running many functions at the same time sometimes the engine itself need a time to adecuate own internal variables.
 
Back
Top