Jump to content

Docked/stacked nodes in Mission Builder


Recommended Posts

Hey there! :)

I wonder how this works with docked (stacked) nodes in the mission editor? What does it do/mean when I stack them? 

And how do I do a chain of dialog boxes, that appear after each other, rather then simultaneously?
I tried it that way: I just made them into a chain, but then all of them get triggered at once and are shown at the same time...
My personal "workaround" (I dont know if this is meant like that from the developers...): I put a timing node after each dialog node, which meassures the time since this dialog node had triggered and triggers itself, when a certain amount of time has passed. The bad thing about that is, it triggers the next dialog after a set amount of time and not when I click "continue" on the dialog. But still better than nothing...

And during that workaround I stumbled upon the possibility to dock the timing node to the dialog node. But what does this do? No matter what options and settings I tried, I always got stuck on that node...
Could someone explain to me, how this works? :)
And what does it mean, if I dock a "check velocity" node to a "check altitude" node (which does not work the other way around, if I remember correctly)?

Best regards! :D

 

PS: sorry if I missed out something on the tutorials.... but they are.... semi-helpful, as they explain nearly nothing, just telling what to do :/ And after it said there are 3 tutorials, while I saw only 2, it more or less dieded for me :D
PPS: yes, it "dieded"

 

 
Edited by stoani96
Link to comment
Share on other sites

Anything docked to a node is a test that will be run when that node is fired. I've actually got an example I can share, from my mission:

Xubbxvx.png

You'll have to open it in a new tab to see it readably, but look at "OKTP Docking" where it has 6 nodes docked to it

Those 6 nodes are each testing vessel mass, because I provided both ships for my mission so I can figure out how much fuel you used. As it stands, the first node that qualifies will be the one the mission proceeds through, so you have to start with the very stringent tests before moving down to more forgiving ones. As such, i'm testing first to see if the player is overweight (ie, docked while attached to an upper stage), then testing for 0.5%, 1%, 2.5%, 5%, and 10% fuel use in that order.

When one of those applies, it proceeds to apply a score (or lack thereof), and goes to the next node. That's just an always-true node, with speed challenges docked to it the same way. That one's testing for"gametime between the liftoff of the second rocket and docking, in a similar order. 30 minutes, 45, 60, 90, 120.

 

More simply, you can use 'test accuracy' nodes to award points for getting into a good orbit, beyond what satisfies the main node. In that case, "test accuracy" operates on the remainder, so if your orbit has to be 99.5% (low kerbin orbit needs that percentage cranked way up), you can add a 50% test accuracy node and you'll get points if you're 99.55% accurate, i think that's how that works. Could be wrong.

Link to comment
Share on other sites

As a technical overview:

If you just have a series of nodes, one after another -- then when one node gets activated the game starts testing the next node repeatedly to see if it ever activates. If you have multiple tests to do, this gives you a simple method of performing a "logical OR" operation. From your current node you branch to both tests, and if either one passes then you continue with the flow of the mission.

The Details of what docking does: the instant the "parent" node activates, all the docked nodes are evaluated once from top to bottom. So all the tests are performed at the same moment in time.

What that accomplishes logically: It gives you some ability to conveniently perform "logical AND" operations.

Look at the titles of the "Display Message" nodes in this image for a visual description of the logical operation

BkNChdP.jpg

If you understand my image, it also gives you the ability to immediately branch the logic two different directions, according to whether a test is either true OR FALSE.

(note that it is possible to accomplish the same thing without using docked nodes, by using multiple branching and the "Always True" node. So docking nodes can be considered just a visual simplification.)

 

 

Edited by bewing
Link to comment
Share on other sites

Put simply, docking is a way of choosing one of multiple paths based on conditions when a node activates.
Say for example you have a "Vessel Landed" node. When that node activates, the only output path is taken.

LVPROwB.png

 

Let's say you wanted to print two different messages once the vessel has landed, depending on whether the vessel is almost out of fuel.
You can stack a "Resource Amount" onto the "Landed Vessel" node.

kEsJ6C7.png

 

Once "Landed Vessel" has been activated, instead of just firing its output, it checks the "Resource Amount" node, and if the "Resource Amount" node's condition is met, it takes the "Resource Amount" node's output instead. You can stack as many as you want. If no stacked node tests true, the main node ("Landed Vessel")'s output path is taken.

Zli3x24.png

The above means:
Once Unnamed Vessel has landed, if the amount of liquid fuel is less than or equal to 10, print "You landed! And just in time too. You better fuel up."; if not the amount of fuel is less than or equal to 10, then if the engineer is missing, print "Welcome back! Wait a second.. where's your engineer?"; if neither the fuel is less than or equal to 10 nor the engineer is missing, print "You landed!".

 

If you know basic programming, the above is equivalent to this pseudo code:

void OnVesselLanded()
{
  if (vessel.LiquidFuel <= 10)
  {
    DisplayDialog("You landed! And just in time too. You better fuel up.");
  }
  else if (vessel.CountCrew(Engineer) <= 0)
  {
    DisplayDialog("Welcome back! Wait a second.. where's your engineer?");
  }
  else
  {
    DisplayDialog("You landed!");
  }
}

 

Edited by MulleDK19
Link to comment
Share on other sites

With regards to your question about dialogs: there is a “pause mission” button in the dialog settings. That will mean the mission will wait until the user dismisses the dialog (although the game itself will not pause). So that’s all you need to create a chain of dialog boxes. 

Link to comment
Share on other sites

wait...what!?!?
"Pause Mission" does not mean, that the game is paused???

THAT explains a lot! Thanks! :)

wait...what!?!?
"Pause Mission" does not mean, that the game is paused???

THAT explains a lot! Thanks! :)

Link to comment
Share on other sites

What is the effect if *none* of the items docked under a node are true YET when the node is first entered, but might become true later after waiting a bit?

Does it just run though the nodes once and when it gets to the bottom and none of them were true does it just give up and the state machine gets stuck on that node permanently?

Or does it keep re-querying the conditions in the list from the top again and again and thus get unstuck when one of them becomes true?

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...
Not sure how to insert photos into these questions, but I've created my Imgur account to upload one at https://imgur.com/a/3gmHuST
Referring to this image, all the nodes you see here starting with the Catch All are set to run more than once. The idea was to test the active vessel all the time and when it gets low in fuel, to give it some. This is just a looping practice at the moment because I'm debugging another mission that I am working on.
If I start out with a vessel having empty tanks, the loop runs once to fill them. When I burn the fuel though, the fuel is not replenished when it falls below 50 units (I assume this is units and not tons). Both the top and bottom of this loop (true and false side) go on to the check orbit node so that will never be true if I don't launch from the launch pad.
So what I understand is that instantly when I start with an empty tank, Vessel mass > 1.00t is true (the active vessel is not a Kerbal on EVA) AND the docked node of LF <= 50 is also true so the bottom path should be taken. I added the messages just to track that it went there. The empty tanks gets filled, and the process moves on. I then burn the fuel (It's just an engine blasting straight up into the air instead of down towards the launch pad) and when it is empty, the engine stops. The mass is still > 1.00t just as it was when I started, but the catch all does not enter back in. I checked dozens of times to be sure every node here is enabled to run more than once.
I then tried reversing the logic on the fuel to make it check that LF >50 and started out with a full tank. The messages come up repeatedly that the tank is being filled up which means the process will run over and over. This just doesn't make any sense to me why it won't run when LF <50 is used and my tanks run empty.

Link to comment
Share on other sites

5 minutes ago, jclovis3 said:

Not sure how to insert photos into these questions, but I've created my Imgur account to upload one at https://imgur.com/a/3gmHuST

Hi, and welcome to the forums!  :)  A note about posting images, in spoiler.

Spoiler

To post an image here, all you have to do is to upload it to some third-party site-- such as imgur.com, for example-- and then copy the URL of the image itself (i.e. not the URL of the page it's on):  that is, a URL that ends in an actual file extension like .png or .jpg.  For example, on Imgur, wait for your page with the image to come up, then right-click on the image and choose "Copy Image Location".

Then paste that URL here.  It'll get automagically converted to an in-line image when you do.

Incidentally-- you don't need to create an account to use imgur.  You can if you want to, but you don't actually need to.  One of the nice things about imgur is that it doesn't require accounts-- it allows posting images anonymously, without being signed in.  Just something to be aware of-- one less username and password to keep track of.  :)

Here's the image from your page:

Vvms3g1.png

Link to comment
Share on other sites

14 hours ago, Snark said:

Hi, and welcome to the forums!  :)  A note about posting images, in spoiler.

  Reveal hidden contents

To post an image here, all you have to do is to upload it to some third-party site-- such as imgur.com, for example-- and then copy the URL of the image itself (i.e. not the URL of the page it's on):  that is, a URL that ends in an actual file extension like .png or .jpg.  For example, on Imgur, wait for your page with the image to come up, then right-click on the image and choose "Copy Image Location".

Then paste that URL here.  It'll get automagically converted to an in-line image when you do.

Incidentally-- you don't need to create an account to use imgur.  You can if you want to, but you don't actually need to.  One of the nice things about imgur is that it doesn't require accounts-- it allows posting images anonymously, without being signed in.  Just something to be aware of-- one less username and password to keep track of.  :)

Here's the image from your page:

Vvms3g1.png

Thank you for posting the image for me, and now that I have that figured out, I went on to discover why this wasn't working. Nodes like checking fuel levels and orbit parameters are not good nodes to have as "Catch All" because they can fire repeatedly in rapid succession. After all, just because you are low on fuel doesn't mean you won't be low on fuel a few miliseconds from now, right? In this case, a Kerbal won't even have Liquid Fuel and will always be low.

All of this was just a test trying to figure out how to create an automated refueling station when you enter orbit of Minmus or Gilly but it had to be repeatable so you can return for more in your mission. I started focusing on that rather than just detecting fuel levels, and fought with the always true orbit parameters constantly taking control. Then I discovered that Entering SOI is a one time event that doesn't repeat until you leave SOI and return again. That was my gateway into this algorithm. So the simplest loop without any messages would look like this:

uZwqwjZ.png

Right away you can see how logical this looks. There is no way to determine how much fuel a vessel can hold, so large numbers like this are just estimates. If your number is typed too large, then it will be converted to scientific notation like 1E+12 which will then be interpreted as simply 1 by the time this is processed, so make sure your number is small enough to not switch over to scientific notation. I actually found "9999999" (10M - 1) to be the highest you can go before it switches.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...