21266 Posts in 3600 Topics - by 7452 Members - Latest Member: Kruzeru

Author Topic: [Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*  (Read 1485 times)

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
[Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*
« on: September 14, 2017, 12:39:53 AM »
ScrapyardPlus
Description

Your salvaging ops are longer then 60 minutes?
You want to get something in return for grinding all the precious reputation?

With ScrapyardPlus you can:
  • buy up to 8 hours total (depending on your reputation)
  • increment your current license in variable intervals from 5 minutes all the way up to 3 hours per order
  • get discounts for bulk orders and your current standing with the owner of the scrapyard
  • buy a personal license even as a member of an alliance
  • earn a lifetime-license for yourself or your alliance an never have to bother with buying an extension again (lifetime status is granted faction-wide!)

Installation

Spoiler: show
- download & extract the mod into your avorion folder

- insert the following code at the very end of the original scrapyard file located at:
Quote
data/scripts/entity/merchants/scrapyard.lua

Code: [Select]
if not pcall(require, "mods/ScrapyardPlus/scripts/entity/merchants/scrapyard") then print("Failed to load ScrapyardPlus") end -- DNightmare/ScrapyardPlus END
!!! If you are using Dirtyredz' MoveUI-Mod as well, ScrapyardPlus has to be inserted BEFORE that !!!

- done


Screenshots

Spoiler: show

Solo pilot with a very good reputation

Alliance pilot with a normal reputation

Nearly reached lifetime status but lost reputation before finishing it

Finally reached lifetime status



Roadmap

Implemented:
- extend your current license instead of overwriting it
- longer maximum duration for your license
- reputation based benefits (max duration and discount)
- flexible duration selection via slider
- add support for mod-configuration
- split the license system into private & alliance so you can buy a personal one even if you are in an alliance
- lifetime license

Planned:
- regenerating wrecks / events to support lifetime licenses

Notes

As I was not satisfied with the current salvaging-license model, I got to work and learned a bit of lua and modified the original script.
So far you can stack your licenses, so if you buy 5 minutes two times, you get 10 minutes total.
As this is my first mod for Avorion apart from some small private things here and there, don't expect the cleanest code in the world but I did my best to test it on my local machine and my dedicated server and haven't encountered anything game-breaking so far.
It's available at GitHub if someone wants to contribute.

Constructive feedback what I could change/implement/extend upon or fix in case you find a bug is more than welcome!

Project-URL: https://github.com/ctcDNightmare/avorion-scrapyardplus

Shoutout to Dirtyredz - We're working together on each others mods now and without him I wouldn't have gotten into publishing this mod at all.

Changelog

Spoiler: show

Version 1.3.1 "unassimilable-demodulator"
  • fixed lifetime initialization on newly discovered scrapyards

Version 1.3.0 "preelementary-reptile"
  • restructured file-layout
  • changed nicerNumbers helper to vanilla equivalent
  • refactored modConfig
  • add lifetime license feature

Version 1.2.1 "bushless-intimidation"
  • port of vanilla functions from 0.14.2
  • add missing getUpdateInterval() & onCloseWindow()

Version 1.2.0 "purebred-terrestrial"
  • buy personal licenses even as alliance member
  • fixed vanilla notifications
  • notify all online members of an alliance if time is running out
  • pricePerMinute and alliancePriceFactor are now configurable
  • add clickable coordinates to notifications

Version 1.0.0 "preantiseptic-lingual"
  • variable maxDuration based on reputation
  • revamped UI with discounts for bulk-order & reputation
  • bought time is added to current one instead of overwriting it


DNightmare out!
« Last Edit: October 02, 2017, 06:15:03 PM by dnightmare »
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Dirtyredz

  • Full Member
  • ***
  • Posts: 160
  • David McClain - Dirtyredz
    • View Profile
    • Dirtyredz.com
Re: [Mod] ScrapyardPlus (Alpha, v1.0.0)
« Reply #1 on: September 14, 2017, 06:05:18 AM »
Looks promising, cant wait to try it out. As we discussed earlier, im hoping to get the MoveUI ScrapyardLicense up and running, Just today, I lost track of time and ran out of time on my pathetic 60 min license. costed me my ship and faction rep. This Mod and ScrapyardLicense that you started will be a big help. Thanks again
David McClain - Dirtyredz
Programmer, Web Development, Modder
http://www.Dirtyredz.com


Hammelpilaw

  • Full Member
  • ***
  • Posts: 205
    • View Profile
    • Scrap Yard - Factory calculator
Re: [Mod] ScrapyardPlus (Alpha, v1.0.0)
« Reply #2 on: September 15, 2017, 04:41:55 PM »
The roadmap looks great. We already use extended license times, up to a lifetime license. It makes you able to put some captain controlled ships into scrapyard and let them farm without killing reputation.

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] ScrapyardPlus (v1.2.0)
« Reply #3 on: September 17, 2017, 11:37:13 AM »
Version 1.2.0 is out now!
- buy personal licenses even as alliance member
- fixed vanilla notifications
- notify all online members of an alliance if time is running out
- pricePerMinute and alliancePriceFactor are now configurable
- add clickable coordinates to notifications
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] ScrapyardPlus (v1.2.1)
« Reply #4 on: September 23, 2017, 05:58:23 PM »
Version 1.2.1 released.
Compatible with v0.14.2 of Avorion!
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Lonewolf79

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [Mod] ScrapyardPlus (v1.2.1)
« Reply #5 on: September 24, 2017, 11:02:45 PM »
Sorry posted in the wrong thread, should be in MoveUI obviously :)

Hi!

Using your latest version with the beta branch of Avorion I am getting this error everytime I try to get a license:

2017-09-24 22-58-37|    mods/MoveUI/scripts/player/ScrapyardLicenses.lua:46: in function ?
2017-09-24 22-58-37| error constructing Entity: Entity with index  doesn't exist at    [C]:-1: in function Entity

I can salvage away to my hearts content, they don't seem to care but I cannot buy the license
« Last Edit: September 24, 2017, 11:07:39 PM by Lonewolf79 »

Dirtyredz

  • Full Member
  • ***
  • Posts: 160
  • David McClain - Dirtyredz
    • View Profile
    • Dirtyredz.com
Re: [Mod] ScrapyardPlus (v1.2.1)
« Reply #6 on: September 25, 2017, 07:17:21 AM »
Sorry posted in the wrong thread, should be in MoveUI obviously :)

Hi!

Using your latest version with the beta branch of Avorion I am getting this error everytime I try to get a license:

2017-09-24 22-58-37|    mods/MoveUI/scripts/player/ScrapyardLicenses.lua:46: in function ?
2017-09-24 22-58-37| error constructing Entity: Entity with index  doesn't exist at    [C]:-1: in function Entity

I can salvage away to my hearts content, they don't seem to care but I cannot buy the license

This bug is actually a MoveUI bug, of which ive just fixed:
http://www.avorion.net/forum/index.php/topic,3834.0.html
David McClain - Dirtyredz
Programmer, Web Development, Modder
http://www.Dirtyredz.com


Lonewolf79

  • Newbie
  • *
  • Posts: 9
    • View Profile
Re: [Mod] ScrapyardPlus (v1.2.1)
« Reply #7 on: September 25, 2017, 12:34:30 PM »

This bug is actually a MoveUI bug, of which ive just fixed:
http://www.avorion.net/forum/index.php/topic,3834.0.html

Aye noticed that just after I posted, sorry about that!
Bad idea to try and do such things in the middle of the night :)

Thanks for the fix!

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod] ScrapyardPlus (v1.2.1)
« Reply #8 on: September 25, 2017, 01:14:36 PM »
Well better posted in the wrong spot than not at all :)
Dirty & Me are actually working together back & forth on those two mods, so it was only semi-wrong anyway.
I will take a closer look at my current version to and see if there's any other issues I overlooked when testing.

Want to get more stuff done for lifetime license anyway (+ regenerating scrapyards to support lifetime licenses)
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod][0.14.x] ScrapyardPlus (v1.3.0) *now with lifetime licenses*
« Reply #9 on: October 01, 2017, 01:08:47 PM »
Sooo, v1.3.0 is finally out!

We now have working lifetime licenses yay

They are quite hard to get with default settings BUT they work for the whole faction and not just a single scrapyard.
If you are at max reputation (100k) you start earning experience towards the lifetime status when you are salvaging with a valid, regular license until you reach enough to permanently activate your lifetime-status.

Of course the amount, speed, etc can all be adjusted in the modconfig for your personal preference.

To make lifetime licenses worth using, I've also started to work on regenerating wrecks so you don't run out of scrapmetal after a while but this will go into 1.4+.

o/
DNightmare
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Shrooblord

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*
« Reply #10 on: October 08, 2017, 10:37:29 PM »
Wow, what with the lifetime licenses mod, this adds simple, yet clean and amazing functionality to the game I didn't even knew I missed, until I found this thread.

Thanks a bunch for this!

Also, looking at your mods/ folder structure and the mod hooks you're implementing by writing them into the original scripts files is giving me massive inspiration on how to actually handle the ModLoader / ModManager I'm working on in secret for my personal use, but plan to release once functional.

Thanks a bunch for that!!

EDIT:
I added your installation instructions to the .zip file as a README.txt, for convenience when downloading. Literally just a copy-pasta of the first post's instructions, but here's the .zip file anyway.
« Last Edit: October 08, 2017, 10:40:52 PM by Shrooblord »
Shrooblord

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*
« Reply #11 on: October 09, 2017, 08:54:00 AM »
Also, looking at your mods/ folder structure and the mod hooks you're implementing by writing them into the original scripts files is giving me massive inspiration on how to actually handle the ModLoader / ModManager I'm working on in secret for my personal use, but plan to release once functional.

Credit where credit is due: That's totally the idea from DirtyRedz who got me hooked with the whole modding in the first place.

But glad you enjoy my little mod :)
Once I find the time to get the events in there as well I'm sure it'll be another thing you didn't know you wanted :D
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Shrooblord

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*
« Reply #12 on: October 09, 2017, 01:25:58 PM »
I've been playing with this active for a couple of hours now, and I have a question: when I'm out-of-Sector, my ships at the Scrapyard still seem to be mining away: I'm still constantly collecting resources and guns and stuff, and when I return to the Scrapyard, lots of dead ships have been cleared away.

How does this work? I thought Sectors weren't loaded while you weren't in them, yourself.

I also have Fleet Control (0.4 - Modified) (thanks Hammel! You seem to be keeping all the dead mods alive (y) ) installed. Maybe that's introducing the change, rather than this mod?

Whatever is causing it, I'm finding it very, very cool.

There is only one problem though: you need to be at the Scrapyard to tell your "drones" to stop, as you cannot issue them commands while OoS (even with Fleet Control). I got a lot of angry messages from my most prized ally while I was in a mad dash through gates and hyperdrive warps trying to get there in time, and managed to literally on the last second before they'd destroy aaaalll of my baby ships to buy a new license.
Hahaha that won't happen anytime soon, now, thanks to MoveUI's floating timer to keep me reminded.

Man, all these mods are mega-cool. Thanks for all your work, guys and gals!
Shrooblord

dnightmare

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: [Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*
« Reply #13 on: October 09, 2017, 03:38:13 PM »
How does this work? I thought Sectors weren't loaded while you weren't in them, yourself.
Since a couple of versions, Avorion will keep the last X sectors alive when you leave.
For singleplayer it's 500 or so, for multiplayer the serverowner can set it, default to 5 iirc.

There is only one problem though: you need to be at the Scrapyard to tell your "drones" to stop, as you cannot issue them commands while OoS (even with Fleet Control). I got a lot of angry messages from my most prized ally while I was in a mad dash through gates and hyperdrive warps trying to get there in time, and managed to literally on the last second before they'd destroy aaaalll of my baby ships to buy a new license.

At the moment there's no way to remotely tell them to stop.
I'm working on something like that: https://github.com/ctcDNightmare/avorion-remotecontrol

The proof of concept works so far:

(watch in fullscreen to read the console & chat output from the remote ships)

But it's still far away from getting done / I'm busy with RL or ScrapyardPlus

Man, all these mods are mega-cool. Thanks for all your work, guys and gals!
Thanks :) Glad there's people out there who like my (and others') work.
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Shrooblord

  • Jr. Member
  • **
  • Posts: 60
    • View Profile
Re: [Mod][0.14.x] ScrapyardPlus (v1.3.1) *now with lifetime licenses*
« Reply #14 on: October 10, 2017, 03:11:32 AM »
Sweet, that looks nice. I'm assuming it remotely gives Orders to Captained ships? Is there any way it could be combined / interfaced with by the FleetControl mod? It's the first mod I installed for this game and I don't know if it's first girlfriend nostalgia syndrome or something, but I'm super madly enjoying having *it* as the interface to my cronies rather than the "find ship somewhere in this godforsaken Sector full of distracting clutter...>press F...>find the option Orders...>select Order...>rinse and repeat 15 times for all my other ships... ugh." methodology of vanilla Avorion.

Also I was not aware of the fact that they'd already implemented the change in Sector keep-alive behaviour that they've been promising / looking forward to adding as a feature in the game. That's great news.

But it's still far away from getting done / I'm busy with RL or ScrapyardPlus
What is RL? Real Life? Rural Lollygagging? Reticular Larson (god I hope not!)?

EDIT:
Avorion was just updated and I diffed some files just to be sure. Looks like scrapyard.lua in data/scripts/entity/merchants had some rework, according to this diff I made.

I don't know what that means for your mod specifically - just thought I'd point it out.

EDIT II:
Just had a more in-depth comparison of the two versions of scrapyard.lua, the old one the mod is based off of and the newly updated one. It looks at surface level as if not too much has changed, just some Faction logic to differentiate Alliances from individual Players, and a new method that modifies chat messages based on whether or not you're in the Sector the message is being posted from i.e. it tells you the coords of the Sector if you're not in it, and else it's just the same message we already know from before the update.
From looking at that, it feels like it shouldn't break your mod too much. But I don't know: maybe the Faction logic actually screws over whatever you are doing behind the scenes. Check it out.
« Last Edit: October 10, 2017, 04:01:25 AM by Shrooblord »
Shrooblord