Tinkerer's Workshop - OXP tweaking for fun and profit!
Moderators: winston, another_commander
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Love it! Look forward to hearing some female chatter from traffic control!
Wonder if that same kind of gibberish could be applied to the Communications OXP, so that when someone sends a message you hear the garble as a kind of audial cue?
Wonder if that same kind of gibberish could be applied to the Communications OXP, so that when someone sends a message you hear the garble as a kind of audial cue?
--
Pilot: Mossfoot - Ship ID: Viaticus Rex (Cobra MKII)
Rank: Competent - Status: Clean
http://www.noahchinnbooks.com/
Pilot: Mossfoot - Ship ID: Viaticus Rex (Cobra MKII)
Rank: Competent - Status: Clean
http://www.noahchinnbooks.com/
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Interesting idea! It would be a fair bit of work, but something like that ought to be within the current capabilities of Oolite.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Hopefully someone can give an idea of how much work that would be. Hopefully not too much
--
Pilot: Mossfoot - Ship ID: Viaticus Rex (Cobra MKII)
Rank: Competent - Status: Clean
http://www.noahchinnbooks.com/
Pilot: Mossfoot - Ship ID: Viaticus Rex (Cobra MKII)
Rank: Competent - Status: Clean
http://www.noahchinnbooks.com/
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Hi Everyone!
Sorry if I missed the info, but how do I write a message into log, just for debug purpose?
Thanks,
vsfc
Sorry if I missed the info, but how do I write a message into log, just for debug purpose?
Thanks,
vsfc
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
In JS, do
Actually the first parameter can be any string but using the current script name makes it easier to tell where your messages are coming from once you've added lots of them...
log(this.name,"Log message");
Actually the first parameter can be any string but using the current script name makes it easier to tell where your messages are coming from once you've added lots of them...
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Hi,
I updated my code to check and not to log when fuel is bought. At the moment more adjustment needed around selling equipment to adhere to all different variations from SELL, REFUND, _REMOVAL, etc. Will be nice if we could stick to some standard??? There are other cases need to be handled, which I do not want to be logged like use of saving anywhere OXP.
Cheers,
vsfc
I updated my code to check and not to log when fuel is bought. At the moment more adjustment needed around selling equipment to adhere to all different variations from SELL, REFUND, _REMOVAL, etc. Will be nice if we could stick to some standard??? There are other cases need to be handled, which I do not want to be logged like use of saving anywhere OXP.
Code: Select all
this.playerBoughtEquipment = function(equip)
{
if(!equip.match("EQ_FUEL"))
{
this.clockString = clock.days + ":" + clock.hoursComponent + ":" + clock.minutesComponent + ":" + clock.secondsComponent;
this.dateArray.push(this.clockString);
var equipInfo = EquipmentInfo.infoForKey(equip);
log(this.name, equip);
if(equip.match("_REMOVAL"))
{
this.textArray.push(equipInfo.name + " sold at " + system.name + " for " + (player.credits - this.oldCredits) + "cr");
}
else
{
this.textArray.push(equipInfo.name + " purchased at " + system.name + " for " + (this.oldCredits - player.credits) + "cr");
}
this.trimArrays();
}
this.oldCredits = player.credits;
}
vsfc
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
In response to a recent question of Cody's, I was finally motivated to patch RandomShipNames v1.4 to work with the expanded list of ship roles in 1.80.
According to cim, a more flexible approach is possible, but that will have to wait until Commander McLane has the opportunity to upgrade RSN. In the meantime, this is what needs to be done so that you don't see just "Krait" or "Mamba", for example, when you ID certain ships.
The relevant section of
The full listing of this function is as follows:
Line 817 needs to be changed from:
to:
Line 823 needs to be changed from:
To:
Line 829 need to be changed from:
to:
And line 882 needs to be changed from:
to:
For those who'd rather just have the patch than edit the OXP themselves, you can download a copy of the patched
Whichever method you use, don't forget to flush the cache by shift-starting Oolite when you're done!
According to cim, a more flexible approach is possible, but that will have to wait until Commander McLane has the opportunity to upgrade RSN. In the meantime, this is what needs to be done so that you don't see just "Krait" or "Mamba", for example, when you ID certain ships.
The relevant section of
randomshipnames.js
is the this.shipSpawned = function(ship)
function, which can be found at lines 803-886.The full listing of this function is as follows:
Code: Select all
this.shipSpawned = function(ship)
{
// certain entities are excluded
if(ship.isCargo || ship.isBoulder || ship.isThargoid || ship.scanClass === "CLASS_STATION" || ship.isWeapon || ship.isPlayer || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "no")) return;
if(ship.primaryRole === "random_hits_patrol" || ship.hasRole("vector") || ship.hasRole("dredgers") || ship.primaryRole === "rescue_freighter" || ship.hasRole("vortex_NPC") || ship.hasRole("vortex_maelstrom_NPC") || ship.hasRole("aquatics_hammerHead") || ship.hasRole("liners_emerald") || ship.hasRole("liners_tigershark") || ship.hasRole("liners_smivs-liner") || ship.hasRole("TCAT_raptor") || ship.hasRole("generationship") || ship.hasRole("random_hits_markguard_weak") || ship.hasRole("random_hits_markguard_medium") || ship.hasRole("random_hits_markguard_strong") || ship.hasRole("stellarSerpent")) return;
// ships which already have a separator which indicates an individual name are excluded
if(ship.displayName.substr(0, 4) === "RRS " || ship.displayName.indexOf(":") !== -1 || ship.displayName.indexOf("~") !== -1 || ship.displayName.indexOf(" - ") !== -1) return;
// the renegades.oxp ships and some assassins.oxp ships get a generic role together with their custom role
if(ship.primaryRole === "hardpirate" || ship.primaryRole === "unlocked3" || ship.primaryRole === "unlocked8" || ship.primaryRole === "unlocked9" || ship.primaryRole === "unlocked10")
{
ship.primaryRole = "pirate";
}
// only ordinary pirates, hunters, traders, shuttles, scavengers, miners, police, military (and their escorts) and rock hermits are affected; this should exclude most special OXP ships
// pirates and their escorts
if(ship.isPirate || (ship.owner && ship.owner.isPirate) || ship.primaryRole === "ups-slavecobra" || ship.primaryRole === "taxi_pirate" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "pirate"))
{
ship.displayName += ": " + this.$randomPirateName(ship);
return;
}
// police and military
if(ship.isPolice || ship.scanClass === "CLASS_MILITARY" || (ship.scriptInfo.randomshipnames && (ship.scriptInfo.randomshipnames === "police" || ship.scriptInfo.randomshipnames === "military")))
{
ship.displayName += ": " + this.$randomPoliceName(ship);
return;
}
// hunters, defense ships, escorts, and some special ships
if(ship.primaryRole === "hunter" || ship.primaryRole === "defense_ship" || ship.hasRole("vector_revenge") || ship.hasRole("togy-patrol") || (ship.owner && (ship.owner.isPirateVictim || ship.owner.primaryRole === "hunter" || ship.owner.hasRole("vector"))) || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "hunter"))
{
ship.displayName += ": " + this.$randomHunterName(ship);
return;
}
// rock hermits
if(ship.primaryRole === "rockhermit" || ship.primaryRole === "pirate-cove" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "rockhermit"))
{
// if a rock hermit was named previously, its name is retrieved from a list of all rock hermit names in the current galaxy
if(system.ID >= 0 && this.rockHermitList[system.ID].length > 0)
{
for(var i=0; i<rockHermitList[system.ID].length; i++)
{
// the already named rock hermits are identified by their position in the system
var savedPosition = new Vector3D(this.rockHermitList[system.ID][i][0].x, this.rockHermitList[system.ID][i][0].y, this.rockHermitList[system.ID][i][0].z);
// the following lines are only necessary for 1.77 and 1.78, because deep space
// Rock Hermits' positions fluctuate wildly due to a bug in the populator
// this is going to be fixed in 1.79
if(0 < oolite.compareVersion("1.79"))
{
var positionXY = new Vector3D(savedPosition.x, savedPosition.y, 0);
var distanceToWPLane = positionXY.magnitude();
var distanceToPSLane = savedPosition.toCoordinateSystem("psm");
distanceToPSLane.z = 0;
distanceToPSLane = distanceToPSLane.magnitude();
if(ship.position.subtract(savedPosition).magnitude() < 10 || (distanceToWPLane > 25600 && distanceToPSLane > 25600))
{
ship.displayName = this.rockHermitList[system.ID][i][1];
return;
}
}
// in 1.79, all Rock Hermit positions are permanently fixed, therefore
// also deep space hermits can be identified by their position
else
{
if(ship.position.subtract(savedPosition).magnitude() < 10)
{
ship.displayName = this.rockHermitList[system.ID][i][1];
return;
}
}
}
}
ship.displayName += ": " + this.$randomRockhermitName(ship);
// newly named rock hermits are added to the list
if(system.ID >= 0)
{
var storedName = [ship.position, ship.displayName];
this.rockHermitList[system.ID].push(storedName);
}
return;
}
// ordinary traders, scavengers, and miners
if(ship.isPirateVictim || ship.primaryRole === "scavenger" || ship.primaryRole === "miner" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "trader"))
{
ship.displayName += ": " + this.$randomTraderName(ship);
}
}
Code: Select all
if(ship.isPirate || (ship.owner && ship.owner.isPirate) || ship.primaryRole === "ups-slavecobra" || ship.primaryRole === "taxi_pirate" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "pirate"))
Code: Select all
if(ship.isPirate || (ship.owner && ship.owner.isPirate) || ship.primaryRole === "pirate" || ship.primaryRole === "pirate-light-fighter" || ship.primaryRole === "pirate-medium-fighter" || ship.primaryRole === "pirate-heavy-fighter" || ship.primaryRole === "pirate-light-freighter" || ship.primaryRole === "pirate-medium-freighter" || ship.primaryRole === "pirate-heavy-freighter" || ship.primaryRole === "pirate-interceptor" || ship.primaryRole === "pirate-aegis-raider" || ship.primaryRole === "ups-slavecobra" || ship.primaryRole === "taxi_pirate" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "pirate"))
Code: Select all
if(ship.isPolice || ship.scanClass === "CLASS_MILITARY" || (ship.scriptInfo.randomshipnames && (ship.scriptInfo.randomshipnames === "police" || ship.scriptInfo.randomshipnames === "military")))
Code: Select all
if(ship.isPolice || ship.scanClass === "CLASS_MILITARY" || ship.primaryRole === "police" || ship.primaryRole === "interceptor" || ship.primaryRole === "wingman" || (ship.scriptInfo.randomshipnames && (ship.scriptInfo.randomshipnames === "police" || ship.scriptInfo.randomshipnames === "military")))
Code: Select all
if(ship.primaryRole === "hunter" || ship.primaryRole === "defense_ship" || ship.hasRole("vector_revenge") || ship.hasRole("togy-patrol") || (ship.owner && (ship.owner.isPirateVictim || ship.owner.primaryRole === "hunter" || ship.owner.hasRole("vector"))) || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "hunter"))
Code: Select all
if(ship.primaryRole === "hunter" || ship.primaryRole === "hunter-medium" || ship.primaryRole === "hunter-heavy" || ship.primaryRole === "escort" || ship.primaryRole === "escort-medium" || ship.primaryRole === "escort-heavy" || ship.primaryRole === "defense_ship" || ship.primaryRole === "assassin-light" || ship.primaryRole === "assassin-medium" || ship.primaryRole === "assassin-heavy" || ship.hasRole("vector_revenge") || ship.hasRole("togy-patrol") || (ship.owner && (ship.owner.isPirateVictim || ship.owner.primaryRole === "hunter" || ship.owner.hasRole("vector"))) || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "hunter"))
Code: Select all
if(ship.isPirateVictim || ship.primaryRole === "scavenger" || ship.primaryRole === "miner" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "trader"))
Code: Select all
if(ship.isPirateVictim || ship.primaryRole === "scavenger" || ship.primaryRole === "miner" || ship.primaryRole === "shuttle" || ship.primaryRole === "trader" || ship.primaryRole === "trader-courier" || ship.primaryRole === "trader-smuggler" || (ship.scriptInfo.randomshipnames && ship.scriptInfo.randomshipnames === "trader"))
For those who'd rather just have the patch than edit the OXP themselves, you can download a copy of the patched
randomshipnames.js
by clicking here.Whichever method you use, don't forget to flush the cache by shift-starting Oolite when you're done!
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
-
- ---- E L I T E ----
- Posts: 288
- Joined: Sat May 31, 2014 9:02 pm
- Location: Melbourne, Australia
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Cheers!
... Am almost tempted to add a few additional words to the words lists... (but I have something else I really want to focus on)
- Neelix
... Am almost tempted to add a few additional words to the words lists... (but I have something else I really want to focus on)
- Neelix
Talaxian Enterprises: [wiki]Vacuum Pump[/wiki] [wiki]Waypoint Here[/wiki]
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
For some of them (for example lines 817, 829 and 882) it may be simpler and more elegant to use a string search (either search() or indexOf() ) rather than explicitly look for the specific new roles containing "pirate", "assassin", "escort" and "trader".
It would be more compact and would also semi future-proof things in case additional role variants on those four are introduced later.
It would be more compact and would also semi future-proof things in case additional role variants on those four are introduced later.
My OXPs via Boxspace or from my Wiki pages .
Thargoid TV
Dropbox Referral Link
Thargoid TV
Dropbox Referral Link
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Then perhaps you should just pass them along to Commander McLane for inclusion in the next version, instead..Neelix wrote:... Am almost tempted to add a few additional words to the words lists... (but I have something else I really want to focus on)
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Well, cim has already suggested a method of future-proofing, which I presume McLane will do in his next upgrade.. this is only intended as an interim fix.Thargoid wrote:For some of them (for example lines 817, 829 and 882) it may be simpler and more elegant to use a string search (either search() or indexOf() ) rather than explicitly look for the specific new roles containing "pirate", "assassin", "escort" and "trader".
It would be more compact and would also semi future-proof things in case additional role variants on those four are introduced later.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
- CaptSolo
- ---- E L I T E ----
- Posts: 909
- Joined: Wed Feb 23, 2011 10:08 pm
- Location: Preying Manta
- Contact:
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Until then, Diz, many thanks for this.Diziet Sma wrote:cim has already suggested a method of future-proofing[/url], which I presume McLane will do in his next upgrade.. this is only intended as an interim fix.
- Diziet Sma
- ---- E L I T E ----
- Posts: 6312
- Joined: Mon Apr 06, 2009 12:20 pm
- Location: Aboard the Pitviper S.E. "Blackwidow"
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
You're most welcome..
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
-
- ---- E L I T E ----
- Posts: 1248
- Joined: Sat Sep 12, 2009 11:58 pm
- Location: Essex (mainly industrial and occasionally anarchic)
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
Diziet Sma: thanks. It's a great OXP.
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Tinkerer's Workshop - OXP tweaking for fun and profit!
I have been chatting to Dizzie over at my 'OXPs and 1.80' thread and the subject of my test ship came up.
When you are testing it is sometimes helpful to be be to cover vast distances in a short time, so my Contractor test ship has Magic Fuel Tanks which re-fill after every witchjump, thus avoiding the need to waste time re-fuelling. This is accomplished with a simple script that some of you might find helpful.
Simply name this 'script.js' (without the quote marks) and place it in your AddOns folder.
N.B. This is a testing tool, and not a cheat that should be used for normal gameplay.
When you are testing it is sometimes helpful to be be to cover vast distances in a short time, so my Contractor test ship has Magic Fuel Tanks which re-fill after every witchjump, thus avoiding the need to waste time re-fuelling. This is accomplished with a simple script that some of you might find helpful.
Code: Select all
"use strict"
// Standard attributes
this.name = "fuelCheatScript.js";
this.author = "Smivs";
this.copyright = "This script is hereby placed in the public domain.";
this.version = "1.0";
this.description = "Script for 'cheat' fuel refill.";
{
this.shipExitedWitchspace = function()
{
player.ship.fuel += 7.0;
}
}
N.B. This is a testing tool, and not a cheat that should be used for normal gameplay.
Commander Smivs, the friendliest Gourd this side of Riedquat.