Orbiter-Forum  

Go Back   Orbiter-Forum > Orbiter Addons > Addon Development
Register Blogs Orbinauts List Social Groups FAQ Projects Mark Forums Read

Addon Development Developers post news, updates, & discussions here about your projects in development.

Reply
 
Thread Tools
Old 04-19-2018, 11:04 AM   #61
zachary77
Orbinaut
Default

Here's the complete source file. It's zipped.
Attached Files
File Type: zip Glider_SC.zip (4.5 KB, 6 views)
zachary77 is offline   Reply With Quote
Old 04-19-2018, 05:33 PM   #62
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 Here's the complete source file.
Well, there is only 1 file in there: the single *.cpp . The problem is probably not in there, given that you have linker errors, not compiler errors. It would be good to also have your solution and project files, so we can point out what to change in them to let VS build it properly.

I could plug that CPP into my VS 2015 templates, and I bet it'll run just fine, but this would not help you find the problem you have with your compiler.

---------- Post added at 19:33 ---------- Previous post was at 13:49 ----------

The following is a link to an environment archive for VS 2017 Enterprise (that's what I have here) for the Glider development: https://snoopie.at/face/beta/GliderVSEnvironment.zip

You have to extract it to your Orbiter root folder. It creates VS 2017 compatible property sheets in the /Orbitersdk/resources/ folder (*.props). It also creates solution and project files in the /Orbitersdk/samples/Glider/ folder.
In order to make it work, you have to edit the /Orbitersdk/resources/orbiterroot.props file with a text editor, and change the "Your:\Orbiter\Root\Path" text to your Orbiter root path. With this, all examples in the /Orbitersdk/samples/ should work when converted to 2017.
You also have to copy your CPP into the /Orbitersdk/samples/Glider/ folder, because I did not include it in the archive.

With my VS 2017 Enterprise installation, the solution can compile both Debug and Release versions of your glider CPP with working XRSound. I've tried both the 1.1 and the new beta 2.0 XRSound.

However, the simple PlayWav call in your code does not produce any sound, because the default "slots" are played automatically and are only available for enabling/disabling/changing, not for playing or stopping manually. If I do a LoadWav on e.g. ID 0 and with "XRSound\\Default\\Autopilot On.wav" directly after the CreateInstance and call it with ID 0 in PlayWav, it works though.
Face is offline   Reply With Quote
Thanked by:
Old 04-20-2018, 12:02 PM   #63
zachary77
Orbinaut
Default

I don’t know whether to laugh or cry... The code compiles but there’s no .dll!

Build log:
Code:
1>------ Build started: Project: Glider, Configuration: Debug Win32 ------
1>Glider.cpp
1>Glider.cpp(151): warning C4101: 'th_group': unreferenced local variable
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(1198,5): warning MSB8012: TargetPath(C:\Users\toffe\Desktop\Orbiter\Orbitersdk\samples\Glider\Debug\Glider.dll) does not match the Linker's OutputFile property value (C:\Users\toffe\Desktop\Orbiter\Modules\Glider.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
1>   Creating library C:\Users\toffe\Desktop\Orbiter\Orbitersdk\samples\Glider\Debug\Glider.lib and object C:\Users\toffe\Desktop\Orbiter\Orbitersdk\samples\Glider\Debug\Glider.exp
1>Glider.vcxproj -> C:\Users\toffe\Desktop\Orbiter\Orbitersdk\samples\Glider\Debug\Glider.dll
1>Glider.vcxproj -> Debug\Glider.pdb (Full PDB)
1>Done building project "Glider.vcxproj".
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Last edited by zachary77; 04-20-2018 at 12:08 PM. Reason: Added pic
zachary77 is offline   Reply With Quote
Old 04-20-2018, 12:34 PM   #64
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 I donít know whether to laugh or cry... The code compiles but thereís no .dll!
The DLL gets deployed into the /modules/ folder automatically.
Face is offline   Reply With Quote
Old 04-20-2018, 03:10 PM   #65
dbeachy1
O-F Administrator
 
dbeachy1's Avatar


Default

The compiler's output window shows where the DLL is being created:

Quote:
Originally Posted by build output
 1>Glider.vcxproj -> C:\Users\toffe\Desktop\Orbiter\Orbitersdk\samples\ Glider\Debug\Glider.dll
dbeachy1 is offline   Reply With Quote
Old 04-20-2018, 03:56 PM   #66
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by dbeachy1 View Post
 The compiler's output window shows where the DLL is being created:
Yeah, but funny enough VS is lying there. The binaries go to the /modules/ folder with the project settings I've posted. I have explicitly set the linker output to it.
Face is offline   Reply With Quote
Thanked by:
Old 04-20-2018, 04:04 PM   #67
dbeachy1
O-F Administrator
 
dbeachy1's Avatar


Default

Hmm, that's odd. Maybe that's caused by this warning?

Quote:
Originally Posted by Compilation Warning
 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Mic rosoft.CppBuild.targets(1198,5): warning MSB8012: TargetPath(C:\Users\toffe\Desktop\Orbiter\Orbiters dk\samples\Glider\Debug\Glider.dll) does not match the Linker's OutputFile property value (C:\Users\toffe\Desktop\Orbiter\Modules\Glider.dll ). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
dbeachy1 is offline   Reply With Quote
Old 04-20-2018, 04:15 PM   #68
Ripley
Tutorial translator
 
Ripley's Avatar
Default

Quote:
1>Glider.vcxproj -> C:\Users\toffe\Desktop\...
Why on the desktop?
Couldn't it be a UAC issue?
Ripley is offline   Reply With Quote
Old 04-20-2018, 04:17 PM   #69
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by dbeachy1 View Post
 Hmm, that's odd. Maybe that's caused by this warning?
This could be, but I wouldn't do what the warning suggests. Simply because following the suggestion would mean that ALL build artifacts land in the /modules/ folder, which is not what I want.

---------- Post added at 18:17 ---------- Previous post was at 18:16 ----------

Quote:
Originally Posted by Ripley View Post
 Why on the desktop?
Couldn't it be a UAC issue?
I'm pretty sure the binary is in his /modules/ folder, he just did not check.
Face is offline   Reply With Quote
Old 04-21-2018, 05:05 AM   #70
zachary77
Orbinaut
Default

Now I feel stupid... it was there all this time!
Anyway, I've now added flap extension sounds, auto-trim on/off aural indicators and wind sounds that vary with airspeed.
Thanks for all your help, and sorry for my silly questions
zachary77 is offline   Reply With Quote
Old 04-21-2018, 05:57 AM   #71
Urwumpe
Certain Super User
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 Thanks for all your help, and sorry for my silly questions
There are no silly questions. Especially not in C++.

I am VERY happy that my age prevents me from remembering what problems I had 20 years ago.
Urwumpe is online now   Reply With Quote
Thanked by:
Old 04-21-2018, 06:12 AM   #72
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 Thanks for all your help, and sorry for my silly questions
You're welcome. We all had to start somewhere, and IMHO the only stupid thing a newcomer can do is to reject help out of arrogance.
Face is offline   Reply With Quote
Thanked by:
Old 04-22-2018, 05:29 AM   #73
zachary77
Orbinaut
Default Glider V0.50 Release

V0.50 has been released! This can be installed over the previous version if you have it. With it comes a host of new features, including:
  • 8 flap stages (positive and negative)
  • Auto-trim is now fully automatic (no need to switch on/off anymore)*
  • XRSound support (more details below)
*in normal circumstances, acrobatics notwithstanding

XRSound Support
This version has custom sounds, and as such requires XRSound. A BIG thanks to Face and dbeachy1 helping me get it to work
Sounds include:
  • Wind sound in-cockpit that varies with airspeed
  • Auto-trim on/off sounds
  • Flap sounds (ext./ret.)
  • Overspeed warning above 60 m/s

Key commands:
  • [E] - Engine on/off**
  • [NUMPAD5] - Auto-trim on/off
  • [V] - Flaps 0 (neutral)
  • [B] - Flaps -1
  • [N] - Flaps +1
  • [M] - Flaps full (positive)

** Because of programming laziness safety reasons, engine will only shut down if thrust is idle

To-do: variometer, better mesh (thanks Marijn)
Wishes: thermals, damage

Have fun!
zachary77

EDIT: Linked to correct .lib now, sorry about that
Attached Files
File Type: zip Glider V0.50.zip (373.9 KB, 4 views)

Last edited by zachary77; 04-22-2018 at 01:08 PM. Reason: Wrong .lib
zachary77 is offline   Reply With Quote
Thanked by:
Old 04-22-2018, 11:34 AM   #74
Face
Beta Tester
 
Face's Avatar

Default

Quote:
Originally Posted by zachary77 View Post
 EDIT: It requires the new XRSound Beta
XRSound Beta is not released AFAIK. So nobody can enjoy your addon's sound feature if dbeachy1 decides to kill the temporary download link. I'd suggest to revert it to 1.1 .
Face is offline   Reply With Quote
Thanked by:
Old 04-22-2018, 11:19 PM   #75
zachary77
Orbinaut
Default

Quote:
Originally Posted by Face View Post
 XRSound Beta is not released AFAIK. So nobody can enjoy your addon's sound feature if dbeachy1 decides to kill the temporary download link. I'd suggest to revert it to 1.1 .
So sorry! I'll fix it now.

EDIT: Fixed

---------- Post added at 11:19 PM ---------- Previous post was at 12:54 PM ----------

By the way, how would I get vertical speed (for variomater)?

Last edited by zachary77; 04-22-2018 at 01:10 PM. Reason: Fixed .lib
zachary77 is offline   Reply With Quote
Thanked by:
Reply

  Orbiter-Forum > Orbiter Addons > Addon Development

Tags
glider, o2016


Thread Tools

Posting Rules
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Jump


All times are GMT. The time now is 08:32 PM.

Quick Links Need Help?


About Us | Rules & Guidelines | TOS Policy | Privacy Policy

Orbiter-Forum is hosted at Orbithangar.com
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright ©2007 - 2017, Orbiter-Forum.com. All rights reserved.