Orbiter-Forum  

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

Addon Requests If you have a request for a new addon or want to know where to find a specific addon, ask it here!

Reply
 
Thread Tools
Old 07-16-2012, 07:34 PM   #16
Samuel Edwards
Decidedly Cyclical
 
Samuel Edwards's Avatar

Default

You are welcome, if you need me to explain anything, or want GFX, 'PM me maybe'.
Samuel Edwards is offline   Reply With Quote
Old 07-16-2012, 07:51 PM   #17
BruceJohnJennerLawso
Dread Lord of the Idiots
 
BruceJohnJennerLawso's Avatar
Default

Quote:
Originally Posted by jedidia View Post
 rather simple. I guess the first question would be: do you have at least basic knowledge of C++? if not, you have to start there.
If yes, then it's really not that hard. Internal tanks are the easiest, as orbiter already provides those, you're merely abusing them for something else than propellant (soething I'm doing in my current project for water/food/oxygen). Really nothing more to it.
Spawning a vessel is also not a big thing, the orbiter API provides all the necessary calls (if the scenario editor can do it, anyone can). I'm not familiar with UCGO, but dan usually provides very decent documentation with his SDKs, so you shouldn't ave much trouble there either. As far as I'm aware, you should not even need the Orbiter API to spawn the full containers, I think UCGO has its own calls to spawn cargoes. Might be wrong though.
Anyways, basic workings would look something like this:

Over time, fill up propellant tank with ore. When tank reaches a certain level, spawn cargo, reduce propellant in tank. That's pretty much it, shouldn't be more than some 50-ish lines of code, everything considered (header, initialisation, etc. The actual functionality shouldn't take more than 10 lines, really, at least at this basic level).
Hmmm, well I dont think theres a UCGO function to spawn cargoes, just a way for an object to infinitely ressuply a particular resource type as an attachment point. I do have some experience coding, but its still mostly basic at this point, some things come faster than others (ie thrusters, pressure dependency, Engines, Docks-no problem. For animations I needed help from another developer). Are you aware of the code needed to spawn vessels from a vessel? I havent been able to find it yet. For the actual resource tank, is that defined similar to a propellant tank or something else? (I imagine that is probably in the UCGO docs. The problem with the station doc wasnt so much Dansteph, as much as the language barrier.
BruceJohnJennerLawso is offline   Reply With Quote
Old 07-16-2012, 07:59 PM   #18
jedidia
shoemaker without legs
 
jedidia's Avatar
Default

Quote:
For the actual resource tank, is that defined similar to a propellant tank or something else?
It's a propellant tank. You just don't use it as such. Of course, you ca also just have a variable storing the load, but then you'll have to update the mass manually. If mass is even a concern for such a thing...

Quote:
(I imagine that is probably in the UCGO docs.
Oh, the tank has absolutely nothing to do with UCGO. Indeed, almost nothing has to do with UCGO, except the cargo you spawn.

Quote:
Are you aware of the code needed to spawn vessels from a vessel?
Code:
OAPIFUNC OBJHANDLE oapiCreateVessel  ( const char *  name,  
  const char *  classname,  
  const VESSELSTATUS &  status   
 )
The toughest part is to fill out the VESSELSTATUS struct, but since you already have a vessel where you want to spawn it, you can copy its position and velocity and stuff.
jedidia is offline   Reply With Quote
Old 07-16-2012, 08:07 PM   #19
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

I use something like that, it comes from a tutorial :

Code:
void NewVessel::SpawnObject(char* classname, char* ext, VECTOR3 ofs) {
  VESSELSTATUS vs;
  char name[256];
  GetStatus(vs);
  Local2Rel (ofs, vs.rpos);
  vs.eng_main = vs.eng_hovr = 0;
  vs.status = 0;
  strcpy (name, GetName()); strcat (name, ext);
  oapiCreateVessel (name, classname, vs);
};
As usual the function has to be declared in the .h file.
N_Molson is offline   Reply With Quote
Old 07-16-2012, 08:37 PM   #20
BruceJohnJennerLawso
Dread Lord of the Idiots
 
BruceJohnJennerLawso's Avatar
Default

Quote:
Originally Posted by N_Molson View Post
 I use something like that, it comes from a tutorial :

Code:
void NewVessel::SpawnObject(char* classname, char* ext, VECTOR3 ofs) {
  VESSELSTATUS vs;
  char name[256];
  GetStatus(vs);
  Local2Rel (ofs, vs.rpos);
  vs.eng_main = vs.eng_hovr = 0;
  vs.status = 0;
  strcpy (name, GetName()); strcat (name, ext);
  oapiCreateVessel (name, classname, vs);
};
As usual the function has to be declared in the .h file.
Excellent. And can I ty it to a key in the same way as a gear animation, except using SpawnObject in place of RevertGear?

---------- Post added at 08:37 PM ---------- Previous post was at 08:15 PM ----------

Just got a message back from ashaman42, hes going to try to dig up the source code and send it. Any more help with the code is appreciated, and is there anyone out there that would like to do the modelling? I was thinking maybe just doing a water drill derrick for use on Mars/Asteroids/Europa/... as a first step. I have created a water cargo, but it isnt very good, just a retexture of the standard O2/fuel boxes
BruceJohnJennerLawso is offline   Reply With Quote
Old 07-16-2012, 10:18 PM   #21
N_Molson
Addon Developer
 
N_Molson's Avatar

Default

Quote:
And can I ty it to a key in the same way as a gear animation, except using SpawnObject in place of RevertGear?
Of course. Look for tutorials (there's not enough of those in my taste) and code samples. Nearly everything is possible with Orbiter API. It's all a matter of patience and wits.

Quote:
Just got a message back from ashaman42, hes going to try to dig up the source code and send it.
Very cool, many thanks to him. Maybe it could be added on OrbitHangar ? Such resources are always great tools, and code examples are precious to avoid re-inventing hot water each time.

For the models, with Anim8tor and your imagination, you should come out with something
N_Molson is offline   Reply With Quote
Old 07-17-2012, 12:01 AM   #22
Dores
Orbinaut
 
Dores's Avatar
Default

I think we might be able to help.

What we have in mind is something akin to a spreadsheet :D which draws some of its information from Orbiter plus some flight info 2.

My friend - 'the code man' - hasn't joined the forums yet. When he does I'll get in touch.

In the end if all we achieve is a glorified spreadsheet with some more functions, then grand.

See how we get on! I totally support this kinda thing though.

Best of luck to you! If we can help let us know, although there are probably better equipped people on the forum to do so!

Best,

Dores :D
Dores is offline   Reply With Quote
Old 07-18-2012, 12:37 AM   #23
BruceJohnJennerLawso
Dread Lord of the Idiots
 
BruceJohnJennerLawso's Avatar
Default

Quote:
Originally Posted by Dores View Post
 I think we might be able to help.

What we have in mind is something akin to a spreadsheet :D which draws some of its information from Orbiter plus some flight info 2.

My friend - 'the code man' - hasn't joined the forums yet. When he does I'll get in touch.

In the end if all we achieve is a glorified spreadsheet with some more functions, then grand.

See how we get on! I totally support this kinda thing though.

Best of luck to you! If we can help let us know, although there are probably better equipped people on the forum to do so!

Best,

Dores :D
Will the spreadsheet read the scn an use #s in there?
BruceJohnJennerLawso is offline   Reply With Quote
Old 07-18-2012, 02:06 AM   #24
Dores
Orbinaut
 
Dores's Avatar
Default

Yeh, the plan is to read scenario files for info.

if you mean the price by '#s', the plan at the moment is to read the config/vessels folder and price each vessel based on it's thurst and fuel capacity.

It's very early doors at the moment.

Hopefully, we will get the program so that when you have 'completed' a mission the program reads a saved scenario file and checks it against its data to see if you have, for instance, launch a satellite into the correct orbit.

Does that answer your question? I'm never sure whether i ramble or am just being thorough!

Dores :D
Dores is offline   Reply With Quote
Old 07-18-2012, 02:33 AM   #25
Samuel Edwards
Decidedly Cyclical
 
Samuel Edwards's Avatar

Default

wait, what if the scenario file becomes corrupt somehow, and you can't use it. The program would rely on that scenario file? Will the program save the data externally in an .xml file?
Samuel Edwards is offline   Reply With Quote
Old 07-18-2012, 09:56 AM   #26
Dores
Orbinaut
 
Dores's Avatar
Default

I don't know enough about coding.

But, I met up with my friend/the code man the other day and we chatted.

What we would like is for the data to be sent LIVE from Orbiter to our programme - like the mission control program on orbit hanger - and that is how the data would, preferably be collected.

Reading the scenario file would be the simpler option, which is why I mentioned it.

As I say, I'm not a programmer but it'd make sense to save data externally too!

We also plan for graphs galore. It's still in the planning stage.

We're looking for forum members to be involved - you interested?

Dores :D
Dores is offline   Reply With Quote
Old 07-18-2012, 10:29 AM   #27
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

I am interested in a similar project, but with a completely different scope... wanted to do such economics for the "World of 2001" add-on as add-on for an add-on, since it already has a pretty good population of vessels and is open-source, so developing interfaces in the vessels is easier.

But I can't currently do it, despite being a good coder. I simply lack the time and a proper development machine.
Urwumpe is offline   Reply With Quote
Old 07-18-2012, 11:19 AM   #28
Dores
Orbinaut
 
Dores's Avatar
Default

Our project may save you sometime as it will be open source.

See how we get on!

Your project sounds exciting! I love that film!

What kind of things are you going to cost?

Dores :D
Dores is offline   Reply With Quote
Old 07-18-2012, 11:38 AM   #29
Urwumpe
Not funny anymore
 
Urwumpe's Avatar

Default

Quote:
Originally Posted by Dores View Post
 Our project may save you sometime as it will be open source.
Just remember: Open source is way more than just publishing the sources. It also requires the sources and documentation to be in a form that somebody else can work with them. You need clear coding standards, documentation standards and processes for ALCM.

Quote:
Originally Posted by Dores View Post
 Your project sounds exciting! I love that film!
No project... simply some low voltage design and experimentation so far.

Quote:
Originally Posted by Dores View Post
 What kind of things are you going to cost?
I wanted to keep it very simple. Only generating TEUs in a pseudo-realistic demand-driven way with each TEU having a destination and delivery deadline. No money in the first iteration at all, fuel will be for free as long as fuel is available at the base. Not even a visible simulation of the containers before they enter the destination spaceport - they just appear at the container storage area and wait for getting picked up, or disappear when they are hauled to the target.

The biggest item that I have in actual development is still the TEU library, a framework for accessing the logistics data of each TEU. And that is just the tiny foundation of all that needs to be done. Just a small DLL that handles containers and their contents and a static link library that permits communication with the containers to "read their labels", "open/close doors", "unload/load" or "paint them".

As you can see: Millions of LOSC are still waiting for having something comparable to you want to do.

The second iteration of this would have been adding passengers to the economic model, and thus employees. The coarse concept is already sketched out along a roleplaying game ruleset that I like, but nothing yet that can be turned into source code. It would be similar to UMMU in its role then, but different in scope and size.

EDIT - Or better: ADDITIONAL WISDOM:

Don't underestimate the need for design and project management for something at the magnitude that you are planning to do. I feel like you want to start coding directly and I can understand that. But better wait, plan things before you code. Organize the project, it is really needed before you start. Don't try to do things on the fly. This works for small projects and ends in serious and demotivating refactoring once your project grows too big for creative chaos. Define interfaces first - how will the player interact with it, how will components interact, etc.

If you want to have stability, define exactly two people who will be project lead and deputy project lead. Select them good, they must not be coders, it is even helpful of they stay out of the add-on development front line. Make them the accountable and responsible parts of the project. They define the standards and requirements and make sure they last for more than just a year. They can reject changes, they decide which feature branch gets merged with the main development line, which version will be next and how it should look like. Ideally they should even be able to fire a coder from the project, when he refuses to follow the project standards and roadmap. He can do a fork anytime, but he should not be permitted to mess with your project.

The initial documents of the project are the constitution, maybe even the ten commandments of your project, and nobody should join the project before agreeing to these documents. No plan survives the first contact with the enemy and no software development results in the software initially planned. But the philosophy of the project lasts. Maybe not for ever, maybe you need to adapt things carefully when learning that things need correction. But only slowly and never as a one-way decision, there is always a way back. Make sure everybody in the project knows how this will be developed. Don't prescribe technical solutions in your project planning documents, if there is no acute need. Define what the solution should achieve, not what the solution shall be. A screwdriver can open bottles, too.

Get this management done first and then develop according to this.

Otherwise, you will get exactly nowhere. You start with lots of enthusiasm, work fast, but also get into trouble fast and with so much inertia that you will be really deep in trouble before you notice how far you have left the planned trajectory of your project already. And then you will stall. People will start to blame others, finger pointing will replace communication, people from outside the project give the direction for you, finally it will be dead and somebody will restart it. Maybe better, maybe with the same errors in management.

(Yes, I hate management myself. But I have grown too old to not know that the bitter medicine is the best.)

Last edited by Urwumpe; 07-18-2012 at 12:05 PM.
Urwumpe is offline   Reply With Quote
Thanked by:
Old 07-18-2012, 12:09 PM   #30
icedown
Orbinaut
 
icedown's Avatar
Default

I've been mulling working on a system for quantified fueling, Aka you can't fuel without being docked to a ship with a fuel carrying part docked or attached to it. The ISS being able to refuel several XR5s just makes it a bit to easy, make it so you have to put a fuel canister on it, and fill it up when you need to seems a little more interesting.

Having or being able to purchase ships was one my thoughts for later development. A mission system for credits. A way to have goals and make hauling and building a space station in orbit a little more worth it.

What are your thoughts on this? I love the SBB addon and have converted most of the animated parts to dlls. I'm was looking at using parts of it for the fueling system, that way there is already an established system people are used to hauling and make a little more use out of an already awesome addon.

BTW, not trying to hijack your thread, just putting something that may be able to help your project on the table for suggestions from the more experienced ones.
icedown is offline   Reply With Quote
Reply

  Orbiter-Forum > Orbiter Addons > Addon Requests

Tags
resources, ucgo


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 12:03 AM.

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.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 2007 - 2017, Orbiter-Forum.com. All rights reserved.