Adding stuff outside shipping lanes...hacking existing OXPs
Posted: Tue Jun 01, 2010 12:31 am
...So instead of making something from scratch, I'm hacking existing OXPs.
In particular, these:
DeepSpacePirates 1.2.4.oxp
Dredgers 2.4.2.oxp
Pirate_coves 1.2.1.oxp
Rock_Hermit_Locator1.3.1.oxp
total_patrol.oxp
DeepSpacePirates 1.2.4.oxp was almost just what I wanted, except it was a little TOO much. I was often encountering 5+ ships at a time and getting blasted. I'm toning that way down and making it spit out asteroids instead more often.
Changes made so far to Scripts\deep_space_pirates.js:
// if (!missionVariables.deep_space_pirate_kills) missionVariables.deep_space_pirate_kills = 1; // 0 would be a problem with Math.log()
if (missionVariables.deep_space_pirate_kills < 1 ) missionVariables.deep_space_pirate_kills = 1; // 0 would be a problem with Math.log()
// Simplfy this to just a few...growing much slower -- WAS:
// var maxShipNumber = Math.log(++this.addition) + Math.log(missionVariables.deep_space_pirate_kills) / 2 + 5.5 - System.government / 2
// now:
var maxShipNumber = Math.log(missionVariables.deep_space_pirate_kills) / 2 + 5.5 - System.government / 2
if (pirates.bounty === 0 && Math.random() > 0.1) pirates.bounty = Math.round(Math.random() * 450) + 50; // was * 40) + 10;
(I changed that because I'm pretty sure it was making pirates that were only worth 1-5 Credits bounty. My change should make them 5-50 Credits.)
{if (pirates.cargoCapacity > 15 && Math.random() < 0.25) pirates.bounty = 0} // reduce 0-bounty odds from 33% to 25%
if(pirates.bounty === 0 || Math.random()<0.25) // Raise odds of cargo from 10% to 25% for "Clean" pirates
Towards the bottom of the file:
// if (Math.random() > 0.03)
// {
forwardPosition = player.ship.position.add(orientation.vectorForward().multiply(90E3));
system.legacy_addShipsWithinRadius("asteroid", 1, "abs", forwardPosition, 10E3);
// system.legacy_addShipsWithinRadius("asteroid", this.biasedRandom(6), "abs", forwardPosition, 10E3);
// }
// else
// {
// forwardPosition = player.ship.position.add(orientation.vectorForward().multiply(200E3));
// system.legacy_addShipsWithinRadius("DSProckhermit", 1, "abs", forwardPosition, 10E3);
// system.legacy_addShipsWithinRadius("asteroid", 8, "abs", forwardPosition, 10E3);
// }
// NO EXTRA ROCK HERMITS AND ASTEROID FIELDS!
While I wanted more asteroids, I wanted them spread out at random and removed if unvisited after awhile. Extra Rock Hermits is just too much -- I was seeing systems with >4 Rock Hermits possibly due to this.
A bigger problem I'm having with DeepSpacePirates is once I get very far away from the shipping lane (like opposite side of the planet), the odds of seeing random deep space pirates drops to nearly nil even in Anarchy systems. I want to raise those odds but not so high as to make even corporate states crawling with pirates off the shipping lane.
Dredgers 2.4.2.oxp I'd like to change the reward for salvage ships to be about 1-5% of their cost/value and no big bonus reward for their cargo. ...But I haven't figured out the variable name to use for ship cost.
Pirate_coves 1.2.1.oxp I'm hoping to add 1 in systems with "low" governments (anarchies, multi-gov, feudal?)...by adding this to the Config\script.plist file:
conditions = ("shipsFound_number greaterthan 9" or "system.government lessthan 4");
Should/Will that work?
I'd like for Pirate Coves to have variable defenders, with more defenders typically in anarchy systems...though I'm not sure how to do that yet since Config\shipdata.plist seems to define defenders as a real value:
<key>max_defense_ships</key>
<integer>9</integer>
Rock_Hermit_Locator1.3.1.oxp I'm using that to add more asteroids hither and yon, but currently it's unchanged. I'm wondering if I could modify it somehow to give variable asteroid numbers around the Rock Hermit (maybe 7-20?).
total_patrol.oxp I changed so that Vipers have a much lower chance to go patrolling to the sun, just enough you might see one on rare occasion. Under Ais\totalPatrolAI.plist I changed to:
"DECISION_PLANET" = {
ENTER = ("rollD: 7");
"ROLL_1" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_2" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_3" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_4" = (dockEscorts, setTargetToSystemStation, "setAITo: dockingAI.plist");
"ROLL_5" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_6" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_7" = ("setStateTo: HEAD_FOR_SUN");
};
"DECISION_SUN" = {
ENTER = ("rollD: 2");
"ROLL_1" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = ("setStateTo: HEAD_FOR_WITCHPOINT");
};
"DECISION_WITCHPOINT" = {
ENTER = ("rollD: 5");
"ROLL_1" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_3" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_4" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_5" = ("setStateTo: HEAD_FOR_SUN");
};
This reduces the odds of a Viper heading towards the Sun to about 1/2 what it was before using the original Total Patrol.
That's all I've got so far...and looking for help on the problems mentioned here.
In particular, these:
DeepSpacePirates 1.2.4.oxp
Dredgers 2.4.2.oxp
Pirate_coves 1.2.1.oxp
Rock_Hermit_Locator1.3.1.oxp
total_patrol.oxp
DeepSpacePirates 1.2.4.oxp was almost just what I wanted, except it was a little TOO much. I was often encountering 5+ ships at a time and getting blasted. I'm toning that way down and making it spit out asteroids instead more often.
Changes made so far to Scripts\deep_space_pirates.js:
// if (!missionVariables.deep_space_pirate_kills) missionVariables.deep_space_pirate_kills = 1; // 0 would be a problem with Math.log()
if (missionVariables.deep_space_pirate_kills < 1 ) missionVariables.deep_space_pirate_kills = 1; // 0 would be a problem with Math.log()
// Simplfy this to just a few...growing much slower -- WAS:
// var maxShipNumber = Math.log(++this.addition) + Math.log(missionVariables.deep_space_pirate_kills) / 2 + 5.5 - System.government / 2
// now:
var maxShipNumber = Math.log(missionVariables.deep_space_pirate_kills) / 2 + 5.5 - System.government / 2
if (pirates.bounty === 0 && Math.random() > 0.1) pirates.bounty = Math.round(Math.random() * 450) + 50; // was * 40) + 10;
(I changed that because I'm pretty sure it was making pirates that were only worth 1-5 Credits bounty. My change should make them 5-50 Credits.)
{if (pirates.cargoCapacity > 15 && Math.random() < 0.25) pirates.bounty = 0} // reduce 0-bounty odds from 33% to 25%
if(pirates.bounty === 0 || Math.random()<0.25) // Raise odds of cargo from 10% to 25% for "Clean" pirates
Towards the bottom of the file:
// if (Math.random() > 0.03)
// {
forwardPosition = player.ship.position.add(orientation.vectorForward().multiply(90E3));
system.legacy_addShipsWithinRadius("asteroid", 1, "abs", forwardPosition, 10E3);
// system.legacy_addShipsWithinRadius("asteroid", this.biasedRandom(6), "abs", forwardPosition, 10E3);
// }
// else
// {
// forwardPosition = player.ship.position.add(orientation.vectorForward().multiply(200E3));
// system.legacy_addShipsWithinRadius("DSProckhermit", 1, "abs", forwardPosition, 10E3);
// system.legacy_addShipsWithinRadius("asteroid", 8, "abs", forwardPosition, 10E3);
// }
// NO EXTRA ROCK HERMITS AND ASTEROID FIELDS!
While I wanted more asteroids, I wanted them spread out at random and removed if unvisited after awhile. Extra Rock Hermits is just too much -- I was seeing systems with >4 Rock Hermits possibly due to this.
A bigger problem I'm having with DeepSpacePirates is once I get very far away from the shipping lane (like opposite side of the planet), the odds of seeing random deep space pirates drops to nearly nil even in Anarchy systems. I want to raise those odds but not so high as to make even corporate states crawling with pirates off the shipping lane.
Dredgers 2.4.2.oxp I'd like to change the reward for salvage ships to be about 1-5% of their cost/value and no big bonus reward for their cargo. ...But I haven't figured out the variable name to use for ship cost.
Pirate_coves 1.2.1.oxp I'm hoping to add 1 in systems with "low" governments (anarchies, multi-gov, feudal?)...by adding this to the Config\script.plist file:
conditions = ("shipsFound_number greaterthan 9" or "system.government lessthan 4");
Should/Will that work?
I'd like for Pirate Coves to have variable defenders, with more defenders typically in anarchy systems...though I'm not sure how to do that yet since Config\shipdata.plist seems to define defenders as a real value:
<key>max_defense_ships</key>
<integer>9</integer>
Rock_Hermit_Locator1.3.1.oxp I'm using that to add more asteroids hither and yon, but currently it's unchanged. I'm wondering if I could modify it somehow to give variable asteroid numbers around the Rock Hermit (maybe 7-20?).
total_patrol.oxp I changed so that Vipers have a much lower chance to go patrolling to the sun, just enough you might see one on rare occasion. Under Ais\totalPatrolAI.plist I changed to:
"DECISION_PLANET" = {
ENTER = ("rollD: 7");
"ROLL_1" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_2" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_3" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_4" = (dockEscorts, setTargetToSystemStation, "setAITo: dockingAI.plist");
"ROLL_5" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_6" = ("setStateTo: HEAD_FOR_WITCHPOINT");
"ROLL_7" = ("setStateTo: HEAD_FOR_SUN");
};
"DECISION_SUN" = {
ENTER = ("rollD: 2");
"ROLL_1" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = ("setStateTo: HEAD_FOR_WITCHPOINT");
};
"DECISION_WITCHPOINT" = {
ENTER = ("rollD: 5");
"ROLL_1" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_2" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_3" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_4" = ("setStateTo: HEAD_FOR_PLANET");
"ROLL_5" = ("setStateTo: HEAD_FOR_SUN");
};
This reduces the odds of a Viper heading towards the Sun to about 1/2 what it was before using the original Total Patrol.
That's all I've got so far...and looking for help on the problems mentioned here.