Camera questions

eddieb

Vice Admiral
Iceblade sent me the following over email

1-You accidentally coded in a cloaking script!

If you set the camera to focus on a ship, that ship
disappears completely--not one texture is left,
everything else is there including the mesh, just no
textures. Also the camera never swtitches to the ship
in the script, so yeah that will need some help. I've
included a small zip with the cienmatic mission I am
currently working on and a few funny screenshots.

2-full speed for the set desired velocity function is
2.0 instead of 1.0. Took me awhile, actually, before I
realized this, but putting in 2.0 does make my fighter
go full speed where 1.0 doesn't change the speed level
at all (as this function is invoked at the start of
the mission). Also the transports, I found to be
moving too slowly for 180 (which is what is set in the
transport file). Also initial visual comparisions with
WCPtrans speeds actually provoked my check. Anyway
changing the speed to 2.0 brings the ship's speed up
to what appears to be the same as WCP. (of course I
checked the change in distance between me at near 0
speed and the trans at full and it looked like it was
increasing at about 180 per second (which is the
Pelican's max velocity)

3-There is something else I noted out of ships with no
AI, their speeds have to be reset after an autopilot.
It seems that all ships go to full stop when going to
a new nav--curious, was this designed or something
unavoidable?

4-I find that functions don't initate properly if they
are set at the start of the first nav (nav0). I hate
having much time pass after the start of the mission
for the in-mission launch camera cienmatic, but oh
well (.1 seconds is not too much--any less, though,
leaves the function un-called).
 
OK, one fix at a time. Looking at your script, you call Camera_setFocusShip("Relentless");

But you never changed the camera. By default, this changes the cockpit camera. Which essentialy puts you inside of the cockpit of the Relentless, which is probably not what you want. Also, when you're done with a camera change, you have to put it back to the cockpit camera and you also have to set the camera's focus object back to the player.

It looks in the code on an autopilot; unless the ship is the player, I automatically re-enable the AI.
This is because I disable the AI for all ships for the autopilot cutscene, and have to put it back. I'm not sure what the right solution to this is. I don't really see why you're having a ship with a disabled AI autopilot, the AI is really only supposed to be disabled for cutscenes, or perhaps temporarily within a nav point. What are you trying to accomplish by leaving it disabled across nav points?

I sent over a fix for 4
 
Setfocusship - Now I am really confused. This function is used to go into the cockpit of a ship? Well it never even changes the camera view, it just makes the ship disappear.

:confused: Boy, I really don't understand what this function is for. :confused:

AI-autopilot - Well, what else am I supposed to do about capships. They want to remain on my wing and start turning all over the place--which makes no sense.

Velocity - What about the second one on my list?
 
Camera_setFocusShip("Relentless"); It tells the camera what ship to "use". If the camera is a cockpit camera, it "uses" that ship to place the camera. Camera-setFocusShip does not change the camera type.

If you want to see what setFocusShip does, in a script

1) Change the focus to a fighter besides the player, with a different ship model
2) Change the camera to a chase camera

wait a while then,

3) Change the focus back to a player
4) Change back to a cockpit camera

As far as the ship forming on your wing too much, maybe you need to call this at the right times.

Ship_setAutopilot(string shipid, boolean autopilot);

I haven't looked at 2 yet.
 
The cutscene start function keeps returning that it expects a ')' near 'callback'. Here is the code:

function init()
Mission_setScriptControl(true);
Mission_setAutopilotEnabled(false);
Cutscene_start(string callback);
end

-- home nav
function Launch()

begin = Mission_getElapsedTime();
begintime = begin + 1000;
wait = true;
Camera_setCameraType(7);
Camera_setLocationFixed(-769.8925, 200.0, -51.612907);
Camera_setLookAtFixed(-54.545456, 0.0, -260.60605);
end

-- call init on startup
init();
 
Fix this

Cutscene_start(string callback);

Try debugging a little more on your own please first :).
 
Is there something I need to put in place of string callback? When I put in the name of a script function in that place, it says its wants a string not a function. What string?

Edit: oh, a string can be a function--it just needs quotes.

Well now it just crashes, but I have a feeling it has to do with the way the script function is set up.
 
So there was an engine bug I had to fix for this. Stay tuned, I'll release the fix in the coming days.

Besides this, there is a bug in your script.

This

Camera_setCameraType(7);

is wrong, read the instructions on Camera_setCameraType. They tell you exactly what values to use. Use the values I specify, not your own number.

Also, don't put cutscene stuff in an init unless they set lua variables only. Don't call my provided functions unless you're already within a ship or navpoint function.
 
Okay, I am missing two huge capships and I have tried multiple locations and I know the Ranger carrier has to be close based off of the way the camera lookat function is working in the game.
 
That's the fun of scripting cutscenes. Be careful what you wish for, you just might get it :). Not much I can do.

You could fly around in the players ship, and print locations to the screen, make sure they're right, then use those locations in a future script. Don't guess locations, know they're correct from data. Also consider using ship get location and ship get radius to help you.
 
Yes, thank you for your patience, this was indeed a bug on my end. I do apprecitate that you at least tried to solve it on your own first.

Patch is posted here:
http://flightcommander.solsector.net/fc1.3.4patch.zip

Anyway, its was cool to see the very first fan-created cutscene in action.

There are bunches of new features in this patch but please don't post them as news items. Some new 1.4 features in primitive form are in this patch (hint, press the j key). You'll see some others in the gameflow too.
 
Oh good...I will be happy to give any new additions a test.

Edit: Uh...you forgot an obj file. Btw, did you do improve the framerate by any chance (optimize the code or something)?
 
Okay, more bugs in scripts. The lookat relative camera function is turned 180 of the object's position. (y-axis I mean)

Also the cutscene function doesn't neutralize player control--although, I know that there will be at one point a special setting type in the campiagn file or something that sets a mission to just being a cutscenes. Even still, this function is needed for the short cutscenes that come up in a mission.

Also, there is another problem and this one I am sending to you. The Ship_setOrienation function is not working properly and I'm not sure why. I have 3 fighters that are added during the cutscene and their orientations are reset to the same three values (0, 270, 0) What occurs is that all three (which start out with the same default orienation) turn to different orientations. First one goes 90, the second goes 180, and the last goes 270. This makes no sense to me and I don't see any other causes for this.
 
I'm going to a party in a little bit, but I see some bugs on your end.

1) Don't do stuff in init. You need to put Cutscene_start("CutsceneRepeat") at the start of your Launch function. If you do this, the player controls will be disabled correctly.

2). You need to call Cutscene_end somewhere.


I'll look into the remaining issues when I have time.
 
Back
Top