Jump to content

Splutty

Members
  • Posts

    258
  • Joined

  • Last visited

Posts posted by Splutty

  1. When the game is busy initializing your ship and player data, it can take a long time.

     

    I have a rather crazy beast of a machine, but when my player had 4300 unique items in its inventory, it wouldn't load in for me either.

     

    If the game is working on a specific task (generally things like traversing tables, or sorts), then it won't respond to the queries Windows tries to see if it's still alive (the rotating blue circle thing if you're running Aero).

     

    That means that Windows thinks it's dead, while instead it's just really busy.

     

    Hence my advice to ignore windows. Unless and until your client log actually shows a crash, or the game disappears from the task manager, it's not dead yet.

     

    You can also check in the task manager if it's using up CPU cycles.

     

    Some of the loading stages look an awful lot like the game is hanging.

  2. One thing I've been noticing is that the AI doesn't use the different docking ports while docking to a station.

    They seem to use the same docking port and pathfinding, even multiple ships at once.

    This leads to them crashing into eachother and the station constantly.

     

    Suggestion for a fix would be to detect if a port is not obstructed, then make a path to it and occupy that port.

    Next ship that comes in checks if that dock is obstructed, if so look for another port and then make a path.

     

    I've been trying to rewrite dock.lua for this, but it's not as easy as I'd hoped. lol

  3. If you start your server standalone, you can run commands from the console.

     

    Make a backup before running this (obviously).

     

    (Edit: Default location: %APPDATA%\Avorion) but I think you'd already found that one since you posted the galaxy :)

     

    This is the command I use to start a galaxy:

    bin\AvorionServer.exe --galaxy-name dedicated_server --server-name "Splutty's Server" --datapath g:\games\avorion\servers --max-players 10 --use-steam-networking 1

     

    galaxy_name should be the name of your single player galaxy, datapath you probably don't need if you have it saved in default, server-name is what shows up when you search for it.

     

    This script will remove ALL items from your ship's inventory that are blue or lower quality:

    /run player=Player(1); inv = player:getInventory(); inventory = inv:getItems(); for k,v in pairs(inventory) do i = inventory[k].item; r = i.rarity.value; if (r < 3) then inv:removeAll(k) end end

     

    The 1 in Player(1) is the number of your playerfile. Which if it's single player, should be 1 :) But you can check in your galaxy's 'players' directory.

     

    I take no responsibility for you completely destroying your galaxy, blowing up the ship's cat, or getting lost in a Hawking Hole.

     

    This helped for me when I had 4300+ unique items in my ship's inventory, and I couldn't load in anymore.

  4. Thanks, I'm going to the finish.. gradually.

     

    I'm trying to add some custom variables that're accessible after restart to the all Stations and Ships made by players in the sector. So I think I should  do all checkings and attach script in the Sector's "onEntityCreate" callback or in defaultscripts.lua.

    But then I need to access this local script variables in some vanilla scripts, that were attached to this ship/station too.

     

    I don't think that variables from one attached script are visible to another attached script. Because it shouldn't be. So I think to complete my first mod for this game I just need to understand how people use variables from attached scripts anywhere.

    Maybe its something related to 'require', but I don't need to require a whole script again.

     

    I'll try to search in existing mods again.

     

    You can check my haulgoods.lua script in http://www.avorion.net/forum/index.php/topic,2896.0.html

     

    It calls functions in the same script in other objects and has some simple things in there to check/test/set/return values in other objects.

     

    Basically you make functions in the object that set or return the values in that object.

     

    Example to set or get the debuglevel in an object that's running my script:

    function getDebugLevel() return debugLevel end
    function setDebugLevel(arg) debugLevel = tonumber(arg) end
    

     

    Which will set the global debugLevel in the script this function is called in.

     

    Called like this:

    local retval, level = ship:invokeFunction(haulscript, "getDebugLevel")
    

    local retval = ship:invokeFunction(haulscript, "setDebugLevel", debugLevel)
    

     

    You need to let go of the C++ type OOP implementations, where "object" is just the name of a blob of code, and start thinking as objects being *actual* objects, like a ship, or a station, or a sector.

     

    To find all ships in a sector, you will call a function in the sector that will return a list of ship objects. Each of these ship objects have a number of scripts attached to them that will have certain functionality. In my example, "haulscript" is the global variable I've defined that contains the definition of the script that provides the setDebugLevel and getDebugLevel functions for JUST that script.

     

    local haulscript = "data/scripts/entity/ai/haulgoods.lua"

     

    Another script can have exactly the same functions, but will still only work in the context of that script attached to that specific ship object.

     

    Within the script, Entity() will be the object it's attached to.

     

    There is a lot of function documentation (very unfinished) in the Documentation folder of your Avorion install.

     

     

  5. Have been playing around more with your mod and have an idea regarding point 2.

     

    For number 2, yes. If it's bought things and gets interrupted, then depending on who's the actual dispatcher and at what point it picks up again, it won't sell it. I've tried to alleviate this problem somewhat by making it so the hauler tries to sell everything if there's more in the cargo bay than what was originally planned, but that doesn't always work either.

     

    Might an if check which looks for what the hauler has in its cargo and all the things it can sell in the sector before it starts doing trade routes alleviate the problem?

     

    I must confess, i havent looked at your script yet. And after i am done doing these trade runs, i will have a look  8). if i have better ideas, i will let you know.

     

    It might, but that's not really what the mod was for :)

     

    I've thought about building in a 'recovery' mode, which saves and loads what it was doing last and tries to continue doing that, but haven't gotten around to that yet.

     

    I mainly built all this for my own sector with my own factories, so it's not really very multi purpose. It will work in a sector where you can do trade between NPC stations as well, since that was only a small adjustment to make.

     

    A bigger problem is ships getting stuck on each other when they're at the same docking port. Since getting a 'random' docking port doesn't seem to be random at all :)

  6. Hello, I and some of my friends have been trying to get into the game. Its really cool so far but there are a few problems we've run into. The main one is we can't add admins. It is just a normal multiplayer game, we join on one another through steam. The host tries to put in the add command and nothing works. Could someone help?

     

    The hoster should already be an admin, and can add admins from in-game.

     

    List and examples (most likely already outdated :):

     

    https://steamcommunity.com/sharedfiles/filedetails/?id=852704603

     

  7. This question comes up every so often. No. There isn't. Which is a good thing, because editing that file and getting strange behaviour in an EA game.. Not good.

     

    You won't be able to distinguish what's caused by your meddling and what's an actual bug.

     

    Most of the editing you'd want to do, there are in-game tools for to begin with.

  8. Alrighty Bois I have some problems with my server for Avorion, It seems to hang at regular intervals

    This seems to happen almost randomly regardless of whats happening on the server itself.

    1 minute your trading the next minute all the ships in that sector become ballerinas,

    The Problem itself seems to persist with or without any mods big or small.

     

    I would like to know if anyone else has this issue

     

    https://puu.sh/v6Yub/5acdea3ea8.png

     

    Of course I understand that the mods might be the issue but I would like to know if anyone else has experienced something similar,

     

    Thanks

     

    p.s Anyone else eagerly awaiting the Alliance update ;)

     

    Aha. That looks suspiciously like a similar 'just hang' that was fixed in the last patch. This might be on unloading a sector? In which case, if a mod gets into an eternal loop, this would explain the error and the hanging of the server.

  9. Nope. Neither affects the other really. Since the only traderoutes currently in existence are actual players.

     

    NPCs don't trade, they just randomly buy and sell.

     

    And if you, as a player, buy 500 somethings from a station, then jump out, those 500 somethings will never be replenished (unless you run a mod like OutOfSector Production)

     

    From what I understand, all this is in the planning to do, but there are some mods that solve this issue.

     

    The game itself however doesn't provide a reliable way for NPC traderoutes, or for that matter, PC traderoutes.

     

    I wrote a mod that will run traderoutes within one sector (mainly because I have a sector with 30 of my factories/farms/etc in it), but it's impossible to do it across multiple sectors for now.

  10. Hi. Before trying this mod I need to ask: Does this simulate only player-traders from Goods Hauler out-of-sector? It doesn't work for vanilla NPC traders?

     

    Traders have nothing to do with this mod. The only thing this mod does is check the factories when you warp in, and based on the time passed since your previous warp in, determines whether factories need to have produced something in the meantime (which they won't have, since they weren't actually loaded due to game mechanics).

     

    It then adjusts the values of all the trade items in the factory to reflect the status as it should be.

  11. Short answer: They're random scripts being spawned.

     

    Long answer: At random a hauler is spawned, which will check all stations in the sector it's spawned in, pick one and pick a good, and then either buy it or deliver it. That's how you get Coal when Coal doesn't actually exist anywhere.

     

    Complicated answer: data/scripts/sector/traders.lua

  12. ...and that's where I get in over my head with all the coding stuff.

     

    The 5 minute rule is good info, I'll make sure to allow that to pass before re-attempting any commands...

     

    However how does one leave the sector if the ship won't follow me out..?

    Is it a case where only I have to leave for the appointed 5 or so minutes..? (leaving the captain behind)

    There's always something else I can go do for a bit when I reach the point of heading onwards, upwards and ho to greener pastures and better metals. I can waste 5 minutes EZ...

     

    As for the rest, I don't build in systems where I'm not universally revered as a savior of the people and bestest buddies with all things I pass by in the system.

     

    I also ignore Aliens when they're purple (lavender???) when I'm doing other things. It bugs me that any stray shot will turn them instantly red, which is what kept happening today. I'd let the Xeno warrior princesses be for awhile and then Pirates would show up again. I'd build a bit while being fired upon, but eventually you just have to shut them up and then the Aliens suddenly perk up and feel the sudden need to come over and introduce themselves, show off their big guns and whatnot...

     

    I'd really like to have some of the more populated and patrolled home systems free from the endless cycle of wave after wave of cannon fodder. I'd also like to see bigger waves hit the outlying sectors harder... Part of the "terror" of a game like this is mixing things up a little instead of a constant grind. I'd like to have to actually pack up and run once in awhile as much as I'd like the chance to set a spell and build a little. Takes both to make it interesting IMHO.

     

    Anyway, approaching TMI limitations... Thanks for the help.  :)

     

    Cheers..!

     

    For the coding part: Once a script in a ship has failed, it won't be re-enabled unless the whole ship is reloaded.

    In normal speak: If you leave a sector for 5 minutes, it'll be removed from memory, which means that when you jump back in, it'll be completely reloaded, including the buggy ships, which will then have all their commands back.

     

    For aliens vs pirates. If you just let them go, the aliens will kill the pirates. Just dodge the pirates until the aliens have killed them :)

     

    Once your ship stops responding, you can hit ' (quote) and you'll get the top half of your screen as debug output. If there's a notice in there relating to a ship, you can safely assume it bugged out on you (quote again to close that screen).

     

    If you play in single player, it might be quicker to just restart the game than do the 5 minute thing.

     

  13. I find it strange that shields stop lasers and cannon shots but not ramming damage... This would save everyone a lot of pain when docking and when a ship decides to ram you because if it's high level collision avoidance AI that would never ever allow accidental friendly ramming in combat. Sarcasm.

     

    It's a well known nautical rule that as a little ship, you better get out of the way of that oil tanker :D

     

    On the shields part, not at all strange. Deflection light or projectiles is on a whole different level than deflecting either an enormous station mass or a whole ship.

     

    I personally have just dialed back collision damage to 0.25 and that seems to work. You still get damage if you hit something, but at least you don't blow up straight away in most cases.

  14. look at the pic. you can actually see that the turrets are floating in the middle of nowhere

     

     

    i had a similar issue once, but it never appeared again so i thought it was something on my side. good to know thats not the case

     

    Okay. Now that you mention it, I can just about make out the turrets. lol

     

    And that's bizarre behaviour!

     

    Does it go away when you quit building mode, or do they just keep floating?

  15. This is something I've been wondering about as well, whether it's possible to put the 'needed crew' as something actually in relation to what your crew at that moment is.

     

    As you've noticed, right now it just takes 1 crew 1 slot, and doesn't take into account any training for any crew.

     

    You can still open the ship menu in build mode to see what the actual numbers are, but it would help if it showed in the build menu itself.

  16. Thanks for the mod. Was hoping for something like this to improve the station building aspect of the game. I can test it out cause I am playing in Rustys Galaxy and we recently got it there. I tried it out a little (for like 20 to 15 mins on  the server) and i have a suggestion: a command that forces trade with only player owned stations (or non-npc stations). I built liquor chain in a sector with tradepost that bought wheat. The little bugger was always selling it to the tradepost.

     

    Of course! That's where it can actually earn money  ;D

     

    I also built in a check where it only transfers the largest amount possible. So if 1000 is needed somewhere, and a station sells 500 and another 100, it'll always pick the 500.

     

    I'll have to think about how to implement a limitation on what stations it's allowed to visit.

     

    I found 2 issues:

    1. The haulers tend to collide with ai ships already docked at stations. sad for rep.

    2. One of the hauler had a cargo bay filled with lots of power cells that *I THINK* it wasnt selling. but that maybe due to the fact that it had bought it and there was a server restart in between. not sure.

     

    As to 1: There's not much I can do about that :( I've had NPC haulers squish my ships as well, and when I'm running 3 of them at once, they squish each other. The 'get a docking port' routine seems to always pick the same one, so everything piles up there.

     

    I've been messing around a bit with the dock code, but I'm not sure if I can fix it in such a way that it doesn't affect a lot of other things. And I can't fix the 'playership getting crushed' issue at all.

     

    For number 2, yes. If it's bought things and gets interrupted, then depending on who's the actual dispatcher and at what point it picks up again, it won't sell it. I've tried to alleviate this problem somewhat by making it so the hauler tries to sell everything if there's more in the cargo bay than what was originally planned, but that doesn't always work either.

     

    For those things, there's still some manual intervention required, unfortunately.

     

    Thanks for using it and posting the issues :)

  17. 2017-03-31 13-10-21| error constructing Entity: Entity with index 2365 doesn't exist at [C]:-1: in function Entity

    2017-03-31 13-10-21| data/scripts/entity/ai/salvage.lua:145: in function ?

     

    And that's where your ship stopped responding to commands.

     

    I've had similar issues with a script failing, and the ship completely stopping or just endlessly continuing the last command.

     

    Reloading the sector works to fix that (jump out, wait for 5 minutes, or whatever you unload time is, jump back in).

     

    If you check your console log, you will almost certainly see an error there when you run into this issue again.

     

    And I actually do my ship building in one of my friendly faction's home system, which has plenty of defenders and I never get attacked by anything :)

     

     

    Also "Attack Enemies" won't do anything when you only have aliens, since they're not the enemy unless you actually fire at something.

     

×
×
  • Create New...