Oolite Bulletins

For information and discussion about Oolite.
It is currently Mon Jul 23, 2018 9:34 am

All times are UTC




Post new topic  Reply to topic  [ 1419 posts ]  Go to page Previous 191 92 93 94 95
Author Message
 Post subject: Re: Scripters cove
PostPosted: Sun Feb 11, 2018 4:04 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Tue Sep 07, 2010 2:23 pm
Posts: 819
Fantastic Spara! I hadn't noticed the static methods on the wiki page - don't know if I'm blind or just hadn't scrolled down far enough. With a bit of thought, it should should be able to write a script to log all the various roles for the oxp ships, and then regex that into a format that can be dropped into a spreadsheet. Then there should be something like the core list table I linked to earlier, and then I will be able to make an informed decision on what to alter.

All without the hassle of unzipping each oxp and manually looking through the plists!

I believe that this will only work with the roles used by the populator. Ships often had their own unique role for use in missions and such, and added by scripts, would still appear with the same frequency regardless of any tinkering (unless I delve in to all oxps to check spawning scripts, but that seems like even more work than I can be bothered with at this moment in time.)

And once I do know what I want to alter, it might be that Redspear's find and replace trick would be a quick and easy hack, depending on the outcome of the various lists.

I knew it was worth asking here before starting a long and tedious process!

The next stage once I'm happy with all the ships would be to look at the stations. The problem with a perfectionist nature is that I want everything to be set up before I start playing the game, and the problem with real life is that it takes up time. I suspect I'll actually start my new commander at some point in the spring/summer. In the meantime I'll have to be content with the dark side of editing and tweaking...


Top
   
 Post subject: Re: Scripters cove
PostPosted: Sun Feb 11, 2018 4:11 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Wed Aug 15, 2012 4:19 am
Posts: 2528
Location: Finland
Quote:
...The problem with a perfectionist nature is that I want everything to be set up before I start playing the game...
And then a new version of the game pops up or some oxp gets updated so that the game just isn't the same that it was when you started your game. And you just have to start over again. Luckily I kind of like the early game build phase, since the farthest I have ever got with Oolite is the second chart.... :lol:


Top
   
 Post subject: Re: Scripters cove
PostPosted: Fri Mar 02, 2018 3:44 pm 
Offline
---- E L I T E ----
---- E L I T E ----
User avatar

Joined: Tue Sep 07, 2010 2:23 pm
Posts: 819
Well, I'm starting simply in my task of selection and am just focusing on inserting the various complete shipsets and making sure that they all work nicely together.

What I have noticed is that some of these have their own buoys defined. Is there an obvious way to ensure that the main buoys used in a system are used from the same shipset as the main station? Or am I going to need to write a script to check and replace these myself?


Top
   
 Post subject: Re: Scripters cove
PostPosted: Thu Jul 12, 2018 11:53 am 
Offline
Deadly
Deadly
User avatar

Joined: Mon May 30, 2016 3:54 am
Posts: 146
Naive question of mine, if I compare an AI to a ship script, which commands will overwrite the other ? My ship script is slowly becoming an hybrid of both. :lol:

_________________
Trying to survive behind the controls of a Caduceus Psi XT in Alpha test :lol:


Top
   
 Post subject: Re: Scripters cove
PostPosted: Thu Jul 12, 2018 2:11 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2110
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Well, an AI and a ship script are essentially two different things. At a general level, ship script handles events that occur to the ship, and an AI deals with responses to stimuli (which can be caused by events, or from other things). Obviously that's a generalisation. I would imagine a complex AI routine could end up harnessing both scripts quite extensively (ie an event triggers an AI response, and so forth).

As for which overrides which, they shouldn't override each other at all, as they have different trigger points and default function names. You can have an AI script and a ship script attached to the same ship, and they won't necessarily conflict with each other. That being said, without seeing your code, or discussing a particular example, I may be talking nonsense here, but from what I understand, there shouldn't be any inherent conflict between the two.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
 Post subject: Re: Scripters cove
PostPosted: Thu Jul 12, 2018 2:47 pm 
Offline
Deadly
Deadly
User avatar

Joined: Mon May 30, 2016 3:54 am
Posts: 146
Thank you phkb, you helped me a little in my confusion.
However, AI and scrips using actually sometimes the same events, as you know yourself you can write an entire AI in js. So if an AI and a scrip got different approaches to, for example, "this ship get attacked", what comes first ? Simple example a js "this.ship.target = attacker" overwrites any "this.ship.reactToAIMessage("TARGET_LOST");" up to a level that even a derelict ship still attacks. You need to set "this.ship.target = null" before finally the target is lost. Currently my entire script is full of debugs, 15 min playing and 1h following up with the log. Its interesting what results you could get out of that.

Well, I guessed I just answered my own question, seems script overwrites AI, at least in this case. :oops:

_________________
Trying to survive behind the controls of a Caduceus Psi XT in Alpha test :lol:


Top
   
 Post subject: Re: Scripters cove
PostPosted: Thu Jul 12, 2018 2:59 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2110
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
If it came down to orders, I would (as you have noted yourself) put the ship script JS interactions after the AI ones. But without deep-diving into the code, I wouldn't be able to say that is always going to be the answer in every case. But it's a reasonable rule-of-thumb to go on with.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
 Post subject: Re: Scripters cove
PostPosted: Wed Jul 18, 2018 9:28 pm 
Offline
Competent
Competent
User avatar

Joined: Wed Jun 09, 2010 3:56 pm
Posts: 41
It used to be possible to define arbitrary properties on the SystemInfo object and have them saved in the planetinfo_overrides section of the saved game file... is this no longer the case?

I can still define properties on SystemInfo, but they aren't being saved... :?


Top
   
 Post subject: Re: Scripters cove
PostPosted: Wed Jul 18, 2018 10:01 pm 
Offline
Commodore
Commodore
User avatar

Joined: Tue Jan 21, 2014 10:37 pm
Posts: 2110
Location: [p]laying [h]ard and [k]icking [b]utt somewhere in G7...
Quote:
It used to be possible to define arbitrary properties on the SystemInfo object and have them saved in the planetinfo_overrides section of the saved game file
You can update most of the defined properties of a system (eg population or productivity), and these will be saved automatically, but arbitrary ones...hmm not sure about that one.

_________________
My OXP's
YouTube: Oolite Teaser Trailer


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 1419 posts ]  Go to page Previous 191 92 93 94 95

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited