The Dark Side
"Modding" or tweaking and writing OXPs - and eventually maybe even tampering with the Vanilla game code if you get to be good enough!
Sneak a peek at How to tweak OXZ's ... and see where it leads you! One of Aegidian/Giles's desires was to use Oolite to teach people how to code.
Understanding what really goes on
So I'm on my way to Erlaza, I decide to fly in along the main route and see what I can pick up along the way and the first thing I meet is a Boa with four escorts. Now it strikes me that if I join them I might see a bit more action but at the same time I wouldn't have to deal with it entirely on my own. Sure enough, within minutes there's a Fer-de-Lance shooting at us. Erm... did I say us? I'm a Python in formation with a Boa and four escourts and he's completely ignoring the others and has locked on to me. What's more, when I turn to deal with him, what to the others do? They go on their own sweet way leaving me to deal with him on my own. B*****ds! The Fer-de-Lance suffered the consequences and having picked up the ton of luxuries that he left me in his will, I'm following the Boa back to the space station. I'm wondering whether to rejoin them and give them an energy bomb as a token of thanks for their assistance when one of the escorts breaks formation and heads off at 11 o'clock. The others soon follow and I realise that they are under attack from a Python and a couple of smaller ships. The next thing I know, the Boa is on the radio asking for help! Yeah. Right. Count the fingers mate. ("AndySlater", 2006)
Spoiler (why what happened made sense and how the game programmes it)---->
Pirates use a "scanForNearestMerchantmen" (traders, miners and the player), they then use a "Oddsgood" / "Oddseven" / "Oddsbad" to decide if they attack and who. The pirates are "smart" enough to "know" that a ship with the role "escort" will defend its mother. To put it in plain English:- That fer-de-lance considered attacking all the ships it saw, but it knew that if it attacked the convoy it would have to deal with the the Traders escorts as well as the Trader if it attacked him. When it scanned you, it knew you were without escorts and so chose to attack the easier prey (ie you!).
If he had a few wing-men, he might have decided that his side was well enough equipped to make attacking the convoy (bigger risk but better rewards) worth it! (done with random numbers against an Odds risk)
If he had missed his intended target (you!) and hit the Trader, then the trader would have responded. He consults his own AI to decide how to respond, but having cowardly TraderAI he might have decided to run for the planet rather than returning fire or he might have returned fire on the fer-de-lance. The Escorts would probably have attacked the fer-de-lance (as their AI is pretty brave - Someone attacking our mothership - Get Him, even if Mum runs away!). Had there been some cargo pods lying about the Fer-de-lance would probably not have attacked at all and scooped the free cargo, rather than risk a fight (as his AI also includes a scanForLoot, found = setstate to scooploot). Equally had his hold been full, he would have gone to the Station to sell his ill-gotten gains, as he "knows" that there is no point blowing up a trader if you can't scoop his stuff! (done in code by a simple HOLD_FULL = switchAI to route1traderAI)
Obviously it's Giles's code that does all this, but us players can write AIs that the code will follow. You then assign this to a new ship you have built to make it behave as you want. If you want your ship to be a typical pirate / policeship / miner / escort etc, then you just give it one of the native AIs. Fiddling with Oolite is almost as much fun as playing it!
By LittleBear in Any benefits in flying near/with other ships? (2006) Note that this is all in "Legacy Scripting".
- See The Embrace of the Dark Side in the Applied Theology section on the page for the Church of Giles the Creator
- What "can" be changed without re-compiling? (2010-date) - for what oxp's cannot do see the 2021-2 posts
- if (player.ship.dockedStation.isMainStation) - major discussion on a line of code (2012)
- Category:Oolite scripting
- Property list - a good place to start - try tweaking the description.plist in Famous Planets and see if it works when you look at the F7 screen!