Project Shavit/Jericho Module Development

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Well, it doesn't need to be an array if there's only one of them, now does it?
An array? I thought I only defined one thruster. I don't think I understand what you mean. I still have RCS thrusters too.
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
See here, where you define th_main[1] - what you're defining there is an array of THRUSTER_HANDLEs with one member.

In truth, it should make no difference, provided you always refer to that thruster as th_main[0], but you're making unnecessary work for yourself there.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
See here, where you define th_main[1] - what you're defining there is an array of THRUSTER_HANDLEs with one member.

In truth, it should make no difference, provided you always refer to that thruster as th_main[0], but you're making unnecessary work for yourself there.
Remember when you said that the FILEHANDLE cfg is to override the code? I would like to reverse that. I came to the conclusion that everything is being ignored in the .dll. The only thing that really works is the cfg file. I can even send you the entire "package" and so you can see what I am talking about. It is strange because I worked hard on it to compile and all, but it is not actually being used. As far as I recalled, everything was fine until I started to dig deeper in the code. :compbash:

What doesn't make sense either is that on IRC a week ago it was fine.
 
Last edited:

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
If you have values in the .cfg file, they will overwrite values in the clbkSetClassCaps function by default. If you don't, the parameters from that function are used instead.

If your .cfg file simply contains a direction for the module, then there should be nothing wrong.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Regardless of that it didn't appear to work. HOWEVER, when I compile it with 2006 and play it in the 2006 build, it does work. I did in fact link the 2010 libraries and includes to the visual studio project just as the old project from the old Orbiter. I really do not want to resort to coding in an old SDK while everyone is using the new one. Call it a crazy predicament, but that is truly what is happening and to my best knowledge is occurring to.
 
Last edited:

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,615
Reaction score
2,335
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
Ahem...you only define ONE main thruster, and it is the fourth one in the array (index 0 is first one in C++). You create a thruster group with 3 undefined thrusters, since only the fourth one is defined. You try to add exhaust to a pointer to an array of four thrusters, instead of a proper thruster.

Houston, we have had a problem.

And this code didn't even work in 2006.
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Ahem...you only define ONE main thruster, and it is the fourth one in the array (index 0 is first one in C++). You create a thruster group with 3 undefined thrusters, since only the fourth one is defined.

He does? Where? *missed that*
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
On my last post I didn't necessarily mean just that did not work. I meant that everything I put in the code would not work even keeping the .cfg file with just the class and module name. When I use 2006 to compile it and everything, it works. All I do are switch the libraries to the old one with the same files, re-compile, and then it now is based solely from the .dll.

So bottom line is the my 2010 .dlls do not work only the 2006 one.
 
Last edited:

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
The code sequence in which he defined the thrusters and exhaust parameters.

I got that far, I just don't see an array with three empty members in that code.
 

Urwumpe

Not funny anymore
Addon Developer
Donator
Joined
Feb 6, 2008
Messages
37,615
Reaction score
2,335
Points
203
Location
Wolfsburg
Preferred Pronouns
Sire
I got that far, I just don't see an array with three empty members in that code.

Actually four members. He didn't define it as such, but he treated the symbol as one.
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Ahh, I see it now. It looks like you've copied a lot of code from various different places without really knowing what it does, MJR. I'd suggest a C++ tutorial.
 
Last edited:

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Ahh, I see it now. It looks like you've copied a lot of code from various different places without really knowing what it does, MJR. I'd suggest a C++ tutorial.
I didn't so much as to copy it and just plop it down and expect it to work. I am understanding it day by day. I do make parts of it by scratch and the other parts which are more advanced are done with the help of open sourced code. Eventually I will get to the point where I no longer need it, but it is just the beginning for me. It does work and all, but me changing to the 2010 SDK is just not working out. I dunno. I don't find it that difficult anymore it is just I need to learn workarounds and keep trying. Really I am not lying because there is no need to and I do not understand why to. As always, it is hard for newcomers.

And I am using VESSEL3 for the 2010 one.
 
Last edited:

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Sample code isn't a terrible way to learn provided you know some basics already. It's pretty evident looking at this thread that this isn't the case for you. I'd strongly recommend learning a little more about C++, for instance about arrays and how to define them properly.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Sample code isn't a terrible way to learn provided you know some basics already. It's pretty evident looking at this thread that this isn't the case for you. I'd strongly recommend learning a little more about C++, for instance about arrays and how to define them properly.
If I for instance, code it in 2006 SDK, how hard would it be to make it compatible with 2010?

P.S. I guess I'll get a book to understand it a little bit more.

:rolleyes:
 

Xyon

Puts the Fun in Dysfunctional
Administrator
Moderator
Orbiter Contributor
Addon Developer
Webmaster
GFX Staff
Beta Tester
Joined
Aug 9, 2009
Messages
6,926
Reaction score
794
Points
203
Location
10.0.0.1
Website
www.orbiter-radio.co.uk
Preferred Pronouns
she/her
Not very. Most addons compiled against 2006's API are still compatible with 2010 anyway.

However, writing it in 2006's SDK won't make it any easier, and you'll just be making more work for yourself porting it later, plus limiting yourself and your addon to using older and in most cases less features. If you're going to learn the API, learn the current one.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Not very. Most addons compiled against 2006's API are still compatible with 2010 anyway.

However, writing it in 2006's SDK won't make it any easier, and you'll just be making more work for yourself porting it later, plus limiting yourself and your addon to using older and in most cases less features. If you're going to learn the API, learn the current one.
Oh, the reason I said that was because that appears to be the only one actually working for me. I am going to try it on my other computer after I finish this one in the 2006 and "upgrade" to 2010. For some reason it just doesn't want to respond.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
In the meantime I am going to launch a Multistage2 version of it and later on will update it to .dll.
 

MJR

C++ developer in the mix
Addon Developer
Tutorial Publisher
Donator
Joined
Mar 19, 2008
Messages
2,460
Reaction score
5
Points
0
Location
United States
Tell me why that when I try to compile with my custom header file, it says that it is not found?! I have made one before and haven't encountered this until now.

Code:
fatal error C1083: Cannot open include file: 'Shavit.h': No such file or directory

Any suggestions? I mean, all you do is define it in the actual .h file, but it isn't working this time.
 

orb

New member
News Reporter
Joined
Oct 30, 2009
Messages
14,020
Reaction score
4
Points
0
Code:
fatal error C1083: Cannot open include file: 'Shavit.h': No such file or directory
Are the .cpp and .h files in the same directory as solution and project files? Is the Shavit.h included in the list of files of the project?
 
Top