Scripters cove
Moderators: winston, another_commander
- phkb
- 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
I'm not missing something, am I? Is there no way to script a galactic hyperspace jump?
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Scripters cove
[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!
And any survivors, their debts I will certainly pay. There's always a way!
- phkb
- 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
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.
- Cody
- Sharp Shooter Spam Assassin
- Posts: 16081
- Joined: Sat Jul 04, 2009 9:31 pm
- Location: The Lizard's Claw
- Contact:
Re: Scripters cove
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!
And any survivors, their debts I will certainly pay. There's always a way!
- Redspear
- ---- E L I T E ----
- Posts: 2685
- Joined: Thu Jun 20, 2013 10:22 pm
- Location: On the moon Thought, orbiting the planet Ignorance.
Re: Scripters cove
Could you spawn a wormhole, asign it with the relevant properties and then have the desired ship make a beeline for it?
- phkb
- 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
I don’t think a wormhole can be spawned directly. You can spawn a ship have have it
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.
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.
- phkb
- 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
I should say, only visible as a piece of text the player receives when docked, not in space.
Re: Scripters cove
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.
...saving 5000 credits (and time to find and equip) for the Galactic Hyperdrive for your ship.
- phkb
- 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
Not for this update. All I’m planning on adding is aSwiteck wrote: ↑Thu Aug 03, 2023 7:15 pmDoes 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.
beginGalacticHyperspaceCountdown
method to the playerShip
.Re: Scripters cove
As for detecting a jump-attempt might be a galactic hyperdrive jump...
...or is the
Code: Select all
this.playerStartedJumpCountdown = function (jump)
{
if(jump == "galactic") {
// do something here!
}
}
beginGalacticHyperspaceCountdown
method to the playerShip...a way of auto-forcing the player's ship to do a galactic jump, perhaps unexpectedly?- phkb
- 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
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.Switeck wrote: ↑Sat Aug 05, 2023 4:47 pmAs for detecting a jump-attempt might be a galactic hyperdrive jump......or is theCode: Select all
this.playerStartedJumpCountdown = function (jump) { if(jump == "galactic") { // do something here! } }
beginGalacticHyperspaceCountdown
method to the playerShip...a way of auto-forcing the player's ship to do a galactic jump, perhaps unexpectedly?
But what it gets used for in future - who knows.
Re: Scripters cove
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?
"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?
Re: Scripters cove
As far as I know, there is no way to get value at some specific index from a list in descriptions.plist.DGill wrote: ↑Mon Aug 28, 2023 5:42 pmRamirez'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?
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.- LittleBear
- ---- 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
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:
You can then summon a particular position in the array by its number (but Oolite starts counting from 0) with:
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).
Code: Select all
this.feudalfirstnamegermanhe = ["Bruno","Dieter","Eric","Franz","Gustav","Heinrich","Johan","Lothar","Otto","Reinhard","Thorsten","Ulrich","Walter","Wilhelm","Wolfgang"];
Code: Select all
var position = 0;
var name = feudalfirstnamegermanhe[position &14];
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.