Page 103 of 115

Re: Scripters cove

Posted: Fri Apr 29, 2022 2:46 pm
by szaumix
another_commander wrote: Fri Apr 29, 2022 2:41 pm
If you must make modifications no matter what, the proper way to do it is to list installed oxps in the Expansion Manager, select the one you want and press "x" to extract it to the AddOns folder. It will be extracted with the ".off" extension. Change that to ".oxp" and you are good to go
Fabulous advice, thank you.

[SOLVED] (I'm retarded)
[EDIT: deleted]

So the only thing that helped was landing at a Cori? I am still figuring out when and where the game caches and computes from files. Anyway thanks for the answers.

Re: Scripters cove

Posted: Fri Apr 29, 2022 3:06 pm
by Cmdr Wyvern
"D*CKS*"...

Isn't that the height of maturity!

*facepalm heard around the chart*

Re: Scripters cove

Posted: Fri Apr 29, 2022 3:16 pm
by szaumix
Haha. Ever change a line of code and then forget what and where you changed it? Maddening. I've been using that same memory-word since GWBasic. It's immature but at least I never miss it. I highly recommend!

Re: Scripters cove

Posted: Fri Apr 29, 2022 3:19 pm
by Cmdr Wyvern
szaum-ix wrote: Fri Apr 29, 2022 3:16 pm
Haha. Ever change a line of code and then forget what and where you changed it? Maddening. I've been using that same memory-word since GWBasic. It's immature but at least I never miss it. I highly recommend!
Well as long as we're going back to high school, a cargo contract for ya.

"Butts 100TC Time 24 hours"
Seriously gotta haul ass to make that dosh! :twisted: :lol:

Re: Scripters cove

Posted: Fri Apr 29, 2022 6:45 pm
by Nite Owl
szaum-ix

Glad you got it working but there is a slight bit that may still not be right. You typed that you were placing the descriptions.plist in your AddOns folder. Are you placing it directly into that folder? While that may work it should ideally be in a sub-folder of AddOns named Config (...\Oolite\AddOns\Config). This AddOns\Config folder would hold all of the altered files that you might produce from the core files in the game's original Config folder structure (...\Oolite\oolite.app\Resources\Config).

If you do plan on doing a lot of TWEAKING then the advice from another_commander about editing your .GNUstepDefaults file to add the "always-flush-cache" = yes; option is invaluable. Your game loading time will increase but not having to remember to hold down a shift key after every major or minor code change is well worth it.

Marking up code that you have changed is important. Do what works best for you taking the following as only a suggestion.

Code: Select all

[YOUR NEW CODE] \\ TWEAK was - [ORIGINAL CODE]
\\ marks anything that follows on that line as a comment that will not be read as valid code in both .plist files and JavaScript files. The word TWEAK makes each change easily searchable.

Re: Scripters cove

Posted: Fri Apr 29, 2022 7:54 pm
by szaumix
[deleted]

I am pleased to hear that filepath synchronization matters so thanks for that, and roger that re: cache flushing.

Re: Scripters cove

Posted: Fri Apr 29, 2022 9:59 pm
by Cody
Nite Owl wrote: Fri Apr 29, 2022 6:45 pm
While that may work it should ideally be in a sub-folder of AddOns named Config (...\Oolite\AddOns\Config).
Very useful, that Config folder!

Re: Scripters cove

Posted: Sat Apr 30, 2022 2:43 am
by phkb
szaum-ix wrote: Fri Apr 29, 2022 2:46 pm
So the only thing that helped was landing at a Cori? I am still figuring out when and where the game caches and computes from files.
All contracts are prebuild when you enter a new system. If you changed the descriptions.plist and then loaded a game and looked at the available contracts, none of them would have changed. Flying to a new system makes then refresh.

Re: Scripters cove

Posted: Sun May 08, 2022 7:15 am
by szaumix
QUESTION:
Would it be theoretically possible to make commodities in a given market for sale only? Always selling to you but never buying from you?
Basically a reverse Hoopy's?
EDIT: I realize it's probably possible. I was hoping for a plist hack advise rather than having to crunch the js. How complicated would this be?

Re: Scripters cove

Posted: Mon May 09, 2022 3:29 am
by phkb
szaumix wrote: Sun May 08, 2022 7:15 am
Would it be theoretically possible to make commodities in a given market for sale only?
Possible, yes.
szaumix wrote: Sun May 08, 2022 7:15 am
was hoping for a plist hack advise rather than having to crunch the js. How complicated would this be?
It's a JS solution though. No easy way to disable player selling commodities via plists. I think the simplest way would be to use playerSoldCargo worldscript event and essentially reverse whatever cargo sales are made (ie returning cargo to the player, removing credits).

Re: Scripters cove

Posted: Fri Jun 03, 2022 6:04 am
by szaumix
Question to those more knowledgeable than myself:

I am toying with accuracy values with some success. I've checked the wiki on shipdata.plist and can't tell if there is a way to make values equal or greater than, equal or worse than. Is this a property list function?

Re: Scripters cove

Posted: Sat Jun 04, 2022 12:23 am
by montana05
szaumix wrote: Fri Jun 03, 2022 6:04 am
Question to those more knowledgeable than myself:

I am toying with accuracy values with some success. I've checked the wiki on shipdata.plist and can't tell if there is a way to make values equal or greater than, equal or worse than. Is this a property list function?
You can use accuracy in js: https://wiki.alioth.net/index.php/Oolit ... p#accuracy

If you use a random number with a minimum and a maximum function like:

Code: Select all

this.$getRndInteger = function(min, max)
{
	return (Math.floor(Math.random() * (max - min + 1) ) + min);
};
you should get a result pretty close to what you desire.

Re: Scripters cove

Posted: Sat Jun 04, 2022 12:48 am
by Old Murgh
I also have a question for those more knowledgeable than myself:

In trying to update the Missionaries.oxp, I've come to the suspicion that the legacy script script.plist is rendered nonfunctional in the current version of the game. I've been testing and using conditions set in a planetinfo.plist which works great for the system I'm doing the spawn tests in. But I was relying on the original oxp's ability to spawn the role missionary across all systems, and I can't see any sign on the logs that it's working. I suspect the only reason these ships appeared was because of their dual role as trader.. There is always the chance that some little error somewhere is the actual problem, but I would love to solve it with a javascript populator.

One example I have at hand is the hOopy populator, which it would be nice to simply modify to my needs.

Code: Select all

"
//add casino to system
this.systemWillPopulate = function (){
	// add in high tech level systems, but not in comunist systems. But, always in systems famous for their casinos.
	if (system.techLevel >= 10 && system.scrambledPseudoRandomNumber() > 0.55 && system.government != 4 || system.info.description.indexOf('hoopy casinos') > -1) {
		//no main station, no casinos.
		if (system.mainStation) {
			var coords = system.mainStation.position.subtract(system.mainStation.position.direction().multiply(50000));
			system.setPopulator("hoopy_casino", {
				callback: function(pos) {			
					system.addShips('casinoship', 1, pos);
				}.bind(this),
				location: "COORDINATES",
				coordinates: coords
			})
		}
	}
}
My needs are much simpler, just to establish a 90% chance that one or two ship with role missionary are spawned somewhere in the main lane. How much surgery would that require?

Re: Scripters cove

Posted: Sat Jun 04, 2022 3:45 am
by phkb
Old Murgh wrote: Sat Jun 04, 2022 12:48 am
I also have a question for those more knowledgeable than myself:
Taking your sample code:

Code: Select all

this.systemWillPopulate = function (){
	// you would need to define what rules govern which systems your ships will spawn in.
	if (system.techLevel >= 10 && system.scrambledPseudoRandomNumber() > 0.55 && system.government != 4) {
		system.setPopulator("missionaries_ships", {
			callback: function(pos) {			
				system.addShips('role of desired ship', 1, pos); // use the missionaries ship role here
			}.bind(this),
			location: "LANE_WP",
			locationSeed: 0 // 0 = completely random position on the lane, otherwise use a specific seed number to have them in the same position each time
		});
	}
}
The only things you'd need to define is the rules which cover what systems to put your missionaries in (if there are any), and what the role will be of the ships.

Re: Scripters cove

Posted: Sat Jun 04, 2022 7:00 am
by Old Murgh
Thank you :D
phkb wrote: Sat Jun 04, 2022 3:45 am
The only things you'd need to define is the rules which cover what systems to put your missionaries in (if there are any), and what the role will be of the ships.
Well, for starters I wanted to have the role as common as trader or pirate, galaxy-wide (without "stealing" from the trader quota). They might not last long in an anarchy but they are crazy enough to try their luck anywhere. –I don't suppose there is any common seed word that justifies an increase of spiritual activity. For now, if the system description contains the word "is", then I'd like there to be a 90% chance of spawning a* missionary.

*Does asking the engine to randomly choose between 0, 1 or 2 spawns factor into this?