Scripters cove

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

Moderators: another_commander, winston

User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2921
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Scripters cove

Post by Wildeblood »

LittleBear wrote: Sun Feb 08, 2026 11:44 pm
The change can be made anywhere in script (for example when you scoop the pod), it doesn't have to be under start.up. It will over-ride planetinfo at least until you re-load the game. If you want it to be permanent then you'd need another command under start.up making the change if a mission variable has been flipped.
That's plain wrong. Use your imagination to add whatever words you need make me sound polite, I mean no offence, but that's just wrong.
R.I.P. John Lodge, 1943-2025.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2921
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: The hard truth

Post by Wildeblood »

Old Murgh wrote: Sun Feb 08, 2026 9:43 pm
Using javascript the planet descriptions are easily altered.
But the 'above the line' info such as inhabitants, government, economy.. I can only manage to alter using the planetinfo.plist, and this goes global the moment the OXP is loaded. It will not support the illusion that turning on this machine causes this change..

So, if one you wizards could tell me,
is there a way to make planetinfo 'switchable'?
OR is there a way to make the planetinfo data manipulated by javascript?
Example of using JS to manipulate systeminfo objects:-

https://wiki.alioth.net/index.php/File: ... uilder.oxz
R.I.P. John Lodge, 1943-2025.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5619
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

LittleBear wrote: Sun Feb 08, 2026 11:44 pm
If you want it to be permanent then you'd need another command under start.up making the change if a mission variable has been flipped. EG (under start.up):
I think Wildeblood is referring to the fact that, any changes made by JS are not permanent, even when made during startUp, as they can be cleared/returned to default by setting the value to null.

Putting the changes into a planetinfo.plist file is kind of permanent (at least until the OXP is uninstalled). But any changes in planetinfo.plist cannot be switched on and off via JS.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: Scripters cove

Post by Old Murgh »

phkb wrote: Sun Feb 08, 2026 11:33 pm
You can't switch a "planetinfo.plist" on or off with a script. What you can do is set your value via script, and when you want to switch it back to the default, set the value to null.
LittleBear wrote: Sun Feb 08, 2026 11:44 pm
The change can be made anywhere in script (for example when you scoop the pod), it doesn't have to be under start.up. It will over-ride planetinfo at least until you re-load the game. If you want it to be permanent then you'd need another command under start.up making the change if a mission variable has been flipped. EG (under start.up):
Wildeblood wrote: Mon Feb 09, 2026 12:47 am
Example of using JS to manipulate systeminfo objects:-
https://wiki.alioth.net/index.php/File: ... uilder.oxz
Thank you guys. It has been a very strange experiment to try to will a scripting AI to do my bidding, based on examples I find and what I *think* is possible. It fought me on this -adamant I was demanding the impossible, but with your supplied examples (it calls you the High Council) it came through in the end.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2921
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Scripters cove

Post by Wildeblood »

Old Murgh wrote: Mon Feb 09, 2026 1:39 am
Thank you guys. It has been a very strange experiment to try to will a scripting AI to do my bidding, based on examples I find and what I *think* is possible. It fought me on this -adamant I was demanding the impossible, but with your supplied examples (it calls you the High Council) it came through in the end.
I need to know which AI it was. I won't sleep without knowing more details.
R.I.P. John Lodge, 1943-2025.
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2921
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Scripters cove

Post by Wildeblood »

phkb wrote: Mon Feb 09, 2026 1:35 am
LittleBear wrote: Sun Feb 08, 2026 11:44 pm
If you want it to be permanent then you'd need another command under start.up making the change if a mission variable has been flipped. EG (under start.up):
I think Wildeblood is referring to the fact that, any changes made by JS are not permanent, even when made during startUp, as they can be cleared/returned to default by setting the value to null.
I was referring to the assertion that one needed to do anything like messing about with mission variables or startUp. SystemInfo changes are automatically stored in the saved game file, separate from mission variables.
R.I.P. John Lodge, 1943-2025.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5619
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

Wildeblood wrote: Mon Feb 09, 2026 2:09 am
I was referring to the assertion that one needed to do anything like messing about with mission variables or startUp. SystemInfo changes are automatically stored in the saved game file, separate from mission variables.
Ah! Good point.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: Scripters cove

Post by Old Murgh »

Wildeblood wrote: Mon Feb 09, 2026 2:04 am
I need to know which AI it was. I won't sleep without knowing more details.
Not a pro-coder AI, just Google's Gemini 3.0. Mostly it shows great enthusiasm and does the simple things well.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

fails to fire for custom CARGO_SCRIPTED_ITEM

Post by Old Murgh »

Our little human/AI team is stuck again. The part where the player must hunt a ship, destroy it, and scoop a specific pod ("Encrypted Data Core") to trigger a mission screen.

shipScoopedCargo never triggers in [our] World Script. The pod spawns correctly, appears on the scanner (whiteLollipop), and I can physically scoop it. However, the moment I scoop it, it vanishes. The Debug Log shows absolutely nothing—the event handler is never called. It doesn't appear in the cargo manifest (expected for scripted items), but the silence in the logs is the issue.
I have tried multiple variations of is_cargo (YES/NO) and cargo_type.

Current Shipdata Definition:

Code: Select all

"mnemonic_cipher_pod" = {
    "model" = "oolite_barrel.dat";
    "materials" = { "Hull" = { "diffuse_map" = "oolite_barrel_diffuse.png"; }; };
    "name" = "Encrypted Data Core V2";
    "roles" = "mnemonic_cipher_pod";
    
    "weight" = 1;
    "scan_class" = "CLASS_CARGO"; 
    
    "is_cargo" = YES; 
    "is_scoopable" = YES;
    "cargo_type" = "CARGO_SCRIPTED_ITEM"; 
    
    "script_info" = { 
        "mnemonic_id" = "cipher_pod_v2"; 
    };
    /* I also tried attaching a script to the pod with 'shipBeingScooped', which also failed to fire. */
};
World Script Listener:

Code: Select all

this.shipScoopedCargo = function(cargoItem) {
    // This log NEVER appears
    log(this.name, "DEBUG: shipScoopedCargo fired. Name: " + cargoItem.displayName);

    if (cargoItem && cargoItem.scriptInfo && cargoItem.scriptInfo["mnemonic_id"] === "cipher_pod_v2") {
        // Mission Logic...
    }
}
  • Does CARGO_SCRIPTED_ITEM require a specific is_cargo setting to trigger the global shipScoopedCargo event?
  • Do I need to define this item in equipment.plist as well for the scoop event to register?
  • Is there a better way to detect scooping a specific mission asset in 1.90/1.92?
Asking for a friend.
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
LittleBear
---- E L I T E ----
---- E L I T E ----
Posts: 2926
Joined: Tue Apr 04, 2006 7:02 pm
Location: Up to no good in Galaxy 7. Ship: Wolf Mark II: Hidden Dragon Rated: Deadly.

Re: Scripters cove

Post by LittleBear »

There might be a more elegant way to do it, but Random Hits tests for player scooping with a script attached to the pod and setting a mission variable if the player has scooped the escape pod.

Code: Select all

this.shipWasScooped = function (scooper)
{
	if (missionVariables.random_hits_status == "PODEDOUT") // first check if the mission is still running
    {
        if (scooper.isPlayer)
        {
            mission.setInstructionsKey("random_hits_shortdescription8", "Random_Hits"); // Update the mission info.
            player.consoleMessage(expandDescription("[random_hits_scooped_comms]"));
            missionVariables.random_hits_status = "SCOOPED";
            missionVariables.random_hits_store_skill++;
        }
        else
        {
            mission.setInstructionsKey("random_hits_shortdescription6", "Random_Hits"); // Update the mission info.
            missionVariables.random_hits_npcdays = expandDescription("[clock_days_number]");
            missionVariables.random_hits_deathcause = expandDescription("[random_hits_deathcause_scoop]");
            player.consoleMessage(expandDescription("[random_hits_npckill]"));
            missionVariables.random_hits_status = "NPCKILL";
        }
        mission.unmarkSystem(missionVariables.random_hits_planetnumber);
    }
}
You can then make the appearance of a mission screen conditional on the mission variable being "SCOOPED".

Adding this to the pod's shipdata entry should attach the script:

Code: Select all

script = "my_script_name.js";
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
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: Scripters cove

Post by Old Murgh »

LittleBear wrote: Mon Feb 09, 2026 9:59 pm
There might be a more elegant way to do it, but Random Hits tests for player scooping with a script attached to the pod and setting a mission variable if the player has scooped the escape pod.
Yay, it worked immediately. Thankyou very much.
My AI says you're a legend for a reason. :D
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2921
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: fails to fire for custom CARGO_SCRIPTED_ITEM

Post by Wildeblood »

Old Murgh wrote: Mon Feb 09, 2026 6:55 pm
shipScoopedCargo never triggers in [our] World Script.
Try shipScoopedOther
R.I.P. John Lodge, 1943-2025.
User avatar
Old Murgh
Wiki Wizard
Wiki Wizard
Posts: 694
Joined: Sat Dec 04, 2021 11:01 pm

Re: fails to fire for custom CARGO_SCRIPTED_ITEM

Post by Old Murgh »

Wildeblood wrote: Tue Feb 10, 2026 1:43 am
Thank you. Big backandforth between merits of this vs shipWasScooped, which AI kindly translates to metaphors.
Using shipScoopedOther is like having a Security Guard at the door checking everyone's ID badge. (Centralized).

Using shipWasScooped is like giving the VIP guest a Panic Button. (Decentralized).
:roll:
I'm picking up some stuff in an interesting way
I was young, I was naïve. [EliteWiki] Jonny Cuba made me do it!
User avatar
Wildeblood
---- E L I T E ----
---- E L I T E ----
Posts: 2921
Joined: Sat Jun 11, 2011 6:07 am
Location: Nova Hollandia
Contact:

Re: Scripters cove

Post by Wildeblood »

A timer query: I want an effect to be on for 1/2 second then off for one second. I can do this with one timer, but it involves some kind of modulo arithmetic or somethin'?
R.I.P. John Lodge, 1943-2025.
User avatar
phkb
Impressively Grand Sub-Admiral
Impressively Grand Sub-Admiral
Posts: 5619
Joined: Tue Jan 21, 2014 10:37 pm
Location: Writing more OXPs, because the world needs more OXPs.

Re: Scripters cove

Post by phkb »

Wildeblood wrote: Sun Feb 15, 2026 5:31 pm
A timer query: I want an effect to be on for 1/2 second then off for one second. I can do this with one timer, but it involves some kind of modulo arithmetic or somethin'?
I would have though just a boolean switch would have been sufficient: if the timer is on a 0.5 second repeat, flipping the boolean value would allow you to switch the effect on and off.
Post Reply