WCSO Questions

Jason_Ryock

Vice Admiral
Okay so, onto scripting now.

I've got the Cerberus (as well as other ships) set to the player wing so they can all autopilot through the four navs together (the idea being that you're escorting the Cerberus) however...the Cerberus is ENTIRELY to close to the fighters after the autopilot ends, as in, you stop autopiloting and everyone immediatly collides with each other the second someone moves. Also, during the autopiloting sequences you can't even SEE the fighters.

Is there a way I can script the carrier to autopilot in a specific formation with the fighters?
 
My advice, as usual, is to take a look at the UE source. There is a number of missions where you escort the Dauntless from place to place, so the answer is there.
 
Yes there is a code and this is it:

AI_SetAutopilotData(x, y, z)

and all your escorting troubles are done, but other wings are a bit more trouble.
 
Yeah I saw that. I think I need to delve into that just a bit more (I haven't tried that line yet Iceblade) ...also, I got communications working, but it sticks the message up on screen twice for reasons I can't fathom.
 
Are you trying to play IFF-type (instead of XA) messages? That is to say, are you putting in 0 as the first LONG in the message's MOBJ chunk in the comm file?

For some reason, WCP/SO prints the message twice if you do that. Maybe it's a bug of some kind, that they didn't notice because they never had the player character send any messages in WCP/SO apart from ordinary comms. In any case, this is the reason why, when the player says something in Standoff, you see that "sending comm" video - we decided that it was preferable to play the player's special comms as XA files.
 
Okay, so the Solution to the double comm thing is either to record my own comm (something feasible in the future) and throw it into the came, or add in a comm file that just plays silence.

Just one more question then, the Comm file of Silence, can it just be a second long, or do I need to make sure the time of the file is the same time as the time I have the comm set to play for (IE: The time set in the times.iff file)?

What will happen if the sound file is actually shorter/longer then the time in times.iff?
 
I don't know. I've always made sure that the times I list in times.iff are precisely accurate.

I suspect that you won't have trouble in the case where the duration in times.iff is shorter than the length of the file. If the file is shorter than what's listed in times.iff... well, I've never tried, so as far as I know it might work... but it seems like the kind of thing that might make the game crash.
 
The reason I was asking is for testing purposes. I'd like to write missions with comms that play fully, but not necessarialy need to record voices for them right now. Later I can go in and just adjust the times, and overwrite the "silent" two second clip and the mission will be complete with minimal effort.

And, by the way, it worked. I have a two second "silent" audio clip that plays now, the comm only plays once and it plays with video.
 
Okay, three questions. Two specific (You may be able to direct me somewhere that will answer my question) and one a little more general.

First: Can I call a function inside of another Function? IE: Can I have my nav Code run a seperate Function?

Second: How does the AI_SetAutopilot Command work? Are the coordinates ending coordinates, or are they relative to the player while in flight?

Thirdly: I notice the UE code uses events alot to control things like taking off and landing. Is this the best way to do it and should I look at reverse engineering the UE event coding for my own missions?

Answer when you have time Quarto, I'm in no rush.

Oh, no...one more...How do I make a capship disappear after it's been destroyed at Nav 2? I get to Nav 3 and it still shows up...and lastly, how do I implement Capship missiles? Will they destroy a target upon impact or do I need to script that?
 
Jason_Ryock said:
First: Can I call a function inside of another Function? IE: Can I have my nav Code run a seperate Function?
Yes, provided they don't contain any commands that navpoints can't use.

Second: How does the AI_SetAutopilot Command work? Are the coordinates ending coordinates, or are they relative to the player while in flight?
Relative to the player.

Thirdly: I notice the UE code uses events alot to control things like taking off and landing. Is this the best way to do it and should I look at reverse engineering the UE event coding for my own missions?
It is an effective way to do it, and I like it. But that doesn't necessarily mean it's the best way - it just happens to be the way I use.

Oh, no...one more...How do I make a capship disappear after it's been destroyed at Nav 2? I get to Nav 3 and it still shows up...
Ugh, you should be ashamed for asking about stuff like this. Haven't you noticed the SF_BindToActionSphere(num) command that's used fifty thousand times in every mission?

and lastly, how do I implement Capship missiles? Will they destroy a target upon impact or do I need to script that?
Capship missiles are declared as a special object type, but that's all I know. I've never had any need for them, so I've never bothered to learn how they work. Try decompiling a WCP/SO mission with capship missiles - you should be able to learn a bit.
 
This is my concern with the SF_BindToActionSphere Command...I have a destroyer that autos with the player from the first nav to the second, and then is destroyed at the Second nav, only to have it show up again at the third nav, 60,000 klicks away, and dead. It's rather a nusiance. Can I bind it to action Sphere 2, have it appear in action sphere one and still auto with the player?
 
No, but you can bind it to actionsphere 0, and then bind it to actionsphere 2 after it arrives at nav 2. This kind of thing is done in UE's M0 and M3A.

Again, look at the damn source code. I'm not trying to be a jerk by always pointing you back to the source instead of giving you the answer. I am trying to help you. WCP is a very, very complex beast. You have to learn to research and to experiment. You have to develop a specific kind of memory - when you're dealing with a particular problem, you have to be able to remember what WCP/SO/UE mission did this thing you're trying to achieve, and you have to be able to refer to that mission to work out how to do it.

Ask for advice about complex stuff, difficult stuff. Do not ask for advice about small things - even if you can't understand how to do them, force yourself to try again and look for other approaches. Because if you cannot do this, if you keep looking for help in simple matters, you will never come to understand the game sufficiently to even try dealing with bigger problems.
 
Here is a tip that you may never come across. The AI_Deactivateself, or a deviation thereof, causes a ship to completely disappear. It can be very effective in bad situations like the one you described. All that is needed is a function--and a variable works best--to tell the engine to get rid of the object and there is no problem.

Probably a good idea whenever AI_bindtosphere fails or is too complex for a certain situation.
 
Back
Top