Aki
-
Posts
166 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by Aki
-
-
I have found Galaxy():getPlayerNames(), however it returns a string, not a list, of player names separated by spaces (I think spaces??). I cannot split this string as there are players with spaces in their names.
That's an issue if it returns it separated with spaces. Should be submitted as bug, I would say.
You cannot use Galaxy():findFaction() for this as player names can change in steam.
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.
Found Server():getPlayers() however it always returns nil. Server():getOnlinePlayers() seems to return a userdata object, but I can't find documentation on it's properties or functions.
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.
-
I am still having trouble with the /crew command. I read the forum and still nothing helped me out. I was wondering if you could post a small video on the downloading of this mod.
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.
-
Yes of course, feel free to add it to your package. Since i used your code it's the least i can do lol.
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.
-
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).
-
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
-
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.
-
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.
-
For the add crew...is there a way you can make it add actual professionals instead of just regular crew?
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.
Is it planned to add fighter spawning?
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.
I am having problems with the turret adding. I made the lua file and pasted it in data/scripts/commands but it does not work in game :O I tried one of the example ones in the original post and nothing happens.
Make sure you have pasted all files in correct directories. Note the player/cmd/ path.
-
oooh I see... I thought I could execute a script. Thanks
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
-
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
-
Hey Aki, spend some time helping instead of patrolling the forums for swear words. Then frustration won't escalate so high.
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.
-
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.
-
For the second command, I do not have anything referring to /cmd anywhere in the player folder, the only folders within player is a mission folder and a story folder. Do I need to make a folder and label it cmd? or am I missing something with the file?
No, it is a custom directory, so you are not missing anything. Just create it, path must be exact.
So with the /inventory turret script, is there any way to control what bonuses the turrets get? For example, is there a way to make sure the rocket launchers get the seeker bonus? Also, what exactly is the use of the available function? I mean, it's nice knowing what all you can make legally in system, but how does that function have any use when you can spawn what you want? Or does that in some way tie into my earlier question and I just don't realize it?
How I can create turret with some propeties such as accuracy, heatPerShot (and all of TurretTemplate.html)?
Currently that is not possible, sorry.
/crew dont work :(.
if i take: /crew add mechanic he add a unlearnet man but no special mechanik. normal people dont lvl :(. its for other, too
It is not yet implemented but it should be added really soon. Currently you can only add crewmen of default experience.
-
having problem with /sethome command , it can be used only by admins , but not regular players ,.. any idea how to fix it ?
Scroll a bit it was answered on this page and on previous pages, too.
-
i got a quick question i got the /sethome script in the right folders and it works for me (admin) just fine but all other players have issues using /sethome.
First: how can i add players in a setup group ?
Just add /sethome for usage for players in default group in admin.xml file (located in galaxy root directory).
-
The crew command for me seems to be completely broken but everything else works perfectly.. When trying to add crew, it just does nothing at all for me. I've also tried every single combination of the crew command, still nada.
Could you be more specific? Are there any bugs in console? Is there any response from the server when you use it?
am i going crazy or was there a list of the /turret and /system commands here ?
what were the name of the systems again :(
There are merged into /inventory. You can see all available upgrades with /inventory available upgrades.
-
Request: command for showing price (money and minerals) of currently boarded ship. Would be useful for those who like to plan ships in creative mode.
Added /price.
edit: I am not sure. But I think the code for the crew has a problem.
Sometimes we can have a captain in each ship, but this one does not execute orders. I change ships or reverse the captains, and the problem remains.
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.
-
Hey there,
Please specify subject in thread name next time.
-
Really liking the idea of the /sethome command, although when I try to use it in game it says "You can only do that in a home sector" Confused, I thought the point of the mod was to set a sector to a home sector?
Same problem as LeRougePanda
and
I'm getting this error atm. Linux server.
could not execute function 'initialize' in '"data/scripts/player/cmd/sethome.lua"': data/scripts/player/cmd/sethome.lua:28: attempt to perform arithmetic on a string value stack traceback: data/scripts/player/cmd/sethome.lua:28: in function <data/scripts/player/cmd/sethome.lua:3> Setting script "data/scripts/player/cmd/sethome.lua" to invalid.
Sorry for that, update script and it should work as intended.
-
You should add that "tmux" program has to be installed before starting the "manager".
It is there already, though. In first step.
Any idea what the problem is ?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).
-
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.
-
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.
-
Hi,
How would I make this work with the mod "Mining System/Module" Balance Changes. - Increases The Distance so I can generate the increased efficiency mining laser by using the /inventory command
If you have overwritten old script with the new one, then you can just use:
/inventory upgrade mining legendary
-
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.
[Help] Getting a list of player names on the server to match to IDs
in Mods
Posted
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".