Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Aki

Pages: [1] 2
1
Bugs / Find player faction by name
« on: January 27, 2017, 07:24:24 PM »
In commands scripts currently it works like this (in this example my player is id 1):
Galaxy():findFaction(1) returns Faction of Aki,
Galaxy():findFaction("The Uhvoocgjoiqt Church") returns Faction of that Church,
Galaxy():findFaction("Aki") returns nil
Galaxy():findFaction("76561198082681701") returns nil
Galaxy():findFaction(Player(sender).name) returns nil

I have tried it with Player() in scope it was available:
Galaxy():findFaction(Player().name) returns nil

I'm pretty sure I could use it previously with player name as faction name.

2
Avorion Community Commands Package
This mod is currently outdated, please use it with caution.
Sadly for now I don't have enough time to sit down and release new version of this package, sorry. I'm planning to update it but the date is unknown.

Description:
This package contains commands for use of server administrators and general use of players. All commands are meant to be server-side only to avoid incompatibility with clients and make it easier to install and use on servers.

Package repository is hosted on github. We are open for any kind of contribution. Further details available on github page.

Commands:
/crew
Adds or removes crew to currently boarded ship. Usage:
/crew help or /crew for help
/crew add <profession> [rank] [level] [amount]
/crew fill
/crew clear


/inventory also: /inv
Modifies inventory of a player. Usage:
/inventory turret <type> [rarity] [material] [tech] [amount]
/inventory upgrade <script> [rarity] [amount]


/price
Prints price of currently boarded ship. Usage: /price

/sethome
Allows player to change home sector to current if friendly or own station is present. Usage: /sethome

/whereis
Gets the position of a player. Usage: /whereis <name>

/list
Lists possible variables for /inventory or /crew. Usage:
/list <type>
/list help or /list for help.


/agoods
Adds goods to currently boarded ship. Usage:
/agoods <good name> <quantity>

Must capitalize all names
Must replace spaces with _(underscore)
Can not add more then your hold can handle


/agood Steel 100
/agood Steel_Tube 10


/fighter
Adds a fighter to the payers hanger. Usage:
/fighter add <weapons> [rarity] [material] [tech]


Files:
Code: [Select]
scripts/
├───commands/
│       crew.lua
│       inv.lua
│       inventory.lua
│       list.lua
│       price.lua
│       sethome.lua
│       whereis.lua
│       agoods.lua
│       fighter.lua

├───lib/cmd/
│       common.lua
│       materials.lua
│       professions.lua
│       ranks.lua
│       rarities.lua
│       upgrades.lua
│       weapons.lua

└───player/cmd/
        crew.lua
        price.lua
        sethome.lua
        tellposition.lua
        whereis.lua
        agoods.lua
        fighter.lua

Installation:
You can download current package from GitHub: download link.
Once you have downloaded and unpacked, move scripts/ directory into your <Avorion>/data/ directory.

If you plan to host a public server with some of these commands available for players/moderators/other groups, you will need to configure admin.xml located in your galaxy root directory.

If you want you can clone it into <Avorion>/data. and then use git for updating.


Suggestions for new commands, feedback, bug reports or pull requests are welcome. Enjoy!

3
Bugs / Disconnecting time out.
« on: January 24, 2017, 02:54:14 PM »
Server start:
Code: [Select]
Tue Jan 24 10:03:38 2017| Avorion server Beta 0.10.1 r7302 running on Ubuntu 14.04.5 LTS starting up in "~/.avorion/galaxies/FreshGalaxy"
Tue Jan 24 10:03:38 2017| CPU: Intel(R) Core(TM) i7-4790K CPU @ 4.00GHz 8 Cores
Tue Jan 24 10:03:38 2017| name: Persistent Vanilla
Tue Jan 24 10:03:38 2017| seed: VGrFTZZgEi
Tue Jan 24 10:03:38 2017| port: 24000
Tue Jan 24 10:03:38 2017| max online players: 30
Tue Jan 24 10:03:38 2017| save interval: 1200
Tue Jan 24 10:03:38 2017| broadcast interval: 5
Tue Jan 24 10:03:38 2017| max loaded sector time: 300
Tue Jan 24 10:03:38 2017| weak update: yes
Tue Jan 24 10:03:38 2017| worker threads: 1
Tue Jan 24 10:03:38 2017| difficulty: Veteran
Tue Jan 24 10:03:38 2017| infiniteResources: no
Tue Jan 24 10:03:38 2017| collision: 1
Tue Jan 24 10:03:38 2017| access list: Blacklist
Tue Jan 24 10:03:38 2017| public: yes
Tue Jan 24 10:03:38 2017| listed: no
Tue Jan 24 10:03:38 2017| steam networking & authentication: yes
Tue Jan 24 10:03:38 2017| administrators:
Tue Jan 24 10:03:38 2017| Warning: Your server does not have an administrator assigned.
Tue Jan 24 10:03:38 2017| Starting up 1 worker threads.
Tue Jan 24 10:03:38 2017| no file "~/.avorion/galaxies/FreshGalaxy/jumps.dat" found
Tue Jan 24 10:03:38 2017| Game Port: 27000
Tue Jan 24 10:03:38 2017| Steam Port: 27021
Tue Jan 24 10:03:38 2017| Steam Query Port: 27020
Tue Jan 24 10:03:38 2017| Polling Port: 27003
Tue Jan 24 10:03:38 2017|
Tue Jan 24 10:03:39 2017| Server connected to Steam successfully
Tue Jan 24 10:03:39 2017| Server is VAC Secure!
Tue Jan 24 10:03:39 2017| Game Server Steam ID: 90106464047587328
Tue Jan 24 10:20:59 2017| OnP2PSessionRequest from 76561198038199516
Tue Jan 24 10:21:00 2017| Steam authentication confirmed for 76561198038199516
Tue Jan 24 10:21:00 2017| Authentication successful for 76561198038199516
Tue Jan 24 10:21:00 2017| Connection to player established
Tue Jan 24 10:21:03 2017| New Player registered: 76561198038199516 [Private AJ "Skippy" Hops] index: 1
Tue Jan 24 10:21:03 2017| <Server> Player Private AJ "Skippy" Hops created!
Tue Jan 24 10:21:03 2017| Creating sector at (444:-68)
Tue Jan 24 10:21:03 2017| <Server> Player Private AJ "Skippy" Hops joined the galaxy
Tue Jan 24 10:21:03 2017| Player logged in: Private AJ "Skippy" Hops, index: 1
Tue Jan 24 10:21:15 2017| player events roughly every 11.82 minutes
Tue Jan 24 10:21:15 2017| Creating sector at (447:-68)
Tue Jan 24 10:21:15 2017| Creating sector at (436:-67)
Tue Jan 24 10:26:28 2017| Tue Jan 24 10:26:28 2017| Creating sector at (437:-72)
Tue Jan 24 10:26:28 2017| Creating sector at (430:-61)
Tue Jan 24 10:28:00 2017| <Server> Player Private AJ "Skippy" Hops left the galaxy
Tue Jan 24 10:28:00 2017| Player logged off: Private AJ "Skippy" Hops, index: 1:
Tue Jan 24 10:28:01 2017| Ending authentication session of 76561198038199516
These two are flooding log all the time:
Code: [Select]
Tue Jan 24 10:27:08 2017| error constructing Player: No player with index 2000767 found at [C]:-1: in function Player
Tue Jan 24 10:27:08 2017| data/scripts/entity/ai/passsector.lua:27: in function ?
Posting these because I have seen them in other logs, too. Player indexes may vary, but they are usually above 2000000.

Disconnect here:
Code: [Select]
Tue Jan 24 13:32:19 2017| OnP2PSessionRequest from 76561198019576130
Tue Jan 24 13:32:23 2017| Steam authentication confirmed for 76561198019576130
Tue Jan 24 13:32:23 2017| Authentication successful for 76561198019576130
Tue Jan 24 13:32:23 2017| Connection to player established
Tue Jan 24 13:32:25 2017| New Player registered: 76561198019576130 [Worm] index: 3
Tue Jan 24 13:32:25 2017| <Server> Player Worm created!
Tue Jan 24 13:32:25 2017| <Server> Player Worm joined the galaxy
Tue Jan 24 13:32:25 2017| Player logged in: Worm, index: 3
Tue Jan 24 13:32:25 2017| player events roughly every 10.87 minutes
Tue Jan 24 13:39:00 2017| <> You have no sector selected.
Tue Jan 24 13:42:55 2017| <> You have no sector selected.
Tue Jan 24 13:46:53 2017| starting event convoidistresssignal
Tue Jan 24 13:47:58 2017| Player's playtime is below 30 minutes (933s), cancelling pirate attack.
Tue Jan 24 14:02:40 2017| <> You have no sector selected.
Tue Jan 24 14:07:01 2017| starting event alienattack
Tue Jan 24 14:22:59 2017| starting event convoidistresssignal
Tue Jan 24 14:23:15 2017| <> This sector is out of reach with this ship.
Tue Jan 24 14:36:23 2017| Client 76561198019576130 lost connection
Tue Jan 24 14:36:23 2017| <Server> Player Worm left the galaxy
Tue Jan 24 14:36:23 2017| Player logged off: Worm, index: 3:
Tue Jan 24 14:36:24 2017| Ending authentication session of 76561198019576130
Tue Jan 24 14:36:49 2017| OnP2PSessionRequest from 76561198019576130
Tue Jan 24 14:36:53 2017| received a message from client 76561198019576130 but it's not in the list.
>> <snip> just add here these "received a message (...)" entries here - over 20 each second <<
Tue Jan 24 14:37:03 2017| received a message from client 76561198019576130 but it's not in the list.
Tue Jan 24 14:37:06 2017| Ending authentication session of 76561198019576130
Tue Jan 24 14:38:56 2017| online players:
Tue Jan 24 14:39:07 2017| OnP2PSessionRequest from 76561198019576130
Tue Jan 24 14:39:12 2017| Steam authentication confirmed for 76561198019576130
Tue Jan 24 14:39:12 2017| Authentication successful for 76561198019576130
Tue Jan 24 14:39:12 2017| Connection to player established
Tue Jan 24 14:39:14 2017| <Server> Player Worm joined the galaxy
Tue Jan 24 14:39:14 2017| Player logged in: Worm, index: 3
Tue Jan 24 14:39:14 2017| player events roughly every 11.13 minutes
Basically what I think that happened is: Player got disconnected but continued playing and sending packets while the server already cleaned up player's session.

4
Mods / Linux Server Guide/Script
« on: January 24, 2017, 09:32:18 AM »
Script for quick server deployment on linux-based operating system.
Tested on Ubuntu 16.04, 14.04.

I don't feel like this forum's category is right for it, but eh... I could only choose between Modding and Troubleshooting. Later is for game and server software and the "guide" seems fitting but on the other hand "modding" and "custom server script" seems to go well, too. Feel free to move this thread to Troubleshooting if it seems more appropriate there.
If you have successfully run this script on any os that is not listed above then tell me, so we can expand this list together. Any suggestions are welcome, I will try to improve this script in my free time. Enjoy.

You don't need to own Avorion on Steam to use this.

  • Make sure that you have dependencies installed: lib32gcc1 (for steamcmd), tmux
  • Create new user and switch to it:

    sudo adduser avorion
    sudo su - avorion

  • Download manager (open in browser if you want to verify content):

    wget https://aki.ovh/dl/manager

  • Make manager executable:

    chmod +x manager

  • (optional) Open manager in favourite text editor and verify config.
  • Install steamcmd and Avorion Server:

    ./manager install

  • If installation is successful then you can launch server:

    ./manager start

  • Check help for more commands:

    ./manager help

FAQ:
Q: How do I see server's console and use commands?
A: Attach to it with ./manager attach.

Q: How do I safely detach from server's console?
A: Press Ctrl+B and then D.

Q: I have a "steamclient.so: wrong ELF class: ELFCLASS32" error!
A: Copy steamclient.so from linux64 to server's root. For default configuration:

cd serverfiles
cp linux64/steamclient.so .


Q: Installation/update is stuck in a loop!
A: Press Ctrl+C to stop it, then check for errors. If you can't solve them try posting them here.

5
General Discussion / Default script mismatch
« on: May 30, 2016, 07:35:16 PM »
> Doesn't feel like a suggestion or bug
> general discussion


I'm not sure if it is demo thing, limitation or something else, but when client and sever have different versions of scripts with the same name (e.g. "stationfounder.lua"), each of them are using local versions. This may result in unwanted behaviours.

Also I was wondering what will happen in full version if server will use modified default scripts and new custom scripts. Will there be some kind of validation for them, seemless/on-enter download? And what will happen to external resources (images)?

6
Suggestions / Global server settings
« on: May 30, 2016, 07:27:38 PM »
Currently all server settings are galaxy-wide. That is not really handy. Can we get global server settings (per server installation instance)?

7
Bugs / Wrecks
« on: May 30, 2016, 07:09:51 PM »
Posted in here rather than with bugtracker because I did not have time yet to test it correctly.

It might be just my feeling but Wrecks use way more system resources than asteroids. For instance few sectors running with 1000+ asteroids aren't eating the same amount of memory/cpu as 1000+ wrecks in one sector. Might it be due to fact that wrecks are more physically active? I will run some test when I will have some spare time to check it.

tl;dr

Problem is that server starts using insanely huge amounts of CPU when there is just one sector with 1000+ wrecks in it.

8
Suggestions / Holoscreens
« on: May 19, 2016, 10:55:45 PM »
Just a small and unimportant suggestion.

Actually you need to make it.

Is it possible to have hologram displaying blocks (like light block from demo) that works like the ones from Vendetta Online (or EVE Citadels)?
Mainly for displaying texts and some basic shapes. (e.g. immersive server maintenance messages, dock indicators etc. etc.)

Please,please,please. *insert cute image*

9
Bugs / Lifter Dance
« on: May 19, 2016, 03:51:10 PM »
I didn't find (yet?) any particular reason why this happens so posting here instead with bugtracker.

Image describes the problem:


For now it happens for every passing trader in that spot. Pretty sure it is just this spot, near this station, in this sector, in this galaxy, but still... It may happen somewhere else in the full game (if it wasn't repaired already in there).

10
Mods / Clean-up script
« on: May 16, 2016, 07:25:05 PM »
I'm in need and I have ran out of ideas. Maybe someone in here has an idea or even completed script.

I need to clean up wreckages in a sector. Can't call Sector() in command or even serverstartup.lua. Most of Galaxy() function names I have tried do no work too. I was thinking of attaching script to a ship but I would need to modify existing one (Station Founder maybe?). But the part of guessing name of getWreckages() (I would laugh if it is the one) function will still be a problem. Another thing will be trying to run proper loop if wreckages function does not return proper array.

Any ideas?

11
Mods / Adding new station scripts
« on: May 15, 2016, 03:38:02 PM »
After trying creating station with a custom scripts it throw an error that the custom script  is illegal and cannot be used. Is there any work-a-round for that? Or is it hard-coded demo limitation?

(same goes for system upgrades)

12
Mods / Working Turret Merchant
« on: May 15, 2016, 06:03:55 AM »

Working, simple turret merchant script. Just change your current turret merchant's source to this one.

Code: [Select]
package.path = package.path .. ";data/scripts/lib/?.lua"
require ("galaxy")
require ("utility")
require ("faction")
require ("player")
require ("randomext")

total = 15

if onClient() == 1 then
current = 1
end

function interactionPossible(playerIndex)
    local relationLevel = Player():getRelations(getParentFaction().index)
local station = getParentEntity()

local dist = Player().craft:getNearestDistance(station)
if dist > 500 then
return 0, "You need to be at maximum of 5km from station."
end

    local threshold = -5000
    if relationLevel < threshold then
        return 0, "This faction doesn't like you enough."
    end

    return 1
end

-- create all required UI elements for the client side
function initUI()
    local res = getResolution();
    local size = vec2(500, 300)

    local menu = Menu()
    window = menu:createWindow(Rect(res * 0.5 - size * 0.5, res * 0.5 + size * 0.5));
    menu:registerWindow(window, "Buy Turrets");

window.caption = "Turret Merchant"
    window.showCloseButton = 1
    window.moveable = 1

local fontSize = 14

window:createFrame(Rect(60, 10, 500-60, 300-10));
window:createButton(Rect(60+10, 300-10-10-50, 500-60-10, 300-10-10), "Buy", "onBuyTurretButtonPressed")
window:createButton(Rect(10, 100, 50, 200), "<", "onPrevButtonPressed")
window:createButton(Rect(500-50, 100, 500-10, 200), ">", "onNextButtonPressed")
label_title  = window:createLabel(vec2(70, 20),  "",  fontSize+6)
label_damage = window:createLabel(vec2(70, 50),  "",  fontSize)
label_rate   = window:createLabel(vec2(70, 70),  "",  fontSize)
label_range  = window:createLabel(vec2(70, 90),  "",  fontSize)
label_cost   = window:createLabel(vec2(70, 110),  "",  fontSize)

invokeServerFunction("getTurretInfo", Player().name, current)
end

function getTurretInfo(name, number)
local turret = turrets[number]

-- TITLE
local title = turret.weaponPrefix .. " Turret";
    -- add number predicate
    local prefix = "";
    if turret.numVisibleWeapons == 1 then
        prefix = ""
    elseif turret.numVisibleWeapons == 2 then
        prefix = "Double "
    elseif turret.numVisibleWeapons == 3 then
        prefix = "Triple "
    elseif turret.numVisibleWeapons == 4 then
        prefix = "Quad "
    else
        prefix = "Multi "
    end
    if turret.weaponType == WeaponType.MiningLaser then
        prefix = prefix .. turret.material.name .. " "
    end
    if prefix ~= "" then
        title = prefix .. title;
    end

-- RANGE
local range = "Range: " .. round(turret.reach * 10 / 1000, 2)

-- DAMAGE and RATE
local damage
local rate
if turret.weaponType == WeaponType.Laser then
damage = "Damage/s: " .. round(turret.dps, 1)
rate = ""
elseif turret.weaponType == WeaponType.MiningLaser then
damage = "Damage/s: " .. round(turret.dps, 1)
rate = "Efficiency: " .. round(turret.efficiency * 100) .. "%"
elseif turret.weaponType == WeaponType.ChainGun then
damage = "Damage: " .. round(turret.damage, 1) .. "x" .. turret.shotsPerFiring
rate = "Fire rate: " .. round(turret.fireRate, 1)
end

-- COST
local cost = "Cost: " .. getTurretCost(number)

local requester = Player(Galaxy():findFaction(name).index)
invokeClientFunction(requester, "setTurretInfo", title, damage, rate, range, cost)
end

function setTurretInfo(title, damage, rate, range, cost)
label_title.caption  = title
label_damage.caption = damage
label_rate.caption   = rate
label_range.caption  = range
label_cost.caption   = cost
end

function getTurretCost(number)
local cost = 100
local turret = turrets[number]
if turret.weaponType == WeaponType.Laser then
cost = cost * turret.dps * round(turret.reach * 10 / 1000, 2) * 1.5
elseif turret.weaponType == WeaponType.MiningLaser then
cost = cost * turret.efficiency * 10 * turret.dps
elseif turret.weaponType == WeaponType.ChainGun then
cost = cost * turret.damage * turret.shotsPerFiring * turret.fireRate * 0.4 * round(turret.reach * 10 / 1000, 2) * 1.5
end
return round(cost, 0)
end

-- this function gets called on creation of the entity the script is attached to, on client and server
function initialize()
    local station = getParentEntity()

local x, y = Sector():getCoordinates()
local dps, tech = Balancing_GetSectorWeaponDPS(x, y)
if onServer() == 1 then
turrets = {}
for i=0, 4 do
table.insert(turrets, InventoryTurret(GenerateTurretTemplate(random():createSeed(), WeaponType.ChainGun, dps, tech, Rarity(0), Material(MaterialType.Iron))))
end
for i=0, 4 do
table.insert(turrets, InventoryTurret(GenerateTurretTemplate(random():createSeed(), WeaponType.Laser, dps, tech, Rarity(0), Material(MaterialType.Iron))))
end
for i=0, 4 do
table.insert(turrets, InventoryTurret(GenerateTurretTemplate(random():createSeed(), WeaponType.MiningLaser, dps, tech, Rarity(0), Material(MaterialType.Iron))))
end
end

    if station.title == "" then
        station.title = "Turret Merchant"
    end
end

function onBuyTurretButtonPressed()
invokeServerFunction("buyTurret", Player().name, current)
end

function onPrevButtonPressed()
current = current - 1
if current < 1 then
current = total
end
invokeServerFunction("getTurretInfo", Player().name, current)
end

function onNextButtonPressed()
current = (current % total) + 1
invokeServerFunction("getTurretInfo", Player().name, current)
end

function buyTurret(name, number)
local buyer = Player(Galaxy():findFaction(name).index)
local station = getParentEntity()
local requiredMoney = getTurretCost(number)
local canPay, msg = buyer:canPay(requiredMoney)

    if canPay == 0 then
        Server():sendChatMessage(buyer, msg, station.title, 1);
        return
    end

    buyer:pay(requiredMoney)

buyer:getInventory():add(turrets[number])
end

13
Suggestions / Manual thrusters in Keyboard Steering
« on: May 14, 2016, 05:40:14 PM »
In Keyboard Steering, unlike Mouse one, you can only roll ship. You can't move it up/down/left/right with thrusters. And it isn't even bindable in options when keyboard steering is enabled. Suggestion is to add it to the options to allow binding them somewhere. They don't need to be binded anywhere by default.

14
Troubleshooting / [del] Moved to Suggestions
« on: May 14, 2016, 05:33:28 PM »
One doesn't simply delete own thread.

Moved to http://www.avorion.net/forum/index.php?topic=378.0

15
General Discussion / Server files
« on: May 12, 2016, 08:39:25 PM »
Ok, so you are going to be on Steam. And here goes the question.

How will be server software provided? With the game after purchase or will it be available for any Steam user as a Tool for game? Or maybe it will be downloadable from the website. Or maybe it won't be available separately from the game?

And I mean just the server files. Not game itself.

Pages: [1] 2