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

in Touchdown script, make reporting the lat/lon of vehicle optional. #2463

Closed
slippycheeze opened this issue Jan 1, 2023 · 1 comment
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

What happens now

When my ship touches down on a planet EDDI reports, among other things, "Coordinates are 12.34 degrees latitude, and 56.78 degrees longitude." – and I don't care; I'm not using that information for anything, and prefer the on-screen location displays or other tools when I need the surface location.

What I'd like to happen

I'd like to be able to disable that easily, and in a way that makes it easy to adopt future updates to that script. (Which seems like a script that could end up doing more, since touchdown is an event that could trigger, eg, reporting exo-biology or geology information.)

How it can happen

My implementation followed some other scripts, adding a config flag at the top, default to true for equivalent with current script, and then skipping the location report if it is not truthy. That way I have one line to edit, and it should stay possible to enable/disable this. :)

my edits are the two lines with the word reportLocation. (I couldn't think of a better word, but that doesn't seem quite exactly a description of what it controls. alas, naming.)

{_ Touchdown _}
{_ Triggered when your ship touches down on a planet's surface _}

{set reportLocation to 1}   {_ if truthy, report the latitude and longitude of the ship. _}


{set body to BodyDetails(state.eddi_context_body_name, state.eddi_context_system_name)}

{if event.playercontrolled = true && state.eddi_context_last_subject != 'location':
  Touchdown 
  {if body.name: on {P(body.name, "body")} }.
|else:
  {ShipName()} has touched down
  {if body.name: on {P(body.name, "body")} }.
}

{if reportLocation && type(event.latitude) != "void" && type(event.longitude) != "void" :
  {Pause(2000)}
  Coordinates are  {round(event.latitude, 2)} degrees latitude, {round(event.longitude, 2)} degrees longitude.
}

{_ Context }
{SetState('eddi_context_last_subject', 'ship')}
{SetState('eddi_context_last_action', 'land')}

EDDI Version

EDDI v.4.0.2-b5 (changes based on a script reset to default, then edited, so current.)

@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 Jan 2, 2023
@Tkael
Copy link
Member

Tkael commented Jan 2, 2023

Agreed, this is a bit verbose.

@Tkael Tkael closed this as completed in 7e25472 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

2 participants