Jump to content

Using Funds and "Trying Again" In the Mission Builder


ceaars

Recommended Posts

I can set both starting funds, and manipulate them (and have done so) in the mission builder.  But building and launching a rocket has no effect on the funds level, and you can build and launch a rocket that is more expensive than whatever the current fund level is.  Why is this?  And is there a way to get the mission builder to actually USE the funds when letting the user build rockets?  Or are "funds" in the mission builder just for show and don't actually do anything?

Likewise, if I want to set things up so if you fail an objective you try again, how do I do it?  More specifically - I have a Spawn Vessel node "flowing" into a "get to this altitude" node and a "vessel was destroyed" node.  The "vessel was destroyed" node triggers a message saying you didn't reach the needed altitude and tells you to try again.  It then loops you back to the Spawn Vessel node.  But nothing happens.  The player can't build another rocket and try again - they're locked out of the VAB permanently.  Why?

Thanks in advance - I'm trying to see what I can do with the builder (in fact, I'm actually seeing how viable it is to make some "labs" for my students to play with), but there are clearly some things that I don't understand (that aren't working the way it seems like they should)...

Link to comment
Share on other sites

Okay, I'm going to guess that the lack of answer means nobody's really explored this functionality and doesn't really know.  So it looks like I might be taking point on answering my own questions.  So if you're interested, here's a first update:

I still have no clue how "funds" can actually be spent.  You do seem to get funds by recovering vehicle components, but actually building and launching a rocket doesn't appear to affect it.  At the moment it seems to be a de-facto "score" of sorts (you can deduct funds for failure or add them for success), but isn't actually *used* (or at least I haven't found a setting that seems to "use" funds).

The "try again" problem I might have made somewhat more progress on.  I'm beginning to suspect that to "reuse" a "spawn vessel" node, the previous mission spawned using that node has to be "recovered."  In other words - once you "go to the launch pad" (as it were) that particular instance of "spawn vessel" is flagged as "on" (for lack of a better word).  And if the builder script loops back to a spawn vessel node that is "on," it just ignores it (well, I think it's technically just assuming the "spawned vessel" exists, so you can't build a new version of it; so it's more like the "spawn vessel" node is set to TRUE, or CURRENTLY SPAWNED, if that makes sense).  And the only way to clear that state is to recover the vessel.  If I'm right about this, the complete destruction of the vessel is NOT sufficient criteria to set the node to FALSE or NOT CURRENTLY SPAWNED.

If I'm right, that means that to "re-use" a spawn vessel node for a destroyed vessel, you've got to somehow make a totally destroyed vessel "recoverable."  It might be as simple as spawning a "part" on the launch pad (or maybe a "water boy" kerbal or something) that will be flagged as part of the mission and recoverable.  I'll have to test it out to see...

EDIT:  Well, I thought I'd found something - under 'Options' is a checkmark for "only do this node once."  I figured that's what was keeping stuff from working (i.e. since the builder had already done "spawn vessel" it simply couldn't do it again from that node while that checkmark was checked).  So I figured unchecking it might solve the "can't loop back around to 'spawn vessel' to try again" problem.  THAT was a big no.  Not only do you STILL stay locked out of the VAB - so far the ONLY way I've been able to give you access again is to put in a completely new spawn vessel node - but unchecking 'one only' actually seems to set the node as PERMANENTLY true... so I only managed to create an infinite loop that flooded the "Mission App" with more than 700 "you didn't get to the correct altitude" message since the builder literally read it as:

VESSEL IS SPAWNED (it's actually completely recovered at this point)

SPAWNED VESSEL IS FLAGGED AS RECOVERED (but "made it to 7000 m node" wasn't activated)

DISPLAY "You didn't get to 7000 m"

SPAWN VESSEL (but VESSEL IS SPAWNED)

VESSEL IS FLAGGED AS RECOVERED

.... etc. etc, looping through over and over and over again.

 

So far it is seeming very much like NO MATTER WHAT THE SPAWN VESSEL NODE CAN ONLY BE USED ONCE TO ACTUALLY BUILD SOMETHING.  After that it is flagged as TRUE *forever.*

So it seems like the only way I've found to "try again" is to give the player "lives" in the form of multiple spawn vessel nodes for a given mission objective.

Example:  You want the player to build a vessel that gets to 10,000 m.

Spawn Vessel connected to (1) vessel gets to 10,000 m, (2) vessel is destroyed, (3) vessel is recovered, such that 2 and 3 are alternate branches from Spawn Vessel to test to see if the vessel was destroyed or recovered *before* you got to 10,000 m.  There's also another (4) vessel is destroyed or (5) vessel is recovered AFTER (1) to test when the "flight ended" if you did make it to 10,000 m.  All of that works as expected.

But, if you try to connect (2) and (3) back to (1) (i.e. "try again") you either get:

A.  A state where it is impossible to ever advance the mission, since you can't build a new vessel, but your old one was recovered or destroyed before reaching 10,000 m (and can never be triggered again).  This is what you get when "do node 1" IS checkmarked.

B. (2) and (3) "firing" eternally because EITHER "recovered" or "destroyed" is flagged to TRUE and the node can fire multiple times, so it just keeps firing OVER and OVER.  And the fact it feeds into (1) is useless, because it thinks the vessel already exists (but didn't get to 10,000 m), so (1) just goes "yep" you've got a vessel, so check to see if it made it to 10,000 m (you didn't), but it WAS either (2) or (3), so cycle back to (1), but it never made it to 10,000, but is WAS either (2) or (3), so cycle back to (1), but it n... you get the idea.

 

Here's the only work around that I can think of so far (my example gives you a total of 4 tries; it could be reduced to 3 or 2, or expanded to more).  Call the first "Spawn Vessel" (0).

0) Spawn Vessel, connects to (1), (2), and (3).

(2) and (3) connects to (5) Spawn Vessel Try #2.  (5) connects to (1), (6) vessel destroyed, (7) vessel recovered (note these are separate copies of the original (2) and (3)).

(6) and (7) connects to (8) Spawn Vessel Try #3.  (8) connects to (1), (9) destroyed, and (10) recovered.

(9) and (10) connect to (11) Spawn Vessel Try #4.  (11) connects to (1), (12) destroyed, and (13) recovered.

(12) and (13) connect to (14) Message: We've given you four tries and you failed four times.  You suck.  Game Over (i.e. End Mission).

If either (0), (5), (8), (11), or (14) ever actually trigger (1), the mission actually advances to the next objective.

... so it's possible for "failure" to give you more "tries" - but it is REALLY a pain to program...

Edited by ceaars
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...