Pascal--nonrecruitment thread

Iceblade

Admiral
Okay, does anybody know how to create new targetids and to change ship names in the game? (Like a bearcat reads as a piranha in the games targetid just above the target ship armor and shield levels.)
 
AAAHHHH!!!!

This spawn doesn't make any sense? It keeps asking for a statement before the the M_DSpawn, and when I get rid of the D and it refers back to the utils, it doesn't work in the mission. Okay Quarto, where is the error because I am not seeing it? (FYI, putting it within the var causes the same compile error)

function M_Nav1;
var
setup = true;
begin
while(1) do begin
if (NAV_WithinSphere(Player)) then begin
NAV_ActivateSelf;
SF_Activateobject(Transport, 0);
//M_DSpawn(31, 7, 5000, 0, -250);
if (setup) then begin
setup := false;
end;
end;
end;
if (Nav_WithinSphere(Player)) then begin
AI_Waitseconds(10);
M_DSpawn(31, 7, 5000, 0, -250);
end;
end;

function M_DSpawn(shipId, count, x, y, z);
var
ox, oy, oz;
begin
while(count > 0) do begin
ox := x + SYS_Random(600) - 300;
oy := y + SYS_Random(600) - 300;
oz := z + SYS_Random(600) - 300;
m_AliveEnemies := m_AliveEnemies + 1;
NAV_CreateShip(shipId, 138, 0, @M_DFighter, @M_DFDeath, ox, oy, oz);
AI_WaitMilliseconds(275);
count := count - 1;
end;
end;

function M_DFighter;
begin
SF_Activateself(0);
end;

Function M_DFdeath
begin
end;
 
Try swapping the two functions around, so that in your program, M_DSPawn comes first, followed by M_Nav1.
 
Found that and eveything in that mission funs smoothly, including an exit. Hey, I will e-mail you the file of that other mission--earlier version though--that had all those nasty problems with the spawning. This version works fine and should work on every SO. But I need to test this. You might enjoy it. It has a success, but I don't think it has a failure.

Thanks for all of your assistance with my modding. :D
 
How about adding ships to the ships.pas. How do you do that and it work properly?

Also, how do you fix those targstrs? They are all screwed up. I've got a transport named Excalibur that comes up-oddly enough--Thunderbolt. Plus, I had the Bearcats and Hellcats being called Piranhas. It just acts really screwy.

Quarto--I could really use some help in getting that jumppoint to go away. The capships go away, but the jumppoint stays. I think that maybe a jumppoint object has to be treated differently than a capship or fighter in way of its activation. Also, if you want a more up-to-date/less bugy mission, just let me know.

Iceblade
 
Ships.pas is just a list of constants. You can add anything you like in there, but it won't make any difference whatsoever. You'd have to edit game\ships.iff. Even there, you cannot add new ships, only replace the ones that are already in there.

Those target strings are working exactly as they should be - just because something doesn't work how you'd like it to work doesn't mean it's screwed up :p. Each ship file contains a reference thingy that will determine what VDU image and target string it will use.

Why the heck do you have two dozen identical functions in your mission? If two ships have identical main functions, they can share a single function, you know.

Are you sure the navpoint doesn't go away? As far as I can see, the only way you can tell this is because the jump buoy doesn't disappear. But jump buoys don't need main functions, and as far as I know, they might not even use them - in which case, your actionsphere 1 jump buoy may very well be using the default actionsphere 0 setting. Try getting rid of its main function and adding the "actionsphere:" property to its object declaration.

Finally, it's better if you post your code here (or include your mission as an attachment to your post). I don't always have time, and whether you email your mission to me or post it here, it won't make a difference in regards to when I get around to look at it; on the other hand, if you post your code here, other people can check it too.
 
Everytime I put a ship in their, it doesn't compile?
I am trying to spawn 7 cdrones at a certain set of corridinates.

I also commented out the activate for the jumpbuoy and its function, but it still refuses to go away. And it doesn't like have the bindtoactionsphere in its object settings. Oh, wait putting in "actionsphere: 1;" worked.

Also, what I meant by screwed up is it is screwy trying to put in what I what to put in. When I add a new targstr it doesn't work in the game properly. How do I add in the targstrs I want and just how does it work--cause I get some really screwy results. I have an object called "transport" with a targstr of ["unknown"] and it says "Transport: Unknown". Is this how the game reads targstrs?

I also have a problem with having several wings of craft in the code and they follow me. I haven't tried to fix this problem since last year, so I will see what I can do.

Also, my navs are acting screwy again.

Nav_1 works like a dream except for that one jumpbuoy, but Nav_2 doesn't set the navpoint to 3. Any ideas guys?

function M_Nav2;
var
setup2 = 1;
begin
while(1) do begin
if (NAV_WithinSphere(Alpha1)) then begin
Nav_ActivateSelf;
if (setup2) then begin
M_Spawn(2,17,32000,32000,25000);
M_Spawn(30,10,32222,32000,25222);
setup2 := 0;
end;
NAV_SetPlayerNav(3);
end;
if (NAV_WithinSphere(Alpha1) = 0) then begin
NAV_DeactivateSelf;
end;
while(Nav_WithinSphere(Alpha1)) do begin
AI_WaitSeconds(1);
end;
end;
end;
 
What value have Alpha1?
I guess you code is not looping, it's stoped by:
while(Nav_WithinSphere(Alpha1)) do begin
AI_WaitSeconds(1);
when the code reached the first loop.
The function never will process the NAV_DeactivateSelf

"Nav_1 works like a dream except for that one jumpbuoy, but Nav_2 doesn't set the navpoint to 3. Any ideas guys?"
navdata of nav 3 is "3"?
 
yep, all nav values are spaced out and correct: NAV_1 is 1, NAV_2 is 2, etc. What do you mean "What value have Alpha1?", which value?
 
Your Code is:
Nav_WithinSphere(Alpha1))

Player object is alpha1?

Anyway, check if the Nav3 is active, and test to put the NAV_SetPlayerNav(3) previous to M_Spawn functions.
 
About those target strings - I guess you must mean capships. Yes, it's normal for capships to use the object name as their target string in the game. However, there is a way around this. Don't give them a targetid property, and instead declare them like this:

object Cruiser(Capship) as "Hydra"

(the name you enter in the quotation marks in this case does not have to be present in any ENG file)

As for the navpoint, I must say, I don't see any problem in the code, so I don't know why it doesn't work.
 
Well, I have now gotten everything to work, but I do need to know how to make another wing follow me and to create a new wing with a spawn.
 
The mission will not go to nav 3 because it can't find an object in formation. Since the problem could be in a number of places throughout the code, I am attaching the code in txt form.
 

Attachments

  • object formation error in code.txt
    11.8 KB · Views: 52
It seems Tango accidentally replied to your question in the wrong thread. Read his comments about wing-related stuff here :).
 
I already read that post and then ended up with this error. At least I can always go back to the text I uploaded to get it working again. :rolleyes:
 
If you can not find the error, the better is to do a copy of the code.
Only leaving the primary objects and test until work fine.
Once the mission basics flow work, add the remainder code in parts.
Test you each part added until the error appear.

Quarto said:
It seems Tango accidentally replied to your question in the wrong thread. Read his comments about wing-related stuff here :).

Quarto, Iceblade did the requirment in standoff thread too :p , for that I posted there.
 
What I need to know is what it is looking for to be able to fix the problem--I already know the problematic lines of code to get it to work, it just it would take forever to copy all the necessary bites to code that would have to do with getting this problem fixed. It keeps telling me that it can't find the a particular object in formation--what is this referring to?
 
All right!!!!!, welcome at the code team!!! :)
Listen, many times we have mistakes, on normal programs it easy follow the code error becuase generally routines work in linear mode, in wcp lis not like this.
All functions are working at same time and solve a problem can take many time.
If you get "it can't find the a particular object in formation" the review the code where objects are created. Besides, I still thinking that the better solution is begin with basic flow and add code by parts (yes that is a lot time but surely a quite less than search in all code)
 
*sigh* :( :(

Very confusing :confused: :confused:

I put all everybody back on wing--like it was before--and got rid of the AI_setauto... and it doesn't work. I am now throughly confused. My Quarto might know what "Can't locate the object in formation" error means exactly. :(
________________________________________________________________
Wierd the one I uploaded works fine, but I don't think that there are that many differences. I'll have to compare them later, gotta go.
 
Back
Top