Recommend
7 
 Thumb up
 Hide
1 Posts

Leaving Earth» Forums » Play By Forum

Subject: Mod-Free Leaving Earth PBF Scripts rss

Your Tags: Add tags
Popular Tags: [View All]
Zach T
United States
Virginia
flag msg tools
badge
Avatar
mbmbmb
Building off discussions in PBF 03 - Favorable Outcomes, here are the scripts required to run a PBF game of Leaving Earth without the need for a single moderator to have a master copy of the game and the associated hidden information (the Outcome deck, the Outcomes on each advancement, and the explorable locations on the game board itself).

To use these scripts, put them in your Quickbar:

Quickbar primer wrote:

1) Click on "Edit" on the top right of your screen to Edit your quick bar.

2) Chose an empty spot and fill label with whatever you want to call this script (e.g. "Landing" for your Landing advancement), and then in the URL put the appropriate code (see the spoiler tags below).

3) Many of the scripts contain seed numbers; replace them with the appropriate seed, as described below.

4) When you post, click on Reply/Quick Reply and then click on your Quick Bar Link. Presto! It will automatically run and (depending on the script) put the results in the text of your post, or tell you the results in a small dialog window.


The four scripts:

1: Initial Game Setup

This sets up the game board at the start of the game---that is, picks what you'll find when you explore the various hidden locations around the board. You'll only need to use this one time, at the start of the game.

Spoiler (click to reveal)
javascript: (function() { var seed = 0; var titan = Math.floor(Math.random() * 3); seed += titan; seed *= 3; var enceladus = Math.floor(Math.random() * 3); seed += enceladus; seed *= 3; var saturn = Math.floor(Math.random() * 3); seed += saturn; seed *= 3; var callisto = Math.floor(Math.random() * 3); seed += callisto; seed *= 3; var ganymede = Math.floor(Math.random() * 3); seed += ganymede; seed *= 4; var europa = Math.floor(Math.random() * 4); seed += europa; seed *= 3; var io = Math.floor(Math.random() * 3); seed += io; seed *= 3; var jupiter = Math.floor(Math.random() * 3); seed += jupiter; seed *= 3; var ceres = Math.floor(Math.random() * 3); seed += ceres; seed *= 3; var phobos = Math.floor(Math.random() * 3); seed += phobos; seed *= 3; var mars = Math.floor(Math.random() * 3); seed += mars; seed *= 4; var moon = Math.floor(Math.random() * 4); seed += moon; seed *= 4; var suborbital = Math.floor(Math.random() * 4); seed += suborbital; seed *= 4; var venus = Math.floor(Math.random() * 4); seed += venus; seed *= 2; var mercury = Math.floor(Math.random() * 2); seed += mercury; seed *= 3; var solar = Math.floor(Math.random() * 3); seed += solar; alert("Your game seed is: "+ seed); })();


When you run this script, it will tell you the game seed; enter this as the seed in the next script.

2: Exploration

This script can be used to check when you an encounter a location-based hazard (including Solar Radiation / Suborbital Space), or survey one of them using Surveying. It lets you peek at the underside of the appropriate card.

Replace the number after "var seed =" with the seed from the Initial Game Setup script. This seed should be the same for all players, as you're all playing the same game.

To use this script, press the appropriate entry on the Quickbar; you'll be prompted to enter the name of the location you're surveying (there's some leeway with capitalization / name variants). You'll then be prompted to confirm your choice (OK/Cancel), then told what's on the back of the card. Obviously, don't use this to cheat.

Spoiler (click to reveal)
javascript: (function() { var seed = 22606656; var solar = seed % 3; seed = Math.floor(seed / 3); var mercury = seed % 2; seed = Math.floor(seed / 2); var venus = seed % 4; seed = Math.floor(seed / 4); var suborbital = seed % 4; seed = Math.floor(seed / 4); var moon = seed % 4; seed = Math.floor(seed / 4); var mars = seed % 3; seed = Math.floor(seed / 3); var phobos = seed % 3; seed = Math.floor(seed / 3); var ceres = seed % 3; seed = Math.floor(seed / 3); var jupiter = seed % 3; seed = Math.floor(seed / 3); var io = seed % 3; seed = Math.floor(seed / 3); var europa = seed % 4; seed = Math.floor(seed / 4); var ganymede = seed % 3; seed = Math.floor(seed / 3); var callisto = seed % 3; seed = Math.floor(seed / 3); var saturn = seed % 3; seed = Math.floor(seed / 3); var enceladus = seed % 3; seed = Math.floor(seed / 3); var titan = seed % 3; var choice = ""; choice = prompt("Which location are you surveying?", ""); choice = choice.toLowerCase(); var niceChoice = ""; if ( choice === "solar" || choice === "solar radiation" || choice === "sun" || choice === "radiation" ) { niceChoice = "Solar Radiation"; } else if ( choice === "suborbital" || choice === "suborbital flight" || choice === "suborbital space" || choice === "earth" ) { niceChoice = "Suborbital Space"; } else if ( choice === "moon" || choice === "luna" || choice === "lunar" || choice === "the moon" ) { niceChoice = "The Moon"; } else if ( choice === "mercury" || choice === "venus" || choice === "mars" || choice === "phobos" || choice === "ceres" || choice === "jupiter" || choice === "io" || choice === "europa" || choice === "ganymede" || choice === "callisto" || choice === "saturn" || choice === "enceladus" || choice === "titan" || choice === "uranus" || choice === "neptune" ) { niceChoice = choice.charAt(0).toUpperCase() + choice.slice(1); } if (niceChoice !== "") { var bob = false; var a = ""; bob = confirm("Are you sure you want to survey " + niceChoice + "?"); if (bob) { switch (niceChoice) { case "Solar Radiation": switch (solar) { case 0: a = "No Significant Radiation"; break; case 1: a = "Radiation Level 1"; break; case 2: a = "Radiation Level 2"; break; } break; case "Mercury": switch (mercury) { case 0: a = "(blank)"; break; case 1: a = "Valuable Minerals"; break; } break; case "Venus": switch (venus) { case 0: case 1: a = "Spacecraft Destroyed"; break; case 2: a = "Oceans of Liquid Water"; break; case 3: a = "Extensive Wetland Life"; break; } break; case "Suborbital Space": switch (suborbital) { case 0: case 1: a = "(blank)"; break; case 2: a = "Roll 1"; break; case 3: a = "Roll 1-3"; break; } break; case "The Moon": switch (moon) { case 0: a = "(blank)"; break; case 1: a = "Spacecraft Destroyed"; break; case 2: a = "Valuable Minerals"; break; case 3: a = "Microbes"; break; } break; case "Mars": switch (mars) { case 0: a = "(blank)"; break; case 1: a = "Valuable Minerals"; break; case 2: a = "Seasonal Growths"; break; } break; case "Phobos": switch (phobos) { case 0: case 1: a = "(blank)"; break; case 2: a = "Phobos is Hollow"; break; } break; case "Ceres": switch (ceres) { case 0: a = "(blank)"; break; case 1: a = "Valuable Minerals"; break; case 2: a = "Plentiful Water Ice"; break; } break; case "Jupiter": switch (jupiter) { case 0: a = "Low Radiation (beta)"; break; case 1: a = "Medium Radiation (beta)"; break; case 2: a = "High Radiation (alpha)"; break; } break; case "Io": switch (io) { case 0: a = "(blank)"; break; case 1: a = "Volcanic Activity (alpha)"; break; case 2: a = "Valuable Minerals (alpha)"; break; } break; case "Europa": switch (europa) { case 0: a = "(alpha)"; break; case 1: a = "Liquid Water Ocean (beta)"; break; case 2: a = "Aquatic Life (beta)"; break; case 3: a = "Strange Readings (gamma)"; break; } break; case "Ganymede": switch (ganymede) { case 0: a = "(blank)"; break; case 1: a = "Liquid Ocean (alpha)"; break; case 2: a = "Valuable Minerals (alpha)"; break; } break; case "Callisto": switch (callisto) { case 0: case 1: a = "(blank)"; break; case 2: a = "Valuable Minerals (alpha)"; break; } break; case "Saturn": switch (saturn) { case 0: a = "(beta)"; break; case 1: a = "Radiation (beta)"; break; case 2: a = "Significant Debris (alpha)"; break; } break; case "Enceladus": switch (enceladus) { case 0: a = "Geysers (alpha)"; break; case 1: a = "Liquid Water Ocean (alpha)(beta)"; break; case 2: a = "Aquatic Life (beta)"; break; } break; case "Titan": switch (titan) { case 0: a = "Thick Atmosphere (alpha)"; break; case 1: a = "Liquid Hydrocarbons (alpha)"; break; case 2: a = "Methane-Based Life (beta)"; break; } break; case "Uranus": case "Neptune": a = "(blank)"; break; } alert(niceChoice + " has " + a + "."); } } })();


3: Buying / Trading for Advancements

Use this script whenever you buy or trade for a new advancement (or trade to reduce the number of outcomes on an existing advancement). The seed currently listed after "var seed =" is for the start-of-game deck; you can always start any game with this seed.

To use this script, make sure you're making a post in your game thread, then press the appropriate button in the Quick Bar. You'll be prompted to enter the number of outcomes for the advancement (usually 3, but occasionally less if you are buying Surveying or trading). You'll then be given a seed for use with that advancement (see the next script) and an updated seed for the updated Outcome deck as a whole. The next person to buy or trade for an advancement should use that new seed (replace 721865548582393 with whatever it is).

Spoiler (click to reveal)
javascript: (function() { var seed = 721865548582393; var redSeed = seed % 100000; var orangeSeed = Math.floor(seed / 100000) % 100000; var greenSeed = Math.floor(seed / 10000000000); var numRed = Math.floor(16 * Math.pow(Math.sin(redSeed), 2)); var numOrange = Math.floor(16 * Math.pow(Math.sin(orangeSeed), 2)); var numGreen = Math.floor(61 * Math.pow(Math.sin(greenSeed), 2)); var total = numRed + numOrange + numGreen; var numDraw = 3; var t = document.getElementsByTagName("textarea")[0]; var b = ""; numDraw = prompt("How many outcome cards for this advancement?",3); numDraw = parseInt(numDraw); if (numDraw === 3 || numDraw === 2 || numDraw === 1) { var draw = -1; var drawnGreen = 0; var drawnOrange = 0; var drawnRed = 0; if (numDraw > total) { b = "The outcome deck is exhausted. Please ask the moderator for a reshuffle, or use seed 721865548582393 to crack open a fresh 90-card deck."; } else { while (numDraw > 0) { draw = Math.floor(Math.random() * total); if (draw < numRed) { drawnRed++; numRed--; } else if (draw < numRed + numOrange) { drawnOrange++; numOrange--; } else { drawnGreen++; numGreen--; } total--; numDraw--; } var a = -1; switch (drawnGreen * 100 + drawnOrange * 10 + drawnRed) { case 1: a++; case 10: a++; case 100: a++; case 2: a++; case 11: a++; case 20: a++; case 101: a++; case 110: a++; case 200: a++; case 3: a++; case 12: a++; case 21: a++; case 30: a++; case 102: a++; case 111: a++; case 120: a++; case 201: a++; case 210: a++; case 300: a++; } var advancementSeed = -1; if (a >= 0) { do { advancementSeed = Math.floor(Math.random() * 1000000); } while (Math.floor(19 * Math.pow(Math.sin(advancementSeed), 2)) != a); } var newRedSeed = -1; var newOrangeSeed = -1; var newGreenSeed = -1; do { newRedSeed = Math.floor(Math.random() * 100000); } while (Math.floor(16 * Math.pow(Math.sin(newRedSeed), 2)) != numRed); do { newOrangeSeed = Math.floor(Math.random() * 100000); } while (Math.floor(16 * Math.pow(Math.sin(newOrangeSeed), 2)) != numOrange); do { newGreenSeed = Math.floor(Math.random() * 100000); } while (Math.floor(61 * Math.pow(Math.sin(newGreenSeed), 2)) != numGreen); var newSeed = newGreenSeed * 10000000000 + newOrangeSeed * 100000 + newRedSeed; b = "Your Advancement Seed: " + advancementSeed + "\r\nNew Deck Seed: " + newSeed; } } t.value = t.value + b + "\r\n"; })();


4: Testing Advancements

To draw outcomes when using an advancement (such when you fire a rocket or Land on a planet), use this script. You'll have a different entry in your Quickbar for each advancement that you have. [If you buy a whole lot of advancements, you may need to use multiple tabs of the quickbar.]

Replace the number after "var seed =" (currently 538946) with whatever seed you were given when using the "3: Buying / Trading for Advancements" script, above.

Whenever you're testing an advancement, press the appropriate item in your Quickbar when composing a post. It will tell you the result (Success, Minor Failure, or Major Failure), along with the new seed you would use if (and only if) you paid to remove that outcome (if it wasn't the last outcome). When posted, the new seed will be posted in the same background color as the forum itself, so it's unobtrusive.

If you test the same advancement again, the 'new seed' information is updated (and the old one removed).

If you do pay to remove the outcome, make sure to update this script with the new seed (putting it after "var seed =").

Spoiler (click to reveal)
javascript: (function() { var seed = 538946; var advancement = ""; if (advancement === "") { } else { advancement += ": "; } var green = "[col" + "or=green]Success[/color]"; var orange = "[col" + "or=orange]Minor Failure[/color]"; var red = "[col" + "or=red]Major Failure[/color]"; var result1 = "Error"; var result2 = "Error"; var result3 = "Error"; var realSeed = Math.floor(19 * Math.pow(Math.sin(seed), 2)); var numresults = 3; switch (realSeed) { case 0: result1 = green; result2 = green; result3 = green; break; case 1: result1 = green; result2 = green; result3 = orange; break; case 2: result1 = green; result2 = green; result3 = red; break; case 3: result1 = green; result2 = orange; result3 = orange; break; case 4: result1 = green; result2 = orange; result3 = red; break; case 5: result1 = green; result2 = red; result3 = red; break; case 6: result1 = orange; result2 = orange; result3 = orange; break; case 7: result1 = orange; result2 = orange; result3 = red; break; case 8: result1 = orange; result2 = red; result3 = red; break; case 9: result1 = red; result2 = red; result3 = red; break; case 10: result1 = green; result2 = green; numresults = 2; break; case 11: result1 = green; result2 = orange; numresults = 2; break; case 12: result1 = green; result2 = red; numresults = 2; break; case 13: result1 = orange; result2 = orange; numresults = 2; break; case 14: result1 = orange; result2 = red; numresults = 2; break; case 15: result1 = red; result2 = red; numresults = 2; break; case 16: result1 = green; numresults = 1; break; case 17: result1 = orange; numresults = 1; break; case 18: result1 = red; numresults = 1; break; } var b = "Error"; switch (numresults) { case 3: var rand = Math.floor(Math.random() * 3 + 1); switch (rand) { case 1: b = result1; break; case 2: b = result2; break; case 3: b = result3; break; } break; case 2: var rand = Math.floor(Math.random() * 2 + 1); switch (rand) { case 1: b = result1; break; case 2: b = result2; break; } break; case 1: b = result1; break; } var newRealSeed = -1; var newSeed = -1; var c = ""; switch (b) { case green: switch (realSeed) { case 0: case 1: case 2: case 3: case 4: case 5: newRealSeed = realSeed + 10; break; case 10: case 11: case 12: newRealSeed = realSeed + 6; break; case 16: newRealSeed = -2; break; } break; case orange: switch (realSeed) { case 1: newRealSeed = 10; break; case 3: newRealSeed = 11; break; case 4: newRealSeed = 12; break; case 6: case 7: case 8: newRealSeed = realSeed + 7; break; case 11: newRealSeed = 16; break; case 13: case 14: newRealSeed = realSeed + 4; break; case 17: newRealSeed = -2; break; } break; case red: switch (realSeed) { case 2: newRealSeed = 10; break; case 4: newRealSeed = 11; break; case 5: newRealSeed = 12; break; case 7: case 8: case 9: newRealSeed = realSeed + 6; break; case 12: newRealSeed = 16; break; case 14: case 15: newRealSeed = realSeed + 3; break; case 18: newRealSeed = -2; break; } break; } if (newRealSeed >= 0) { do { newSeed = Math.floor(Math.random() * 1000000); } while (Math.floor(19 * Math.pow(Math.sin(newSeed), 2)) != newRealSeed); c = " [col"+"or=#F4F4FF]Old seed: "+seed+". New seed if removed: " + newSeed + "[/co"+"lor]."; } var re = new RegExp("\\[color=#F4F4FF\\]Old seed: "+seed+"\\. New seed if removed: \\d+\\[/color\\]\\.","g"); var t = document.getElementsByTagName("textarea")[0]; t.value = t.value.replace(re,"") + advancement + b + c + "\r\n"; })();


General Notes

Obviously, you can use these scripts to cheat (peeking at locations, drawing from your outcome decks). Don't do that.

If you are updating a script with a new seed, note that any posts you have in progress will not see the updated script. In particular, if you are buying / trading for an advancement or removing an outcome from an advancement, you should probably end your post after doing so and conduct any remaining business in a new post after you've updated your scripts.

Leaving Earth is a complicated game, and it generally helps to have someone keep track of the game state as a whole (who has spaceships where, who has what outcomes, etc.). It's probably a good idea to designate a player to do so, but note that these scripts mean that that player doesn't need to have any hidden information.

All of these scripts also work equally well for Outer Planets. They don't cover Explorable Missions, but you can just draw those with the Geekroller. For example:
Spoiler (click to reveal)
1custom2{Ganymede Lander;Ganymede Sample Return;}


The only circumstance that is not covered is if you exhaust the Outcome deck entirely (possible in games with a lot of players, or if people buy a whole lot of advancements). In such circumstances, I'd recommend just house ruling that the new deck is just the same as the start-of-game deck (i.e. reset the seed to 721865548582393).

If anyone has any questions, let me know! I hope someone has some fun with this at some point.
6 
 Thumb up
0.25
 tip
 Hide
  • [+] Dice rolls
Front Page | Welcome | Contact | Privacy Policy | Terms of Service | Advertise | Support BGG | Feeds RSS
Geekdo, BoardGameGeek, the Geekdo logo, and the BoardGameGeek logo are trademarks of BoardGameGeek, LLC.