Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggested improvements to the "Module sold (from storage)" scripts #2441

Closed
slippycheeze opened this issue Dec 19, 2022 · 4 comments
Closed
Labels
9. enhancement The behaviour is as specified, but we would like to modify or extend the spec. cottle Relates to a Cottle script rather than C# code.

Comments

@slippycheeze
Copy link
Contributor

slippycheeze commented Dec 19, 2022

What happens now

Sell a loaner module from the starter ship, either during an outfitting exchange, or from storage.
EDDI speech responder says "You have sold a 1E cargo rack for zero credits."

What I'd like to happen

"You have returned a loaned 1E cargo rack."
"You have returned a loaned 1E cargo rack from storage."

How it can happen

Here are my adjustments to the scripts to implement this. Diff and/or pull request on, uh, request, I guess?
Probably best to @ me in EDCD discord (SlippyCheeze#5125)

module sold

You have {when(event.price <= 0, "returned", "sold")} a 
{if icao_active:
    {event.module.class} {ICAO(event.module.grade)}
|else:
    {Spacialise(cat(event.module.class, event.module.grade))}
}

{if type(event.module.mount) != "void":
    {for index, value in event.module.mount: {set mount to value}}
    {if mount = 0:
        fixed
    |elif mount = 1:
        giimballed
    |elif mount = 2:
        turreted
    }
}

{event.module.name} {if event.price > 0: for {Humanise(event.price)} credits}.

module sold from storage

You have {when(event.price <= 0, "returned", "sold")} a 
{if icao_active:
    {event.module.class} {ICAO(event.module.grade)}
|else:
    {Spacialise(cat(event.module.class, event.module.grade))}
}

{if type(event.module.mount) != "void":
    {for index, value in event.module.mount: {set mount to value}}
    {if mount = 0:
        fixed
    |elif mount = 1:
        giimballed
    |elif mount = 2:
        turreted
    }
}

{event.module.name} from your stores {if event.price > 0: for {Humanise(event.price)} credits}.

EDDI Version

EDDI v.4.0.1

@Tkael Tkael added 9. enhancement The behaviour is as specified, but we would like to modify or extend the spec. cottle Relates to a Cottle script rather than C# code. labels Dec 20, 2022
@Darkcyde13
Copy link

I've had something similar to this in my EDDI personality for a few months now. All my Module... scripts have a variation of this code in:

You have
{if event.module.grade = "E" && event.module.price < 1:
    returned a loaned
|else:
    sold a
}
...

I chose to have a check for grade E as well as price, because all loaned modules are of that grade (or should be anyway). Some modules that are not loaners can still be a price of zero, but be higher grade, like for some CG rewards for example. I'm not sure about modules from free ships though, as it's been a while since Frontier did anything special that gave away any ships.

@Tkael
Copy link
Member

Tkael commented Jan 2, 2023

This is an interesting suggestion though I'm not sure that "loaned" is the right word to describe these modules. You do own them, but they are the basic modules that come with the ship. Any new modules you purchase are a bit like aftermarket upgrades. Perhaps these modules may be better described as "complimentary"?

e.g. You have returned a complimentary 1 E Cargo Rack.

@Darkcyde13
Copy link

While I would tend to agree, wasn't the first ship you get supposed to be a loan one? After all these years, I'm a bit fuzzy on remembering the lore, and how the game starts, but I thought that was the case?

Having a quick look around the Internet, I came across this, which goes some way to explaining it a bit:
https://steamcommunity.com/app/359320/discussions/0/611703999981302696/

Also, this section on Fandom does say the base Sidewinder after losing everything, is a loan one:
https://elite-dangerous.fandom.com/wiki/Redeployment#Financial_Support

So, maybe an additional check should be added, so see if the ship is a Sidewinder? With ship model, module grade, and price (Sidey, grade E, and 0 Cr) that would certainly be a loan module.

@Tkael
Copy link
Member

Tkael commented Jan 2, 2023

Hmm. Bought a new ship to check this. Loaned modules have no value and can include modules on free ships other than sidewinders. Complementary modules do have values and are generally harder to identify without tracking the starting modules of each ship. Loaned is the better identifier.

@Tkael Tkael closed this as completed in 5231d2d Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
9. enhancement The behaviour is as specified, but we would like to modify or extend the spec. cottle Relates to a Cottle script rather than C# code.
Projects
None yet
Development

No branches or pull requests

3 participants