Scripters cove

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

Moderators: winston, another_commander

User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

I'm not missing something, am I? Is there no way to script a galactic hyperspace jump?
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Scripters cove

Post by Cody »

[dumb pilot mode]Isn't the Constrictor scripted? [/dumb pilot mode]
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

Cody wrote: Fri Jul 28, 2023 3:08 pm
Isn't the Constrictor scripted?
More of a "hand-wave" than a script. His "galactic jump" is telegraphed to the player via text, but it's not visible in game.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Scripters cove

Post by Cody »

Ahh... visible to the player? Intriguing!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Redspear
---- E L I T E ----
---- E L I T E ----
Posts: 2694
Joined: Thu Jun 20, 2013 10:22 pm
Location: On the moon Thought, orbiting the planet Ignorance.

Re: Scripters cove

Post by Redspear »

Could you spawn a wormhole, asign it with the relevant properties and then have the desired ship make a beeline for it?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

I don’t think a wormhole can be spawned directly. You can spawn a ship have have it exitSystem, but you can’t give it galactic hyperspace co-ordinates. You can give the playership galactic co-ordinates, but you can only beginhyperspaceCountdown, which just does a local jump and will fail if you don’t have a local system targeted.

It’s not a big deal, though. I’ve added the script method to do a galactic jump to my local build. I was just curious if I’d missed something obvious somewhere.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

Cody wrote: Fri Jul 28, 2023 6:25 pm
Ahh... visible to the player? Intriguing!
I should say, only visible as a piece of text the player receives when docked, not in space.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Scripters cove

Post by Switeck »

Does this mean you will be putting in a way for the player to hitchhike on another ship's Galactic Jump, such as from the otherwise dead-end system Oresrati in Galaxy Chart 8?
...saving 5000 credits (and time to find and equip) for the Galactic Hyperdrive for your ship.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

Switeck wrote: Thu Aug 03, 2023 7:15 pm
Does this mean you will be putting in a way for the player to hitchhike on another ship's Galactic Jump, such as from the otherwise dead-end system Oresrati in Galaxy Chart 8?
...saving 5000 credits (and time to find and equip) for the Galactic Hyperdrive for your ship.
Not for this update. All I’m planning on adding is a beginGalacticHyperspaceCountdown method to the playerShip.
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Scripters cove

Post by Switeck »

As for detecting a jump-attempt might be a galactic hyperdrive jump...

Code: Select all

this.playerStartedJumpCountdown = function (jump)
{
	if(jump == "galactic") {
// do something here!
	}
}
...or is the beginGalacticHyperspaceCountdown method to the playerShip...a way of auto-forcing the player's ship to do a galactic jump, perhaps unexpectedly?
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 4830
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

Switeck wrote: Sat Aug 05, 2023 4:47 pm
As for detecting a jump-attempt might be a galactic hyperdrive jump...

Code: Select all

this.playerStartedJumpCountdown = function (jump)
{
	if(jump == "galactic") {
// do something here!
	}
}
...or is the beginGalacticHyperspaceCountdown method to the playerShip...a way of auto-forcing the player's ship to do a galactic jump, perhaps unexpectedly?
The initial goal was automation. I wanted to easily calculate the average/min/max amounts for all commodities in the system, and by visit the system, rather than using the function to estimate prices. A sort of set and forget type of thing where I could come back and see the results. But I wanted to do it across all charts as well. And given how many times I wanted to do it, it made sense to add the missing function.

But what it gets used for in future - who knows.
DGill
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Thu Jan 01, 2009 9:45 am

Re: Scripters cove

Post by DGill »

Ramirez's code has a number of strings giving names for a number of nationalities e.g.

"feudal_firstname_german_he" = ("Bruno","Dieter","Eric","Franz","Gustav","Heinrich","Johan","Lothar","Otto","Reinhard","Thorsten","Ulrich","Walter","Wilhelm","Wolfgang")

and uses:

player.rankGenerator_feudal_firstname = expandDescription("[feudal_firstname_" + [rankGenerator_language] + "_" + [player.rankGenerator_gender] + "]");

to extract a random name from the list for a specified language e.g german , english, etc.

I want to extract only the first name in the list for a specified language e.g Bruno in the above list for german

Anyone know how I can do it?
Alnivel
Dangerous
Dangerous
Posts: 100
Joined: Fri Jun 10, 2022 7:05 pm

Re: Scripters cove

Post by Alnivel »

DGill wrote: Mon Aug 28, 2023 5:42 pm
Ramirez's code has a number of strings giving names for a number of nationalities e.g.

"feudal_firstname_german_he" = ("Bruno","Dieter","Eric","Franz","Gustav","Heinrich","Johan","Lothar","Otto","Reinhard","Thorsten","Ulrich","Walter","Wilhelm","Wolfgang")

and uses:

player.rankGenerator_feudal_firstname = expandDescription("[feudal_firstname_" + [rankGenerator_language] + "_" + [player.rankGenerator_gender] + "]");

to extract a random name from the list for a specified language e.g german , english, etc.

I want to extract only the first name in the list for a specified language e.g Bruno in the above list for german

Anyone know how I can do it?
As far as I know, there is no way to get value at some specific index from a list in descriptions.plist.

If you need just only the first for a specified language you can just add entries like "feudal_firstname_german_he_0" = "Bruno"; for each language, but if you want more control, you, most likely, need to move the lists in a js file.
DGill
---- E L I T E ----
---- E L I T E ----
Posts: 293
Joined: Thu Jan 01, 2009 9:45 am

Re: Scripters cove

Post by DGill »

Alnivel wrote: Tue Aug 29, 2023 6:21 pm

As far as I know, there is no way to get value at some specific index from a list in descriptions.plist.
Thank you for your help; I had a feeling this would be the case when all my feeble attempts to get it to work failed.
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2882
Joined: Tue Apr 04, 2006 7:02 pm
Location: On a survey mission for GalCop. Ship: Cobra Corvette: Hidden Dragon Rated: Deadly.

Re: Scripters cove

Post by LittleBear »

You can select a specific position number from an array in script if you want to. But this would mean C&Ping the names from descriptions into script in array format:

Code: Select all

this.feudalfirstnamegermanhe = ["Bruno","Dieter","Eric","Franz","Gustav","Heinrich","Johan","Lothar","Otto","Reinhard","Thorsten","Ulrich","Walter","Wilhelm","Wolfgang"];
You can then summon a particular position in the array by its number (but Oolite starts counting from 0) with:

Code: Select all

var position = 0;
var name = feudalfirstnamegermanhe[position &14];
Var name will now be the name in the array at position 0 out of 15 positions (the number for total number above is one less than the actual number as position 1 is 0 and so on).
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