Jump to content

Copilot lua script


Peter Pukhnoy

Recommended Posts

Peter Pukhnoy
10 minutes ago, Antonio King said:

Hm, installed the one referenced at the top here. Unless somehow I installed the wrong one. While I'm almost 100% sure I installed the latest, any way to check that?

 

Are there any errors in fssuipc5.log?

Link to post
  • Replies 178
  • Created
  • Last Reply

Top Posters In This Topic

  • Peter Pukhnoy

    72

  • Igor Petrov

    35

  • António Abreu

    14

  • Antonio King

    11

Top Posters In This Topic

Popular Posts

1.1.4 is compatible with A320-X v5.0.1.100-105, A319-X v4.0.1.100 and A321-X v5.0.1.103 Due to the script utilising mouse macros for its interaction with the cockpit controls, it might not functi

The trigger for the copilot to start waiting for your FMGC setup is the chocks being set. Judging by the log, the chocks are off in the 'on APU' state. Yes - even if you start with the chocks s

Thanks for letting me know, I'll upload an update later today or tomorrow.

Posted Images

Antonio King

Oh, here's something:

 

 8712218 *** LUA Error: D:\Modules\FSLabs Copilot.lua:21: module 'FSLCopilot' not found:
    no field package.preload['FSLCopilot']FSLCopilot
    no file 'D:\Modules\FSLabs Copilot\\FSLCopilot.lua'
    no file 'D:\modules\FSLCopilot.lua'
    no file 'D:\modules\FSLCopilot\init.lua'
    no file 'D:\modules\lua\FSLCopilot.lua'
    no file 'D:\modules\lua\FSLCopilot\init.lua'
    no file '\Users\Tones\Documents\Prepar3D v4 Add-ons\Copilot for FSLabs\FSLCopilot.dll'
    no file 'D:\modules\lua\FSLCopilot.dll'
    no file 'D:\modules\lua\loadall.dll'
  9844390 ### Mode: FREEZE_ATT on FREEZE_ALT on FREEZE_LATLON on
  9985078 ### Mode is NORMAL

 

Link to post
Peter Pukhnoy
1 minute ago, Antonio King said:

Oh, here's something:

 

 8712218 *** LUA Error: D:\Modules\FSLabs Copilot.lua:21: module 'FSLCopilot' not found:
    no field package.preload['FSLCopilot']FSLCopilot
    no file 'D:\Modules\FSLabs Copilot\\FSLCopilot.lua'
    no file 'D:\modules\FSLCopilot.lua'
    no file 'D:\modules\FSLCopilot\init.lua'
    no file 'D:\modules\lua\FSLCopilot.lua'
    no file 'D:\modules\lua\FSLCopilot\init.lua'
    no file '\Users\Tones\Documents\Prepar3D v4 Add-ons\Copilot for FSLabs\FSLCopilot.dll'
    no file 'D:\modules\lua\FSLCopilot.dll'
    no file 'D:\modules\lua\loadall.dll'
  9844390 ### Mode: FREEZE_ATT on FREEZE_ALT on FREEZE_LATLON on
  9985078 ### Mode is NORMAL

 

That should be fixed in 1.0.1, so please redownload and overwrite everything.

Link to post
Peter Pukhnoy
2 minutes ago, Antonio King said:

Got it. Does the sim need to be completely restarted for everything to take effect?

Yes, but you probably would need to shut it down to overwrite the dll anyway.

Link to post
Antonio King

Noted. Out of curiosity, anyway to tell in the current one I have installed what the version is? Or maybe you can tell me when the latest upload was because now I'm curious since I thought I had the latest one. 

 

Link to post
Peter Pukhnoy
3 minutes ago, Antonio King said:

Noted. Out of curiosity, anyway to tell in the current one I have installed what the version is? Or maybe you can tell me when the latest upload was because now I'm curious since I thought I had the latest one. 

 

There should be a text file in the archive now - I've put it in after you first asked. 

By the way, I was wrong about needing to restart the sim. You can just overwrite all lua files and restart the script. The dll not overwriting you can ignore - I haven't changed anything there.

Link to post
Antonio King

Neat! So in theory, just replace everything, "reload" Copilot in the Add-ons bar, and perform the next trigger in my current phase of flight and it should work, yeah? Just want to make sure I have the process right for replacing everything. 

Link to post
Peter Pukhnoy
Just now, Antonio King said:

Neat! So in theory, just replace everything, "reload" Copilot in the Add-ons bar, and perform the next trigger in my current phase of flight and it should work, yeah? Just want to make sure I have the process right for replacing everything. 

Correct.

I'm not sure what it will do if you start it mid-flight, but you can set log_level to 1 in options.ini before restarting and then check the log - that should give you some idea. 

Link to post
Antonio King

Looks like I might have to kill p3d as the system sees me as using Copilot already rendering me unable to make changes to the file. Will report after I land here in 20 minutes!

Link to post
Peter Pukhnoy
2 minutes ago, Antonio King said:

Looks like I might have to kill p3d as the system sees me as using Copilot already

Like I said, that you can ignore since the thing that is already running hasn't been changed in the update.

Link to post
Antonio King
Just now, Peter Pukhnoy said:

Like I said, that you can ignore since the thing that is already running hasn't been changed in the update.

Ah, noted. Sorry, read over that part!


AK

Link to post
Peter Pukhnoy
34 minutes ago, Antonio Abreu said:

Good morning,

trying a new flight (same characteristics as yesterday) but P3DV4 totally locked. How can we tell from inside the zip file which version it is?

Thank you

I've sent you a PM.

Link to post
Antonio King

Hm, no joy on getting it to do anything in mid flight (just passed 10K), so will see when I land. Will restart P3D and go from there.

Here's something in the log, btw. Not sure what it means though. 

 

 13033031 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033062 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033109 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033156 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033203 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033250 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033297 *** LUA Error: D:\Modules\FSLabs Copilot\\copilot\Event.lua:75: cannot resume dead coroutine
 13033468 LUA: "D:\Modules\FSLabs Copilot.lua": killed

Link to post
Peter Pukhnoy

@Antonio King I've again uploaded a new version that should prevent this. Sorry for all the inconvienices, let me know if it works for you when starting with a fresh flight.

Link to post
Antonio King

No worries - just happened to close 'er down to relaunch, so just in time. Appreciate your responsiveness! 

Link to post
Antonio King

Hmm, the trigger of filling out the PERF and INIT B page is still not triggering anything. Looking at the log, don't see any errors anywhere, so maybe the trigger isn't right? o.O

Link to post
Peter Pukhnoy

I referenced the wrong required FSUIPC version in the file description, it should be 5.154 or later, otherwise most of the cockpit controls will not work.

Link to post
Fabio Marra

@Peter Pukhnoy really a great work! I installed this morning and everything works well without problems ! The possibility to set also some failures rate is really an added value to this aircraft, really something that the developer should take into account (in my opinion) 

Link to post
Peter Pukhnoy
8 minutes ago, Fabio Marra said:

really something that the developer should take into account (in my opinion) 

They've talked in that past that they have some ideas in that department, but as usual, no timeline.

Link to post
Peter Pukhnoy

I've been reported an issue where the script hangs in an infinite loop when interacting with some switches. I'll fix this soon, disable the script in the add-ons menu if you're affected by this.

Link to post
Peter Pukhnoy

It turns out that the mouse macros which my script uses to interact with the cockpit controls are different across the aircraft types.

I only fly the A321 so I didn't know that until today. I'll fix this as soon as possible. Apologies to anyone whose flights I ruined.

UPDATE: fixed in 1.0.4

Link to post
António Abreu
2 minutes ago, Peter Pukhnoy said:

It turns out that the mouse macros which my script uses to interact with the cockpit controls are different across the aircraft types.

I only fly the A321 so I didn't know that until today. I'll fix this as soon as possible. Apologies to anyone whose flights I ruined.

Please bare in mind that the A321 MCDU windows are, by default, smaller and on different positions than those on the A319/A320. I know this came from the necessity of making space for the CPDLC window (I don't use the CPDLC at all, so I resized the A321 MCDU windows to the same size of the A319/A320 using the panel.cfg thus improving their visibility).

Also be advised that the next release from FSLabs should bring the CPDLC to A319/A320 also so maybe the default MCDU windows will change on these aircraft too.

Attached you can find the panel.cfg files I'm using, for your reference.

FSL Panels.zip

Link to post
Peter Pukhnoy

@Antonio Abreu The term 'mouse macro' is a black box for me, but I don't think it depends on the size of the windows (or maybe it does, but I recorded the macros in the VC). I think it has rather to do with the fact that there are new buttons (overhead, CPDLC) which has shifted the rectangle ID's around.

Link to post
António Abreu
2 minutes ago, Peter Pukhnoy said:

@Antonio Abreu The term 'mouse macro' is a black box for me, but I don't think it depends on the size of the windows. I think it has rather to do with the fact that there are new buttons (overhead, CPDLC) which has shifted the rectangle ID's around.

@Peter Pukhnoy Ok, I thought "mouse macro" could me related to moving the mouse over the windows and clicks so they would depend on the windows size/position. If not, it actually gets easier, which is good! ;)

Link to post
Peter Pukhnoy
3 minutes ago, Antonio Abreu said:

Ok, I thought "mouse macro" could me related to moving the mouse over the windows and clicks so they would depend on the windows size/position. If not, it actually gets easier, which is good!

I thought everyone was familiar with the term from using FSUIPC where you can bind keys and buttons to mouse macros. A macro is basically a simulated mouse key event in a certain area of a gauge, as far as I know.

Link to post
Fabio Marra

Hello @Peter Pukhnoy , just a question related to your script. If I understood well, there 2 different kind of failures I can enable trough your script. Random failures which are set when I load the bus (and if I understood well could be activated setting enable = 1 in your script ), and, let me say, "service failures" which are set for each airframe and that are related to the individual system failure rate set inside the option file of the Lua Copilot script. Is this correct ? 

So althought I set enable=0 in your option file, the "service failure" which their rate are in any case active and saved with the airframe itself?

Thank you

Link to post
Peter Pukhnoy
13 minutes ago, Fabio Marra said:

So althought I set enable=0 in your option file, the "service failure" which their rate are in any case active and saved with the airframe itself?

No, if you set enable=0, the script won't do any failure calculation and insertion.

The settings for each individual failure are there to override the global rate setting. For example, if you leave global rate at the default 0.0001 and set the engine 1 failure to 0.01, you will have an engine one failure once in 100 hours and every other failure once in 10000 hours.

Link to post
Peter Pukhnoy
9 hours ago, Fabio Marra said:

Thank you Peter, now It is clear!
 

Here's an illustration to clarify even further:

session1.PNG.e29c284ff7ee23476b832727075cbb8a.PNG

Restart the sim after 30 minutes:

session2.PNG.1ba881433e0e9d0cb8eb654ca52baf41.PNG

While doing this I noticed a small mistake where it would select 'clear all' after inserting the first failure which is fixed now.

The other failures are just dummies which are inserted so that you can hear it type something in case there are no real failures, which is most of the time.

Link to post
John Rooum

Peter

I seem to have a major interface issue with the A320X. I installed the copilot into HF2/v440 when you first released it and my initial check of the programme went well. I then changed to HF3 when FSLabs released v450 and ran into this problem on my first test flight with the new version. Symptoms are:

1.Load A320X in any panel state. Do not touch any switch.

2. Move into Passenger Cabin

3. Boarding music or boarding announcements will be playing.

4. Move back to cockpit.  Select ACP Cabin switch

5.  Boarding announcements will be playing

Happens even in cold and dark with no power on - clicking the ACP switch brings on the announcements in the cockpit etc!!

I assumed that this was an FS labs problem and spent several days trying to chase it down - using both v440 and v 450.  Eventually I put a thread on the Sound forum and realised that FSLabs could not repeat the problems. [thank you Norman]  I then reinstalled a "clean' version and by a process of elimination found that CoPilot was the cause..  I have tried all version that you have released

Other than this, the programme works perfectly, so v grateful on any advice on sorting this out

Many thanks

 

 

  • Thanks 1
Link to post
Peter Pukhnoy
1 hour ago, John Rooum said:

Other than this, the programme works perfectly, so v grateful on any advice on sorting this out

I'll see if I can reproduce it here.

Link to post
Peter Pukhnoy
3 minutes ago, John Rooum said:

Do I need any changes within the FSUIPC.ini when I install?

No.

Link to post
Peter Pukhnoy
2 hours ago, John Rooum said:

Other than this, the programme works perfectly, so v grateful on any advice on sorting this out

I'm able to reproduce this without copilot, so I'm not sure if this is an issue. During the after start sequence, if the takeoff flap setting hasn't been entered by you in the MCDU and there is no performance request in the ATSU log, copilot will check the PERF page for the flap setting and go back to the FPLN page - this is what triggers the announcement.

I'm not able to reproduce it in cold and dark, however - are you absolutely sure that you can? In any case, I'll make sure this can't happen even in cold and dark in the next version. Meanwhile, you can delay the launch of copilot by a minute by dropping this file into FSLabs Copilot/custom: delay.lua

Link to post
John Rooum

Thanks - but afraid this makes no difference. I see the one minute delay but as soon as co pilot is activated (script started on the log) the announcers start with the boarding announcement etc. Tried with default load plus 2 panel states - still no change?

Link to post
Peter Pukhnoy
1 minute ago, John Rooum said:

Thanks - but afraid this makes no difference. I see the one minute delay but as soon as co pilot is activated (script started on the log) the announcers start with the boarding announcement etc. Tried with default load plus 2 panel states - still no change?

Were the engines running when the delay elapsed? What was the default state when you loaded the flight?

Link to post
John Rooum

1. The aircraft starts engines running - I have made no changes to any of the FSLabs default panel states.

2. I have checked both the default state ie the state the aircraft first loads to  (engines running) when the delay elapsed and “on GPU / APU”  when engines were off when the delay elapsed. 

All the same - no difference

 

 

 

 

 

Link to post
  • 2 weeks later...
John Rooum

Peter

Been away for a while and just done a clean install of v101 and copilot 1.1.3.(P3D v4.5)  Not sure whether you have updated or not but the log is reporting:

failed to create recogniser 

exiting

??

John

Link to post
Peter Pukhnoy
34 minutes ago, John Rooum said:

Peter

Been away for a while and just done a clean install of v101 and copilot 1.1.3.(P3D v4.5)  Not sure whether you have updated or not but the log is reporting:

failed to create recogniser 

exiting

??

John

Hi John,

I haven't changed anything in how the recognizer is initialized. Can you attach the log please? There should be a specific error code in there.

Link to post
John Rooum

Thanks Peter.

Log attached but if 3.1.3 is ok with v101, it must be my install.  v101 is running OK but I will look at my copilot install again tomorrow.

john

Copilot.log

Link to post
Peter Pukhnoy

John, you 

1 hour ago, John Rooum said:

Thanks Peter.

Log attached but if 3.1.3 is ok with v101, it must be my install.  v101 is running OK but I will look at my copilot install again tomorrow.

john

Copilot.log 410 B · 1 download

You are running an older version of FSLCopilot.dll which didn't report the specific error code. When you update, you need to overwrite the content of Prepar3d v4 Add-ons as well as that of the FSUIPC folder. Please do that and attach the log again (or just copy paste the error).

Link to post
John Rooum

Thanks Peter - my finger trouble again. When I installed 1.1.3 with default settings and it didn’t work, I immediately tried an earlier version that I had used. Then to get the log last night  I reinstalled 1.1.3 but left the old add on.xml in!

Checked again this am - saw the error code, checked the ini and realised I didn’t have a mic installed (it’s on my client pc for VATSIM). Changed the ini and of course everything worked as advertised.

Apologies and hangs head in shame

 

Link to post

×
×
  • Create New...