Help with tutorial

I have no idea. Sorry man. Try setting a condition that would cause the binding to be false when you return to nav2.

I got it! You could go to nav3 and there would be a transport. take that along with you to nav2 and use a var to make the binding false when that transport has arrived at nav2. There, that should do it.
 
Thanks for your help! :) but I already have a variable for that. it turns to "true" when I go to nav 2 after killing the morays, but I just don't know how to make the binding false...

Just wondering also, I've seen you working with objectives and all that... Do you know of any in-depth WCP-PAS tutorial online?
 
E-mail me your whole code and I will see if I can fix this problem.
e-mail me at my homepage in my profile.
 
Do you guys even check fan projects and editing forum. Well I have problem with those navpoints. Check my help thread for details.
 
Iceblade said:
SF_BindToActionSphere(0);
Essientially you are telling the program to bind the Midway to nav0 which doesn't exist.
Presumably, Ronald's problems have already been fixed, but this is something worth clarifying for everyone. BindToActionSphere(0) does NOT bind a ship to a non-existent nav 0. Actionsphere 0 is _everywhere_. This is what you use for the player's wingmen and the like - ships that you want to autopilot with the player and show up at the next navpoint.

By the way, AI_SetAutopilotData(-150, -150, -40); tells the Midway to autopilot with the player, so it probably wasn't what you wanted, Ronald :p.
 
Oh no! THe autopilot lines were fine, it was just that I had a BindtoSphere line in the wrong place and that was causing all the trouble. :D
 
Not really.. I drop the Midway at Nav 2 and go to nav 3, fight a bit, return to Nav 2, grab Midway again and return to nav 1. Just wanted to play a bit with autopilot, BindtoActiveSphere and such.. Making things a bit harder each time.. :p

Now I'm into real missions (started yesterday). I'm modifying a sim mission I made, adding it objectives and such.. ;)
 
Man! This navs are acting screwer than ever.
I have now put the spawns in the death function of a unit and it doesn't work. Plus I get this message when I fo to nav2 "DB: CActionSphere::inactiveAlter (nav_2) - program ended.
What is weird is the mission won't run without the nav functions being wrong-aka can't have this "Alpha) = false)" in nav2 for deactivation, yet without it, it just screws up at a later point. Do you guys have any answers.

function M_Nav1;
var
setup = true;
begin
if (NAV_WithinSphere(Alpha1)) then begin
Nav_ActivateSelf;
SF_ActivateObject(Midway, 0);
SF_ActivateObject(Destoryer, 1);
SF_ActivateObject(Cruiser, 0);
setup := false;
end;
NAV_SetPlayerNav(2);
until(NAV_WithinSphere(Alpha1)=false) do begin
AI_WaitSeconds(1);
end;
NAV_DeactivateSelf;
end;

function M_Nav2;
var
setup = true;
begin
if (NAV_WithinSphere(Alpha1)) then begin
Nav_ActivateSelf;
setup := false;
end;
NAV_SetPlayerNav(1);
until(NAV_WithinSphere(Alpha1)) do begin
AI_WaitSeconds(1);
end;
NAV_DeactivateSelf;
end;

function M_Death;
begin
M_FSpawn(17,3,0,0,-189);
M_FSpawn(20,3,0,0,-191);
M_Spawn(2,15,2100,640,233);
M_Spawn(30,8,6650,640,233);
M_Spawn(11,6,6650,640,233);
end;
 
Iceblade said:
I have now put the spawns in the death function of a unit and it doesn't work.
Of course it doesn't. Take a closer look at the spawn functions in utils.pas. At their heart is a command that begins with 'NAV'. Such commands can only be run by navpoints.

Plus I get this message when I fo to nav2 "DB: CActionSphere::inactiveAlter (nav_2) - program ended.
See other thread. Your navpoint ended its function, and that should never happen.
 
Is there a condition that will spawn these units after the death of a peticular unit--Alien Ace?

P.S. do I have to use a different spawn function for each unit or can I stick them in the same function.
 
I've told you in the other thread - use a variable. Have the ace's death function set a certain variable to true (or false, or anything else you like). Then make the navpoint check whether that variable is true, and if it is, start spawning.

You can use the same spawn function to spawn everything, if you like.
 
O.k. I got the spawn to work, but I did something that screwed it up and I can't get it to go back, so I now have it set to something simplier-a wait some seconds then spawn. This really makes more sense since the bugs would launch more or else immediately instead of waiting for their Ace to die.

Navs don't work and objectives-I ain't even going to try until everything is fixed. Thank you for all your help. :) :D

Again more code-this is only nav 1 because their are no changes that are needed to nav2 for the auto to work.
function M_Nav1;
var
setup = true;
begin
while(1) do begin
if (NAV_WithinSphere(Alpha1)) then begin
Nav_ActivateSelf;
SF_ActivateObject(Midway, 0);
SF_ActivateObject(Destoryer, 1);
SF_ActivateObject(Cruiser, 0);
AI_WaitSeconds(45);
M_FSpawn(17,3,0,0,-189);
M_FSpawn(20,3,0,0,-191);
M_Spawn(2, 15, 2100, 640, 233);
M_Spawn(30,8,6650,640,233);
M_Spawn(11,6,6650,640,233);
setup := false;
end;
NAV_SetPlayerNav(2);
while(NAV_WithinSphere(Alpha1)) do begin
AI_WaitSeconds(1);
end;//end while
NAV_DeactivateSelf;
end;//end if
AI_WaitSeconds(1);
end;//end while
 
*I... bearly ejected at least I..gulp...think I ejected. AAAHAHHAHA!!!! I did die by a torpedo. :( :( :eek: :eek: *

Seriously though well here is a progress report the getting the mission to work.

There is a nav auto but it only lasts a second-probably just needs a loop. Spawning is much better-I am now using launches.

One question though, does a capship have to have a launcher to launch craft-in the coding process I mean?

Another question-how do I get the pilots to have different voices? I have seen it done before with spawns for Confed craft-though their are still only 3 or 4 voices.
 
How do you implement the launch sequence, and what do you put for tag-a number or a few words or something and if where would it get the sequence from.
 
'Tag' in this case denotes the name of a ship. If I recall correctly, the ship in question does need a launcher component, but the game probably won't crash if there is no launcher - it just won't launch them. I think.

If you're talking about a player launch sequence, you use the command MS_ShowTakeoffSequence(tag);. However, this command will not do anything with sim missions, and might even result in a crash (I don't remember). If you want the player to takeoff from a ship with no launcher, use MS_GenericTakeoff(tag);. In that case, the hangar takeoff sequence that appeared in WCP is used.

The pilot of a ship is determined inside the spawn function. By default, the spawn functions in utils.pas use the same pilot for every ship. It is possible to replace that pilot with a variable that increases for every spawned ship (and, every few ships, resets itself), so that you end up using a range of pilots instead of just one.
 
Thanx! Yeah it did not crash.

This should deal with most all problems except for the objectives and I would like to add in voice overs like "Alpha1, we are detecting a bomber force incoming. We are uploading nav coordinates now." and earlier on "Alpha1, don't worry we are launching a wing of bombers and interceptors to assist." Maybe one or 2 more. Man, I don't have any hardware or software to do this-not too mention I have no idea how to implement this.
 
Time for more little errors: one is a new one and the other is more age old. The Bind to sphere code makes the ships disappear forever until I start the mission again. WWWHHHAAATT!!!! is wrong? And no. 2 is that the spawns don't work for nav2. Thanx for the link, I can now use Manaic's and a few other's voices that weren't not in the pilot's file.

function M_Midway;
begin
SF_SetObjectFlag (OF_alignment,ALIGN_Confed);
SF_BindToActionSphere(1);
while(1) do begin
AI_WaitSeconds(1);
end;
end;

function M_Nav2;
var
setup = true;
begin
while(1) do begin
if (NAV_WithinSphere(Alpha1)) then begin
Nav_ActivateSelf;
AI_WaitSeconds(4);
M_Spawn(2,17,23000,23000,233);
M_Spawn(30,10,23222,23222,233);
setup := false;
end;
while(1) do begin
NAV_SetPlayerNav(1);
until(NAV_WithinSphere(Alpha1)) do begin
end;
NAV_DeactivateSelf;
end;
end;
end;
 
Back
Top