Jump to content

Aki

Members
  • Posts

    166
  • Joined

  • Last visited

Everything posted by Aki

  1. Did I say it returns table? Read again what I wrote: it returns Player.... I even made that bold. Look at the code I gave you and notice {}. If you catch vararg without {} into a variable (local players = Server():getOnlinePlayers()) then you will get only first Player object, which is of type "userdata".
  2. That's an issue if it returns it separated with spaces. Should be submitted as bug, I would say. Let's pretend for a moment that it will work with a player name (it used to; it doesn't now). I don't see a problem with that. Player is bound to a name for single session on server (heck, even for a game session as it doesn't refresh). So as long as one doesn't want do remember player name (why would you want that in the first place? use index/id instead then get player name with it from faction object) it should be a good solution. It is written in documentation what it returns: function Player... getOnlinePlayers(), so basically: local players = {Server():getOnlinePlayers()} -- table of Players (Player object) If getPlayers doesn't work properly try playing with it around as much as you can and also submit it as a bug if you are sure it doesn't work. By the way it would be nice to have meta __type set up for various userdata (there are some projects that actually did that and it is quite lovely to deal with), but I guess that's just my small wish.
  3. Read whole point before doing anything. Following dots on file paths and names are due to sentence structure, ignore them. [*]Clean-up if you installed it. [*]Download first file from the first post: this one. [*]Move that file to <Avorion>/data/scripts/commands/. Make sure that name is crew.lua. [*]Download second file from the first post: this one. [*]Move tat file to <Avorion>/data/scripts/player/cmd/. Make sure that name is crew.lua. Note that cmd directory might not exist - create it if needed. [*]That's it. Test it with example provided in first post. If you still have problems then press single-quote (') or tilde/backquote (~/`) to open up console. Make a screenshot and post it if there is anything interesting in it.
  4. Aki

    [Mod] /disttocore

    Point is I wanted you to add it so it will remain your contribution in commits. ;) Or, I think, I could rip it from your repository along with your commits, heh.
  5. Aki

    [Mod] /disttocore

    Again, the same case as with /agoods. With few changes I would gladly accept pull request with this command for the package. You will be listed as an author along with e.g. me and your command will be accessible easier through single package (when the Steam Workshop support will come out).
  6. Nice, I would love to make it part of my package. It never meant to contain scripts made solely by me. It uses similar construction, so I guess we could easily put it in. What do you think? Just open pull request with your additions: https://github.com/nthirtyone/avorion-scripts
  7. era5or, Charging players for use would be simple. Well, changing faction standings shouldn't be an issue either, but we already have version of this script that allows players only to change home to sector with friendly or own station. I think we should go in this direction. We are just waiting with this version for alliance update which will most likely change some of faction-related stuff. For charging in data/scripts/player/cmd/sethome.lua: local price = 1000 if player:canPayMoney(price) then player:payMoney(price) --change home sector, lines 5,6 end Or similar.
  8. Avorion\data\scripts\sectors\asteroidfield.lua: 50 for i = 1, numAsteroids do 51 local mat = generator:createAsteroidField() 52: local asteroid = generator:createClaimableAsteroid() 53 asteroid.position = mat 54 end Avorion\data\scripts\sectors\asteroidfieldminer.lua: 46 for i = 1, numAsteroids do 47 local mat = generator:createAsteroidField() 48: local asteroid = generator:createClaimableAsteroid() 49 asteroid.position = mat 50 end Avorion\data\scripts\sectors\functionalwreckage.lua: 51 for i = 1, numAsteroids do 52 local mat = generator:createAsteroidField() 53: local asteroid = generator:createClaimableAsteroid() 54 asteroid.position = mat 55 end Avorion\data\scripts\sectors\loneconsumer.lua: 69 for i = 1, numAsteroids do 70 local mat = generator:createAsteroidField() 71: local asteroid = generator:createClaimableAsteroid() 72 asteroid.position = mat 73 end Avorion\data\scripts\sectors\loneshipyard.lua: 62 for i = 1, numAsteroids do 63 local mat = generator:createAsteroidField() 64: local asteroid = generator:createClaimableAsteroid() 65 asteroid.position = mat 66 end Avorion\data\scripts\sectors\lonetrader.lua: 62 for i = 1, numAsteroids do 63 local mat = generator:createAsteroidField() 64: local asteroid = generator:createClaimableAsteroid() 65 asteroid.position = mat 66 end Avorion\data\scripts\sectors\lonetradingpost.lua: 61 for i = 1, numAsteroids do 62 local mat = generator:createAsteroidField() 63: local asteroid = generator:createClaimableAsteroid() 64 asteroid.position = mat 65 end Avorion\data\scripts\sectors\miningfield.lua: 89 for i = 1, numAsteroids do 90 local mat = generator:createAsteroidField() 91: local asteroid = generator:createClaimableAsteroid() 92 asteroid.position = mat 93 end Avorion\data\scripts\sectors\pirateasteroidfield.lua: 60 for i = 1, numAsteroids do 61 local mat = generator:createAsteroidField() 62: local asteroid = generator:createClaimableAsteroid() 63 asteroid.position = mat 64 end Avorion\data\scripts\sectors\piratefight.lua: 64 for i = 1, numAsteroids do 65 local mat = generator:createAsteroidField() 66: local asteroid = generator:createClaimableAsteroid() 67 asteroid.position = mat 68 end Avorion\data\scripts\sectors\resistancecell.lua: 58 for i = 1, numAsteroids do 59 local mat = generator:createAsteroidField() 60: local asteroid = generator:createClaimableAsteroid() 61 asteroid.position = mat 62 end Avorion\data\scripts\sectors\smallasteroidfield.lua: 66 for i = 1, numAsteroids do 67 local mat = generator:createAsteroidField() 68: local asteroid = generator:createClaimableAsteroid() 69 asteroid.position = mat 70 end Avorion\data\scripts\sectors\wreckageasteroidfield.lua: 51 for i = 1, numAsteroids do 52 local mat = generator:createAsteroidField() 53: local asteroid = generator:createClaimableAsteroid() 54 asteroid.position = mat 55 end Avorion\data\scripts\sectors\xsotanasteroids.lua: 65 for i = 1, numAsteroids do 66 local mat = generator:createAsteroidField() 67: local asteroid = generator:createClaimableAsteroid() 68 asteroid.position = mat 69 end Avorion\data\scripts\startsector.lua: 48 -- create a big asteroid 49 local mat = generator:createAsteroidField() 50: local asteroid = generator:createClaimableAsteroid() 51 asteroid.position = mat 52 16 matches across 16 files You can start with this list. In most cases spawning claimable asteroid is a result of rolling `numAsteroids = math.random(0, 2)`. Then there is startsector which will always have one. Sadly, there is no global setting for that, but I think it would be worth adding along with others, like "Big asteroids probability", "Asteroid fields amount" etc. to customize generation process not just by seed.
  9. Currently no, sorry, I want to add it asap but if there is someone who want to do it, then I'm open for any contribution. Yeah, it is a little bit more complicated than /inventory, because you need to create/have squadrons beforehand, but after that it should be quite similar. Make sure you have pasted all files in correct directories. Note the player/cmd/ path.
  10. Actually. You can! With built-in Lua functions (loadfile, dofile). For instance: <avorion>/data/scripts/test.lua: return 1 In chat: /run loadfile("data/scripts/test.lua")() Prints in console: 4
  11. From /run help: This command runs the string following '/run' as a lua script. So basically you can get it script running like this: /run for _,s in pairs({"a", "b", "c"}) do print(s) end This will print in console: a b c
  12. Frustration is escalated only by your own behaviour. Shulrak's answer was a valid one. Your second post was overreacted and even if you think it wasn't - there are no excuses for using profanity on forums. Any further discussion and your last comment are obsolete. Locking thread.
  13. drew4452862 Do not use profanity and do not insult other users so openly. If you are asking for help then do it with a proper language. Consider it your first warning.
  14. No, it is a custom directory, so you are not missing anything. Just create it, path must be exact. Currently that is not possible, sorry. It is not yet implemented but it should be added really soon. Currently you can only add crewmen of default experience.
  15. Scroll a bit it was answered on this page and on previous pages, too.
  16. Just add /sethome for usage for players in default group in admin.xml file (located in galaxy root directory).
  17. Could you be more specific? Are there any bugs in console? Is there any response from the server when you use it? There are merged into /inventory. You can see all available upgrades with /inventory available upgrades.
  18. Added /price. I wasn't able to reproduce it, could you explain it a little bit more? I have build over 10 ships and filled them with crews. All of them took orders and executed them.
  19. Hey there, Please specify subject in thread name next time.
  20. and Sorry for that, update script and it should work as intended.
  21. Aki

    Linux Server Guide/Script

    It is there already, though. In first step. I haven't ran into this issue, but did you try running it without manager? Does the same issue occur? If yes, did you try validating server files with steamcmd? Check if server's root has steamclient.so and steam_appid.txt. Check if bin/ has libsteam_api.so (more likely client issue rather than api, but still try it).
  22. Make sure you have installed both mods correctly: It means that you have newest inventory.lua file in your data/scripts/commands and you have overwritten data/scripts/systems/miningupgrade.lua with Kane's version of it. Once you have done this, then simply type this in chat: /inventory upgrade mining exotic Or choose any other rarity.
  23. As far as I remember you use nix, so: http://www.avorion.net/forum/index.php/topic,642.0.html with cron: 0 0,6,12,18 * * * avorion <path>/manager restart 55 23,5,11,17 * * * avorion <path>/manager warning 5 50 23,5,11,17 * * * avorion <path>/manager warning 10 45 23,5,11,17 * * * avorion <path>/manager warning 15 Or similar. You could also probably adjust your own script for that.
  24. If you have overwritten old script with the new one, then you can just use: /inventory upgrade mining legendary
  25. Just found it (how didn't I do that at the first attempt, kek?): Player().selectedObject It is a property so assign value if you want to change it. It is only available on client-side.
×
×
  • Create New...