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

feat(mods/teleportation_tech): Teleporter mod #3165

Merged
merged 30 commits into from
Dec 4, 2023

Conversation

borsek
Copy link
Contributor

@borsek borsek commented Sep 17, 2023

Purpose of change

With LUA modding added to CBN, I tried my hand at making a sensible teleporter mod. With this mod, a static base should be much more viable.

If possible with LUA, I intend to extend it to vehicles (stations and anchors as vehicle parts). I'd probably need some more hooks for that, but there could also be workarounds.

Describe the solution

The mod description is in main.lua. In short - the player places teleport stations and anchors (by using the respective items, which use LUA to place furniture). Everything else is done by using the 'teleporter remote' item.

Stations fill by 1 energy per hour, and can also be pumped with grid energy to get 'charge'. 1 charge allows teleporting for 1 overmap tile. The station charging is done locally (player and grid with power must be on the teleport station omt) with a teleport controller, allowing the player to convert 1000kj into 1 charge for a picked station.

Using a teleport controller, the player can teleport from anywhere (charge permitting) to a teleport anchor (placed furniture), using a station, provided the station has enough power,

The hourly charge and kj-to-charge variables are easily modified by the user in main.lua.

Describe alternatives you've considered

Play more Avorion instead of coding.

Testing

No major bugs. Some features I want still need to be implemented.

Screenshots

image

image

image

image

image

image

@borsek
Copy link
Contributor Author

borsek commented Sep 17, 2023

Oh, I'm totally open to any suggestions, code improvements, etc.

very noob coder, so any help is appreciated!

@github-actions github-actions bot added JSON related to game datas in JSON format. mods PR changes related to mods. labels Sep 17, 2023
@olanti-p olanti-p added this to the Stable release 4 milestone Sep 23, 2023
@Ali-Anomma
Copy link
Contributor

Oh, I'm totally open to any suggestions, code improvements, etc.

very noob coder, so any help is appreciated!

what about ability of naming the waystations?

@scarf005 scarf005 changed the title Teleporter mod feat(content): Teleporter mod Nov 14, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, could we get add a tasklist to check which feature is implemented and which feature needs to be worked on?

@borsek
Copy link
Contributor Author

borsek commented Nov 15, 2023

I haven't checked this for compatibility since my last update, but I needed #3164 done to finish up. Obviously the naming suggestion is not in as of yet, but I can get around to it at some point, if not otherwise, then as an update - I get it though, name teleport destinations as "lab" "home" etc.

data/mods/teleportation_mod/item.json Outdated Show resolved Hide resolved
data/mods/teleportation_mod/item.json Outdated Show resolved Hide resolved
data/mods/teleportation_mod/item.json Outdated Show resolved Hide resolved
@borsek borsek marked this pull request as ready for review November 18, 2023 19:13
@borsek
Copy link
Contributor Author

borsek commented Nov 18, 2023

Need the item spawning on ground/in player inventory functions added, otherwise should work if scarf merges his lua update, at least the teleportation will, that is.

@borsek borsek requested a review from scarf005 November 26, 2023 18:59
@scarf005 scarf005 self-assigned this Nov 26, 2023
@scarf005 scarf005 changed the title feat(content): Teleporter mod feat(mods/teleportation_tech): Teleporter mod Nov 27, 2023
@github-actions github-actions bot added docs PRs releated to docs page src changes related to source code. scripts related to game management scripts labels Dec 4, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2023-12-04_09-16-44.mp4

sorry for the long delay. while our Lua infrastructure has much to desire, the mod work alright, and this would be the stepping stone for better Lua support.

thank you for the hard work.

@scarf005 scarf005 added this pull request to the merge queue Dec 4, 2023
@borsek
Copy link
Contributor Author

borsek commented Dec 4, 2023

<3 thank you for the update, I've been mostly away for a while now, I'll get the itch again and update this in the future - v.1.1 with vehicle stations and better deconstruction ;)

Thanks for your work on it!

@scarf005
Copy link
Member

scarf005 commented Dec 4, 2023

future planned issue:

  • add Lua formatter
  • format all Lua files
  • document Lua style guide

Merged via the queue into cataclysmbnteam:upload with commit ea16272 Dec 4, 2023
11 of 14 checks passed
@scarf005 scarf005 mentioned this pull request Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs PRs releated to docs page JSON related to game datas in JSON format. mods PR changes related to mods. scripts related to game management scripts src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Expose player teleport function to lua
4 participants