Avorion

Avorion

Playerless Events
34 Comments
Shadow 30 Aug, 2022 @ 7:26pm 
I love this mod. Please update.
LumberingTroll 7 Sep, 2021 @ 2:29pm 
Would very much like this to be updated to 2.0 when you have the time.
Sawex 13 Feb, 2021 @ 11:47am 
can you update ?
Shadow 31 Dec, 2020 @ 4:34am 
update plz. doesn't work anymore
KimjonIl 5 Dec, 2020 @ 2:15am 
has this been updated?
Maxadam 29 Nov, 2020 @ 12:30am 
In MP:

T: 11
Object: 6Sector
Execution Context (inner to outer):
#0: PlayerlessEvents.update F:\AvorionData\Mine_galaxy\workshop\content\445220\2030638849\data/scripts/sector/jceventscheduler.lua

could not execute function 'PlayerlessEvents.update' in '"F:\AvorionData\Mine_galaxy\workshop\content\445220\2030638849\data/scripts/sector/jceventscheduler.lua"':

F:\AvorionData\Mine_galaxy\workshop\content\445220\2030638849\data/scripts/sector/jceventscheduler.lua:121: attempt to index a nil value
stack traceback:
F:\AvorionData\Mine_galaxy\workshop\content\445220\2030638849\data/scripts/sector/jceventscheduler.lua:121: in function 'validSector'
F:\AvorionData\Mine_galaxy\workshop\content\445220\2030638849\data/scripts/sector/jceventscheduler.lua:203: in function <F:\AvorionData\Mine_galaxy\workshop\content\445220\2030638849\data/scripts/sector/jceventscheduler.lua:200>
LumberingTroll 17 Nov, 2020 @ 8:44am 
Please update, love this mod otherwise!
Timoruz 30 Sep, 2020 @ 8:34am 
Would love a 1.14 update
James Steiner 13 Aug, 2020 @ 9:59pm 
Heya my dude. It would appear that 1.1.4 doesn't like this mod at the moment. Just a heads up.
MachoNatchoMan 16 May, 2020 @ 12:01pm 
hello, i run this mod on my server and i have an issue with suppression satellites, they just quite simply do not work, at all. (i know they only block all but one event but it's more than that one event that happen, xsotan, pirates, you name it)

wondering if you may have any idea as to what could be causing this. i must admit.. i do run the server with 99 other mods, exactly.. so i expect it to be a compatibility issue but i just want your opinion if you will give it :)
FloranFan24  [author] 14 Apr, 2020 @ 11:47am 
@TehFishey Thank you reporting this! I just released a patched that should fix this.It was being caused by ships either warping out, or not being destroyed by normal means, which caused it not register in the script, meaning the event would still continue even if there were no more Xsotan/pirate ships, but hopefully that should be fixed now. I also added a new command /eventsectors that will tell you exactly what sectors are experiencing an event. I'm glad you are enjoying the mod, and as always feel free to report any other bugs or suggestions you may have for the mod!
TehFishey 13 Apr, 2020 @ 9:51pm 
So, first off, thank you for the mod! We run it on a multiplayer server and it's really changed the way that we play the game (much for the better, I think!)

We've been having some issues since the recent update, however; it seems that random events aren't spawning in non-player sectors at all anymore. I suspect that it might be that an attack is still in progress either in an unloaded sector or one where a player ship died previously, thus preventing any new events from happening. Are there any debug commands/logs in the mod that can check what events are currently in progress? Alternatively, do you think that re-installing the mod or doing something else along those lines may fix the issue?
FloranFan24  [author] 31 Mar, 2020 @ 5:46pm 
No problem, I need to learn to some better coding practices anyway and be a little more neat with it.
FuryoftheStars 31 Mar, 2020 @ 12:46pm 
Ok, I just did some research on it. Looks like Notepad++ isn't handling block commenting for lua correctly. :/ Sorry about that. Yeah, I noticed that it was line 47's --[[ that was causing it.
FloranFan24  [author] 31 Mar, 2020 @ 12:39pm 
In Atom it looks fine, I opened Notepad++ and it does look all commented out like your screenshot, but in game it functions just fine. The second "--[[" is what is causing, deleting the one inside the initialize() will make it appear as normal.
FuryoftheStars 31 Mar, 2020 @ 12:18pm 
Here's a quick snapshot of what I see:
https://imgur.com/a/VlBD71o
FuryoftheStars 31 Mar, 2020 @ 12:16pm 
Are you using a text editor with context/syntax highlighting, like Notepad++? Cause when I look at that file, everything after "if onServer() then" is in green lettering, indicating it's been commented out (using Notepad++).
FloranFan24  [author] 31 Mar, 2020 @ 12:10pm 
@FuryoftheStars The only function commented out is the initialize(), which adds nothing to gameplay and that is only used for testing and debugging purposes. Also likewise the random():test() may not have worked because I had tested it in the init function with a for loop that iterated a hundred times to check the probability. Just to be on the safe side I'll stick with the current getInt() setup.
FuryoftheStars 31 Mar, 2020 @ 11:45am 
@jakecool19, hey, I've noticed in your last update that you appear to have accidentally commented out almost the entirety of the jceventscheduler file. You have two open block comments ( --[[ ) while there's only one closer ( ]] ).

Also, looking through I see a note about random():test() not working right for you? I'm not sure why... the devs use it themselves in several places throughout their code and I haven't noticed any issues with it in the areas where it's used in my mods. Only thing I can think of, I wonder if this script only applies to newly generated sectors? IE, if you make a change to it, in order to get an existing sector to see the change, I wonder if you need to delete the sector file and let it regen?
FloranFan24  [author] 29 Mar, 2020 @ 3:09pm 
@FuryoftheStars Thank you so much for your comments, I'm new to Avorion modding so your feedback and knowledge is very much appreciated. Next update I'll fix the event utility and incorporate randomext. I'll also make the events more random and based on the number of things in the sector.
LumberingTroll 28 Mar, 2020 @ 10:07pm 
It would be awesome if it was a chance for them to attack, and that chance was based on the standing between the attacking pirate faction and the target faction. It would simulate that pirate faction going out of its way to harras its enemies.
BasiC 28 Mar, 2020 @ 11:08am 
pirate attacks should depend On some game related thing, meaning they should not just spawn randomly or at intervals but also be effected by some parameter that has to do with the game's state. Like a sector not being defended, or some other thing that would make pirate attacks make sense in the game.
FuryoftheStars 27 Mar, 2020 @ 1:03pm 
And it does, that syntax is correct (sorry for spamming your mod with comments...).
FuryoftheStars 27 Mar, 2020 @ 12:30pm 
Ah, allow me to amend one of my suggestions. The whole rand:test thing in jceventscheduler.lua I suggested should actually be random():test(value) (and add "include(randomext)" near the top), and include it in line 93's check. So line 93 could look like this (and by the way, you don't need to do value == boolean for checking true/false):

if not PlayerlessEvents.currentEvent() and random():test(0.5) then

The 0.5 gives a 50% chance.

Mind you, I haven't finished play testing to make sure my syntax was correct, but that should work. :)
FuryoftheStars 27 Mar, 2020 @ 10:59am 
(2 of 2)
In jceventscheduler.lua, right after maybe line 93, I'd recommend including a rand:test(value) check, where value is a % chance for the event to occur. If it fails (returns false), then reset the counter, otherwise play out the event. This will prevent all sectors from (more or less) having simultaneously occurring events, or always having events every 20-30 minutes. Then you can change the timer up some, too.

In this same file where you do the weight selections, if you wanted (or maybe just for future reference), you could have used the selectByWeight function from the randomext.lua file. Just need to feed it a table of weighted values (ex: {7,4,2,1,1}) and it will return you the element position of the weighted value it selected. Then you use this to select your actual event (ex: local chosenEvent = events[selectByWeight(tableOfWeights)])

Hope some of this is of use to you. :)
FuryoftheStars 27 Mar, 2020 @ 10:59am 
@jakecool19, a few comments (I've split in two posts due to character limit)

eventuility.lua, lines 14-18 should probably be removed/commented out. In its current form, if there are no players in the sector, it will just return true and bypass the other two checks for playtime and entities that are supposed to stop events from happening (such as the energy suppressors).

I don't know if there is a way or not, I haven't looked through everything enough yet, but if there is a way to detect player assets (ships & stations) vs just players, then it might be good to include a check in this same file for that. If there is nothing for player assets, then there's no point in the event (I've noticed empty sectors filling up with pirates from this...).
LumberingTroll 27 Mar, 2020 @ 3:57am 
@DecimalGuy I love the idea of making it more random, would you mind sharing your version?
DecimalGuy 25 Mar, 2020 @ 5:23am 
@jakecool19 I basically made the mod easier for me by adding another if-loop into PlayerlessEvents.update() function, so it basically takes another random number and if that number is above a certain threshold, only then will it create an attack on a sector. This tends to fix the problem of all my sectors being attacked every time :)
LumberingTroll 25 Mar, 2020 @ 12:06am 
I had an energy suppressor out and was still attacked by pirates, I am pretty sure those only work against Persecutors.
FloranFan24  [author] 24 Mar, 2020 @ 9:22am 
@DecimalGuy if you go into the mod folder and go to data/scripts/sector/jceventscheduler.lua and open it, at the beginning you should see a variable like this:
local frequency = math.random(20,30)*60
Right now it is set for an event to happen every 20-30 minutes, but you can decrease the frequency of events by increasing those two numbers. Also you can use an energy suppressor as well which should stop pirate attacks.(Not to sure about the alien ones though) As far as synchronizing the sectors so it only happens to one sector at a time, that I'm not too sure about, if its even possible.
DecimalGuy 24 Mar, 2020 @ 1:19am 
I love the idea of this, but I added it to my existing galaxy and it's a bit too much for me, as once it starts, it kind of starts in all the systems I am in at the same time and ooooh boy, am I not ready for it. Is there any way I can tweak that in the code so the events wouldn't be clumped together and events would happen one at a time instead?
I honestly love that something like this exists, but yeah, it can get to quite a lot quite quickly :D
FloranFan24  [author] 23 Mar, 2020 @ 2:40pm 
@Ariel Faye I hope its not too much. Right now it is set to start an event every 20-30 minutes and it should pause whenever a player is in the sector, or when an event is already going on. Let me know if it needs to be tweaked.

@Prokon Any feedback is much appreciated! This is my first mod, and I had made it kinda with farming in mind such as having a heavily guarded station destroy ships and salvage the remains.
Prokon 23 Mar, 2020 @ 3:58am 
anyone tested this for some feedback? Leaving ur ship on patrol sectro netting reputation?:)
Thanks
Ariel Faye 22 Mar, 2020 @ 1:54pm 
Oh talking about ramping the difficulty up. lol fun I hope the rate isn't as bad as the pirate xsotan harassment of the player. ;)