Scripters cove

Discussion and information relevant to creating special missions, new ships, skins etc.

Moderators: another_commander, winston

User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

As discussed here https://bb.oolite.space/viewtopic.php?t=4779 as a scripting request could we have a "getJumpsBetweenSystems [planetnumber1] [planetnumber2]".

I'd like to use it in Random Hits to get a variable to display how many jumps it takes to get to the a System where a mission is being offered from the player's current location. Would be a handy feature for a lot of OXPs existing and future. (eg UPS, Navy, Local Hero).
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

LittleBear wrote:
Would be a handy feature for a lot of OXPs existing and future. (eg UPS, Navy, Local Hero).
And for the normal cargo contracts which are in days and hours.

Just as an aside has anyone ever explained the meaning of days hours and light years. It's rational for us earthlings, but across the 8 galaxies, it has to be some sort of standard measure of something.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

@TGHC - bit of a cop out but lots of SF use the concept of Standard Earth Days and Standard Earth Hours etc, irrespective of which planet they're on or race/ET they're dealing with. Star Trek used to fall down on this all the time: "You have 3 hours to comply or you will be destroyed" - Universal Translator translation - "Erm, is that three of my hours, or is that a literal translation of your idea of three hours in which case I've got 17 minutes, oh and does that take into account the time dilation effect caused by us travelling at 0.6c?"
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Frame
---- E L I T E ----
---- E L I T E ----
Posts: 1477
Joined: Fri Mar 30, 2007 8:32 am
Location: Witchspace

Post by Frame »

TGHC wrote:
LittleBear wrote:
Would be a handy feature for a lot of OXPs existing and future. (eg UPS, Navy, Local Hero).
And for the normal cargo contracts which are in days and hours.

Just as an aside has anyone ever explained the meaning of days hours and light years. It's rational for us earthlings, but across the 8 galaxies, it has to be some sort of standard measure of something.
There allready is at least for the Distance.

Parsec.

One parsec is approximately 3.262 light-years. however the way you determine this would be Universal, since calculating parsecs use arcseconds, which should be the same no matter where you are in the galaxy.

an arcsecond is equal to one sixtieth (1/60) of one degree.. translating this to whatever mearsurement for degree an alien species would have, should be easy..

Mathimatics should be universal, so it would not be surprising if an alien species would also use the 360 degree system..

For measuring time.. i think the ships clock us using whatever measurement us suiteble for the species aboard it..
Bounty Scanner
Number 935
User avatar
DaddyHoggy
Intergalactic Spam Assassin
Intergalactic Spam Assassin
Posts: 8501
Joined: Tue Dec 05, 2006 9:43 pm
Location: Newbury, UK
Contact:

Post by DaddyHoggy »

@Frame - there's no reason why an alien species would divide a circle into 360degrees. However, they would, mathematically understand the ratio between the radius or diameter of a circle and its circumference. Therefore I would suggest the radian would be a universal measure (there being (for the non-mathematicians out there) 2 x PI radians in a circle, PI of course being very approximately 3.14159, thus making a radian very approximately 57 earthling degrees)
Selezen wrote:
Apparently I was having a DaddyHoggy moment.
Oolite Life is now revealed here
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Frame wrote:
Mathematics should be universal, so it would not be surprising if an alien species would also use the 360 degree system..
Not likely. e.g. in France they use a 400 degree system. One could also choose for a 100 degree system. And it could be based on a decimal system for creatures with 10 fingers or dodecimal for creatures with 12 fingers. If one is accustomed to it neighter has advantages over the other. Only octal or haxadecimal has some advantages. And what kind of system would a race of centipedes choose?

The only more or less universal degree system would be based on Pi. This is the amount of diameters that fit in the circle. That's universal and is the system we use in the Netherlands on collage. But even Pi itself can be expressed binary, octal, hexadecimal etc.
User avatar
Amen Brick
Deadly
Deadly
Posts: 187
Joined: Sat May 10, 2008 5:22 pm
Location: Bolton!

Post by Amen Brick »

Agreed, the 360 degree system, iirc came from the egyptians with one degree equalling a non-holiday day. So it could all depend on the time it takes their world to do an orbit.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Post by Eric Walch »

Amen Brick wrote:
Agreed, the 360 degree system, iirc came from the egyptians ....
360 working days. That's new to me. French Napoleon liked round numbers and changed it to 400 degrees. But he (or actually his administration) also did work on estimating the earths circumference. All over Europe we had all kinds of yards, feet's etc. He introduced a new universal length, based on the earths circumference. At that time it was measured at 40 000 km. (the meter was defined as 1/40 000 000 of this circumference)
Now the circumference is measured to a slightly other value but it all connects with each other.
User avatar
JohnnyBoy
---- E L I T E ----
---- E L I T E ----
Posts: 490
Joined: Mon May 05, 2008 9:41 pm
Location: West Sussex, UK (rich agricultural)

Post by JohnnyBoy »

I think it's the Babylonians who get the blame for measurement systems based around the number '60'.... http://en.wikipedia.org/wiki/Babylonians#Mathematics
"That's no vicious Treeoid. That's my wife."
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

Hi,

I've programmed a script which places planets on different orbits around the sun. It iterates over the system.planets list. Is there a way to see what planets were added by me? Actually the script could position planets of other scripts in own orbits as well, but it should skip moons. Don't you think it would be a good idea to add a list 'satellites' to the sun and each planet?
User avatar
Lestradae
---- E L I T E ----
---- E L I T E ----
Posts: 3095
Joined: Tue Apr 17, 2007 10:30 pm
Location: Vienna, Austria

...

Post by Lestradae »

I've programmed a script which places planets on different orbits around the sun.
:shock:

Did you create complete solar systems? Are your planets in all systems? How many per system are there? Are the planets in the ecliptic or not? Did you texture them with the system redux textures or are they untextured?

Sorry for the thread hijacking :oops: ... this is a wet dream of mine coming true ... :D
User avatar
CaptKev
---- E L I T E ----
---- E L I T E ----
Posts: 519
Joined: Fri Jan 26, 2007 3:21 pm
Location: Shropshire, UK

Post by CaptKev »

Wow! :shock: :shock:

How have you managed to do this using the planetinfo.plist?
Download Fighter HUD, Stingray and System Redux from the EliteWiki
Ebi
Competent
Competent
Posts: 40
Joined: Fri Jun 27, 2008 9:45 pm

Post by Ebi »

I use the system name to create magic numbers:

sum p^i * (a-'A'), p is a prime > 26.

Like System Redux I can use the lower bits to decide how many planets the system should have, at most 7 are defined in the planetinfo (at least 32 should be possible). I put those planets on circles in the plane sun, planet, witchpoint buoy. I use some other magic numbers for different primes to decide how long the years of those planets are. I've defined the year of the main planet as 300 days and devide the planets' years by that number to get their radii. Now I calculate clock.days modulo days per year and know their angle.

I've called the OXP Orbits. I use an own planetinfo without textures (to avoid slowdowns), but that's not mandatory. It can coexist with System Redux and Farsun.

It looks into the planets list of object system. I hope, it will not find System Redux's moons there.
User avatar
Amen Brick
Deadly
Deadly
Posts: 187
Joined: Sat May 10, 2008 5:22 pm
Location: Bolton!

Post by Amen Brick »

I want to write a script (starting simplish) that says when you visit planet/station x you are given an option to join organization A or B if you have x criminal status. If you choose yes, then you gain enmity of organization B or A and they will attack you.

I imagine it will follow (in the correct code):

For script

If playeratplanet x and bounty>1 offer choiceorgA (or orgB)
If choiceanswer = yes then enmity B = 1 (or enmity A = 1)

If enmity A/B=1 then set role enemyorgA/B

set action script for meeting enemyorgb (or Org A).

That about right? Ignore the syntax, I can learn that.

This would be for player involvement. For NPC battles, i could just cannabalize the Black Monk/Debtor Witchspace encounters
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2866
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Post by LittleBear »

Feel free to canabilse. But these are OXPs I wrote a long time ago. Random Hits is better written (although its still messy) so canabilse that one. All my OXPs to date though were in legacy. Not being a proper programmer I muddled though with things that work. Java Script would have been much better. But its a bit like the old Irish Joke: "How do you get to Dublin? A: Well I wouldn't start from here." I'd got most of the code for Random Hits done in legacy before I understood Java (at all - as opposed to my current empirical understanding helped a lot by others who properly understand it), and just hadn't the heart to re-write it all! If you're starting an OXP from scratch, poke about in legacy scripts and pinch anything you want, but you'd probably find it easier to do it in Java. If your starting a 'project' I'd start it in Java, rather than as I did with Random Hits doing it in legacy and then bolting on some Java. The OXP seems to work fine and do what its meant to, but it would have been a load easier if I'd used Java from the start! :wink:
OXPS : The Assassins Guild, Asteroid Storm, The Bank of the Black Monks, Random Hits, The Galactic Almanac, Renegade Pirates can be downloaded from the Elite Wiki here.
Post Reply