Mission issues

Winnyfred

Rear Admiral
Hey can anyone tell me how to fix this problem I'm having? It's a script that is supposed to kill a pilot 10 sec into the nav, but in the mission it failed to initialize. When I took out the enemy ships at the nav, after I take off, the game crashes to desktop. Anyone tell me what is wrong?

Here is the script:

dofile "flightcommander.lua"

function nav1()

Ship_setHitPoints("dallas", .1)
end

function nav2()
Ship_setHitPoints("dallas", .0)
Ship_destroy("dallas")

end

function nav1create()
start_time = Mission_getElapsedTime()
Dallastime = start_time + 10000

end

function nav2create()
Ship_destroy("dallas")
end

function dallas()
Ship_destroy("dallas")
end

function nav1during()
current_time = Mission_getElapsedTime();
if current_time > Dallastime then
dallas();
end
end

_________________________
Here is the mission:
<?xml version="1.0" encoding="UTF-8"?>
<mission name = "" sector="blue" can_eject="false" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mission.xsd">
<navpoints number="4">
<navpoint numships="7" numwaves="1" name="nav0" >
<ship name="outpost" pilot="" comm="midway" video="midway" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-173.6227" y ="0.0" z ="-154.92487" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="tigershark" pilot="Dallas" comm="maestro" video="helmet" autopilot="true" must_survive="true" alignment="friend" wave="0" scriptid="dallas">
<location>
<point x="-168.28047" y ="0.0" z ="64.10684" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="tigershark" pilot="player" comm="casey" video="" autopilot="true" alignment="friend" wave="0">
<location>
<point x="-170.95158" y ="0.0" z ="-21.368948" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="tigershark" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-58.764606" y ="0.0" z ="-264.44073" />
</location>
<rotation>
<point x="0.0" y ="121.0" z ="0.0" />
</rotation>
</ship>
<ship name="tigershark" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-98.83138" y ="0.0" z ="-285.8097" />
</location>
<rotation>
<point x="0.0" y ="126.0" z ="0.0" />
</rotation>
</ship>
<ship name="panther" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-427.37897" y ="0.0" z ="-181.63606" />
</location>
<rotation>
<point x="0.0" y ="184.0" z ="0.0" />
</rotation>
</ship>
<ship name="panther" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-454.09015" y ="0.0" z ="-168.28047" />
</location>
<rotation>
<point x="0.0" y ="184.0" z ="0.0" />
</rotation>
</ship>
<script oncreate="nav0" />
</navpoint>
<navpoint numships="0" numwaves="1" name="nav1" >
<script oncreate="nav1create" ondestroy="nav1" during="nav1during" />
</navpoint>
<navpoint numships="2" numwaves="1" name="nav2" >
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-162.93823" y ="0.0" z ="-432.7212" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-98.83138" y ="0.0" z ="-486.14355" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<asteroids radius="0.0" number="1000">
<point x="0.0" y="0.0" z="0.0"/>
</asteroids>
</navpoint>
<navpoint numships="6" numwaves="1">
<ship name="outpost" pilot="" comm="midway" video="midway" autopilot="false" land="true" alignment="friend" wave="0">
<location>
<point x="-435.3923" y ="0.0" z ="-582.30383" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="wasp" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-64.10684" y ="0.0" z ="-657.09515" />
</location>
<rotation>
<point x="0.0" y ="92.0" z ="0.0" />
</rotation>
</ship>
<ship name="wasp" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-93.48915" y ="0.0" z ="-681.1352" />
</location>
<rotation>
<point x="0.0" y ="92.0" z ="0.0" />
</rotation>
</ship>
<ship name="refueler" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-168.28047" y ="0.0" z ="-365.94324" />
</location>
<rotation>
<point x="0.0" y ="100.0" z ="0.0" />
</rotation>
</ship>
<ship name="vampire" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-550.2504" y ="0.0" z ="-208.34724" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="vampire" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-518.19696" y ="0.0" z ="-213.68948" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
</navpoint>
</navpoints>
</mission>

I didn't see any problems with the mission or script, and FC didn't tell me that there was an issue, I checked it to make sure it didn't say anything.
 

Iceblade

Admiral
"Ship_setHitPoints("dallas", .0)"

This line in function nav2 is unnecessary. Ship destroy will do this automatically.

Also, why do you have ship destroy for dallas twice....no THREE TIMES. :eek:

*sigh*

Get rid of the set HP to 0, and the ship destroy of Dallas in both of the nav functions, but keep the one in the dallas function.

You also don't need to and maybe can't call a function like that in nav1during.

Here is all you need:

Code:
function nav1create()
start_time = Mission_getElapsedTime()
Dallastime = start_time + 10000
end

function nav1()
Ship_setHitPoints("dallas", .1)
end

function nav1during()
current_time = Mission_getElapsedTime();
if current_time > Dallastime then
dallas();
end
end
Everything else is redundant and probably the cause of your crash.
 

Iceblade

Admiral
What's the error message?

And where is your nav0 function. One thing you will need to do is check to make sure that if you call a function in your mission, that you check that there is a function in your script by the same name.
 

Winnyfred

Rear Admiral
No error message, just a crash to desktop, and I looked at eddiebs script examples, it doesn't require it.
 

Iceblade

Admiral
Not every nav needs a function, but if a function gets called in the mission, there has to be a function of the same name.

Anyway, to get an error message, you need to execute the game using a command prompt:

using a command prompt type in the directory of your executable such as C:\program files\flightcommander\

Then type in the following: flightcommander.exe > error.txt

This will start the game and send any information to a text file that you can access later. Now, start the mission that is giving you trouble. The game will crash, but an error message will now be in the text file.
 

Iceblade

Admiral
Okay, go to start, then click "Run", type in "command prompt", then follow the directions I just gave.
 

eddieb

Vice Admiral
Not every nav needs a function, but if a function gets called in the mission, there has to be a function of the same name.

So to clarify, any function you specify in the mission xml file must be present in the lua file. However, you can leave the functions in the mission file blank if you don't want anything to happen, and then you don't need that function in either place.
 

Winnyfred

Rear Admiral
The command prompt isn't recognizing C:\Program Files\Flight Commander 1.4
and therefore won't run :mad:. This will be the first time I've had to do this, is there anything else you might have left out? Doesn't take spaces either.
 

Iceblade

Admiral
C:\Program Files\Flight Commander 1.4\flightcommander.exe > error.txt

Now, that above that is in bold is the file path to your FC folder, and will be different based upon where your FC folder is located.
 

Winnyfred

Rear Admiral
Ugh, my computer says "'C:\Program' is not recognized as an internal or external command, operable program or batch file." Then I use the space and it says it can't find the path specified.
 

Iceblade

Admiral
Okay, Windows is really fucked up. It has three command prompt programs. Two of which suck worse than horse...manure...

Go to Start, click run, type in cmd.exe.

Then type in the following pressing enter after each line:
Code:
cd ..
cd ..
cd Program Files\Flightcommander1.4\
flightcommander.exe > error.txt

Line 3 will be the path to your FC directory
 

Winnyfred

Rear Admiral
FINALLY! I got it working. The mission is fixed, thanks a lot Iceblade, that must have really gotten on your nerves. Now there is a comm issue with him not wanting to play his dead comm, nor is he spinning out of control, just going BOOM! That's it. I know how to implament it manually, but all he does is repeat himself.
 

Winnyfred

Rear Admiral
There we go, he is now dieing and the comm is playing with the video, but he just goes boom... no spining out of control and the comm play's after the "mission failed" voice.
 

Winnyfred

Rear Admiral
Ugh, another mission issue, this time the game crashes to desktop. I looked there is no FC error text. Help me!!!

<?xml version="1.0" encoding="UTF-8"?>
<mission name = "" sector="red" can_eject="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mission.xsd">
<navpoints number="4">
<navpoint numships="7" numwaves="1">
<ship name="midway" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-25.54257" y ="0.0" z ="-40.066776" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="panther" pilot="player" comm="" video="" autopilot="true" alignment="friend" wave="0">
<location>
<point x="64.10684" y ="50.0" z ="694.4908" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="panther" pilot="Saviour" comm="maestro" video="helmet" autopilot="true" alignment="friend" wave="0">
<location>
<point x="-106.84474" y ="0.0" z ="630.384" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="wasp" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="739.89984" y ="0.0" z ="-651.7529" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="wasp" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="697.1619" y ="0.0" z ="-617.0284" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="vampire" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-750.5843" y ="0.0" z ="-761.2688" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="vampire" pilot="" comm="" video="" autopilot="false" alignment="friend" wave="0">
<location>
<point x="-777.2955" y ="0.0" z ="-795.9933" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
</navpoint>
<navpoint numships="6" numwaves="1">
<ship name="panther" pilot="Frosty" comm="" video="helmet" autopilot="true" alignment="friend" wave="0">
<location>
<point x="-480.80133" y ="0.0" z ="-576.9616" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="panther" pilot="Pallydin" comm="stiletto" video="helmet" autopilot="true" alignment="friend" wave="0">
<location>
<point x="-373.9566" y ="0.0" z ="-638.39734" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="170.95158" y ="0.0" z ="-918.86475" />
</location>
<rotation>
<point x="0.0" y ="247.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-491.4858" y ="0.0" z ="-149.58264" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="373.9566" y ="0.0" z ="-566.2771" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="10.684474" y ="0.0" z ="-42.737896" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
</navpoint>
<navpoint numships="5" numwaves="1">
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-427.37897" y ="0.0" z ="-414.02338" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-69.44908" y ="0.0" z ="-296.49414" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-643.73956" y ="0.0" z ="-651.7529" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="235.05843" y ="0.0" z ="-360.60098" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
<ship name="devil" pilot="" comm="bug1" video="bug" autopilot="false" alignment="enemy" wave="0">
<location>
<point x="-438.06345" y ="0.0" z ="-817.36224" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
</navpoint>
<navpoint numships="1" numwaves="1">
<ship name="midway" pilot="" comm="midway" video="midway" autopilot="false" land="true" alignment="friend" wave="0">
<location>
<point x="-243.07178" y ="0.0" z ="-520.8681" />
</location>
<rotation>
<point x="0.0" y ="0.0" z ="0.0" />
</rotation>
</ship>
</navpoint>
</navpoints>
</mission>
 

Kevin Caccamo

Rear Admiral
I'm surprised your mission doesn't work. Even after tearing it down and looking at it in detail, it looks alright to me.

Edit: And even after playing it through, nothing happened.
 

Iceblade

Admiral
A little more information would be nice like is there a briefing or lua associated with this (I would guess there isn't)? You did use the mission editor to create this, right?

Let me, give it a test....and it checks out. Worked fine no problems, so it is not the mission itself unless you are using a version prior to the 1.5 alpha but even then I doubt there would be any problems.

Does this mission have any other files associated with it currently (eg gameflow scripting, mission scripting, briefing, ship edits, weapon edits, etc.)?

Edit: Kevin, I doubt that is a problem as it ran fine and I only copied and pasted this into a blank text document (appropriately remained of course).
 
Top