Which compiler?

H

HohesHaus

Guest
Hello,

I wantet do script my briefing, but to do this I have to use Lua. I downloaded the sourcecode, but which compiler should I use to do that.

That would be the first time I will scripting so please use simple words ^^
 
hm okay, I read that the new Missionbuilder allows to programm the briefing in it. But ... the Missioneditor I have doesnt support this new Ability.

When I run the Missioneditorframe over the command line, it doesnt appears, even if I have the newest Java Version and extractet the packed customized MissionEditor
 
Ok, first of all, all you need to do to script Flight Commander is included in the game, no source code is necessary. You don't need to compile anything.

As far as the briefing... yes, you need to edit that by hand, there's no interface for that. I'd recommend you try making some missions first before trying to change the briefing. Have you been able to run the mission editor from here?

Thanks for your interest, and feel free to ask if you have questions.
 
Jep this Missioneditor is running, and the Missions I made with that are working.

But I dont get the lua code ... okay I can do that by the Texteditor, but its quite difficult to see through this code.
 
Try looking at some of the example scripts, and also read the scripting documentation page. Also, please register so we know who we are talking to.
 
Okay, I read the guide and used the examples to build 2 Missions and a campaigne xml. Both are working. Then I started to build the briefing.xml ... I think its fine so far. Thats what its look like:

Code:
  <?xml version="1.0" encoding="UTF-8" ?> 
- <briefing xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="briefing.xsd">
- <navpoints>
- <navpoint radius="200.0" scriptid="$nav1" name="Start">
- <ships>
- <ship name="piranha.mesh.bin" autopilot="true" aligment="friendly" capship="false" scriptid="$player">
- <location>
  <point x="20.00" y="0.00" z="0.00" /> 
  </location>
  </ship>
- <ship name="piranha.mesh.bin" autopilot="true" aligment="friendly" capship="false" scriptid="$wingman">
- <location>
  <point x="20.00" y="0.00" z="0.00" /> 
  </location>
  </ship>
- <ship name="midway.mesh.bin" autopilot="false" aligment="friendly" capship="true" scale="0.5">
- <location>
  <point x="60.00" y="0.00" z="0.00" /> 
  </location>
  </ship>
  </ships>
- <location>
  <point x="10.5" y="-50.66" z="0.6" /> 
  </location>
  </navpoint>
- <navpoint radius="200.0" scriptid="$nav2" name="Nav 2">
- <ships>
- <ship name="squid.mesh.bin" autopilot="false" alignment="enemy" capship="false" scriptid="$squid">
- <location>
  <point x="20.0" y="5.0" z="10.0" /> 
  </location>
  </ship>
  </ships>
- <ships>
- <ship name="squid.mesh.bin" autopilot="false" alignment="enemy" capship="false" scriptid="$squid">
- <location>
  <point x="20.0" y="5.0" z="10.0" /> 
  </location>
  </ship>
  </ships>
  </navpoint>
  </navpoints>
  </briefing>

Sooooo now let us come tom my problems ^^

I dont get the lua code, with or without the guide ...

The guide doesnt name these parts of your exampel "mission_a1.briefing.lua"

Code:
dofile "flightcommander_briefing.lua"

STATE_NAV1 = 0;
STATE_NAV1_TO_2 = 1;
STATE_NAV2 = 2;
STATE_NAV2_DESTROYED = 2.5;
STATE_NAV2_TO_3 = 3;
STATE_NAV3 = 4;
STATE_DONE = 5;

nav1interptime = 10000;
nav2time       = 20000;
nav2destroytime= 25000;
nav2interptime = 30000;
nav3time       = 40000;
nav3interptime = 50000;

What does these things do?

then next

Code:
BriefingShip_setHeadingInterpNavs("$player", "$nav3", "$nav1", "$nav2", 10000);

Ok this code says, so far as I know:"Let the "Player" Icon move from nav 3 to nav 1 to nav 2, with a time of 10 seconds" .... but why dont you to programmed "Nav 1 to Nav 2 to Nav 3" ?

Code:
state = STATE_NAV1;

What does this mean?

WHEN I understand this right you need the "State" Command to set your perimeters for the "When if else" Script, didnt you?

Code:
function advance()
  local now = Mission_getElapsedTime();

What does this do?

Code:
if(now > nav1interptime and state == STATE_NAV1) then
     state = STATE_NAV1_TO_2;
     BriefingShip_setLocationInterpNavs("$player", "$nav1", "$nav2", 10000);
     Overlay_setText("Leave the Midway, and proceed to Nav 2.");
     Briefing_playSound("mission_a1_briefing_2.mp3");
  elseif(now > nav2time and state == STATE_NAV1_TO_2) then
     state = STATE_NAV2;
     BriefingShip_setHeadingInterpNavs("$player", "$nav1", "$nav2", "$nav3", 10000);
     Overlay_setText("Once at Nav 2, eliminate all enemy forces.\nYou may encounter a Moray wing.");
     Briefing_playSound("mission_a1_briefing_3.mp3");

Okay this is a little bit too complicate 4 me .... the 1st String says "When counted time (10 Seconds) and status 1 = State 1 are the same then change to Status "State_Nav1_to_2" and move PlayerShip Icon from Nav 1 to Nav 2, play the mp3 and ... well the rest of the code I dont get ...

I would be glad if someone can help me out! thx
 
Ok, here's a recommendation. There are 2 styles of doing mission briefings. You can do them without any lua at all, and for you, that's the recommendation. Read the old mission briefing tutorial
My first mission briefing is the most complicated, so look at the briefing xmls for other missions that are simpler.

Otherwise, if your really do want to do scripting eventually, read the following book that I recommended on my scripting page.

Programming in Lua

And if you want to know what a particular flight commander function does, look it up, I promise, every built in function is documented on the flight commander home page.
 
Okay I did it now. I could finaly make a Briefing and it works perfectly. Aaaand I could programm some small and easy scripts, but I get the LUA now.

But I still have 2 problems.

1. When I programm the Briefing with atmessage the Text to Speech starts automaticly, well in fact that Im a german, the Text to Speech brabbles a lot of senseless stuff .... is there a way with the old scool briefing to deativate the text to speech?

2. I added some new Commsounds, and I made a new xxx.comms.xml file, I used one of a already existing and changed the stuff in there. Everything seems to be correct, and I have no mistakes in there. I also changed the "comm" line in the mission.xml. But everytime I start the Mission, the game crashes when it shall show the Cockpit. Any clue where the problem could be?
 
I am sure that has come up before....but I thought Eddie removed the text to speech from FC. Do you have the latest version? If so then I know there has to be a means to remove it from the briefing and be listed in a tutorial or in this forum.

Edit: Briefing guide, scroll down to the scripting section, there is where you will find a way to use your own voiceover file for the briefing, only a little scripting should be necessary.
 
No, text to speech is still there. If the text to speech doesn't sound good, you can adjust the voice in your windows control panel under speech.
 
I have realy big big Problems with this command

Code:
dofile "flightcommander.lua"

function start()
Comm_setMenuText(1, "Ja auch schoen dich kennen zu lernen.");
Comm_setMenuOverride(true);
end

function_during()
local result = Comm_getLastChoice();
if(result == 1) then
Comm_playVideo("haus_hi.wav", "helmet.avi", "HohesHaus", IFF_FRIEND);
end

The List shows up, but nothing happens when I hit Numberkey "1" ... luca.exe says this lua file is correct. Even as I cleared the complete LUA file and let only this command above in it, it doesnt work. The wav and avi files are in the directory and there are no tipping mistakes. What could be the mistake?
 
I solved the problem with the comm_setmenutext now ... the script didnt mention clearly enough that I HAVE TO set Index 0, after I did that I worked.

Good idea to delet t2w.exe
 
Back
Top