Author Topic: [MOD]Player Warp Gates  (Read 12741 times)

CaoCao777

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    3
    • View Profile
on: June 19, 2018, 01:55:56 AM
any updated file ?



Gamer Senpai

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    30
    • View Profile
on: July 31, 2018, 01:06:53 AM
Sorry to bump an old thread, but I thought i'd have a go at fixing it up a little.

So i made it work in one direction, then when i spawned too many gates i realised the gates can travel through each other. So currently it just spawns two gates, one goes to original sector, one goes to destination, and the one that points to original sector travels through the other, thus you have a working gate system.

I can upload the edited files if anyone cares


I'd like an updated file please.... It would help my economy vastly...



CaTWhITe

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    1
    • View Profile
on: August 03, 2018, 12:40:28 AM
i did use /gate crate x-y and not work how to use?
you need Video Tutorial please?



Gamer Senpai

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    30
    • View Profile
on: August 07, 2018, 12:29:31 AM
Sorry to bump an old thread, but I thought i'd have a go at fixing it up a little.

So i made it work in one direction, then when i spawned too many gates i realised the gates can travel through each other. So currently it just spawns two gates, one goes to original sector, one goes to destination, and the one that points to original sector travels through the other, thus you have a working gate system.

I can upload the edited files if anyone cares

Please... I'd really really like warp gates.



Ghost722nd

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    20
    • View Profile
on: November 06, 2018, 02:05:07 AM
Since the mod doesn't work anymore I've tried to get it to work again in the last two days.

And believe it or not, I've found a way to spawn the gates even with the script attached (couldn't test the pass-through price so far because as owner it's 0 for me)

There are only 2 problems left:

1.
Had to change the file "data/scripts/commands/gate.lua" because somehow I couldn't add the script by using the command "addScriptOnce".
I've changed it to "addScript" which worked for my tests but that is bad because everytime i start my server the whole file gets executed and causes some funny trouble.

2.
I always get "<Gate:  > nil" in the chatbox whatever I typed in.  "..action" also produces errors which I don't understand because it's the same kind of code like in crew.lua

Tried:

/gate
/gate create
/gate create 1 1

These are the problematic code pieces:

Code: [Select]
function execute(sender, commandName, action, ...)

local player = Player()
    player(sender):addScript("player/cmd/gate.lua")
    return 0, "", ""
end

function getDescription()
    return "Creates Warp Gates owned by the player"
end

function getHelp()
    return "Example: /gate create x y"
end

Code: [Select]
function initialize(help, action, ...)
local flag, msg = false, ""
player = Player()
if action == "create" then
flag, msg = createWarpGate(...)
player:sendChatMessage("Gate: ", 0, "Warp Gate created")
elseif action == "help" or action == nil then
player:sendChatMessage("Gate: ", 0, help)
else
player:sendChatMessage("Gate: ", 0, "Unknown action: "..action)
end
terminate()
end

I would appreciate it if someone could help me out. To have such a comfort function like "/gate create x y" is a must have for me before i'll upload the rest of the code   ;)
I'm not a signature, I only clean here!



Ghost722nd

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    20
    • View Profile
on: November 11, 2018, 05:50:13 AM
Nevermind, found a solution and the gates are working now!

INSTALL:

1. Download the mod (https://www.avorion.net/forum/index.php/topic,5275.0.html) <- Requires Aki's Command Package (LINK BELOW)
2. Extract it to your Avorion folder (default: ../Steam/steamapps/common/Avorion/..)
3. Go Ingame and look for a sector to start the new gate from (Video Example: x: 180 y: 11)
4. While in the Sector type "/gate create x y" (Video Example: /gate create 180 11)
5. The new created gate is a ONE WAY connection, means that you will have to spawn another in the target sector.

Example:
First Gate: (FROM: x:180 y:11 - TO: x:180 y:12)
Second Gate: (FROM: x:180 y:12 - TO: x:180 y:11)

6. Congratulations! You have spawned a warp gate for you or your alliance (depending on you are inside an alliance ship or not)
7. Have fun!



NOTE:

I have removed the costs which LogicSocket added to prevent a player to add gates right from the start off.
Since only admins/moderators are able to spawn them I have thought that this restriction is not necessary!

If you want to modify this mod then please add Aki, LogicSocket and me in a Credits section.
"The company thanks!" ;D

Credits:

Aki for his Avorion Commands Package
LogicSocket for his Player Warp Gates mod

Required:

 Aki's Commands Package:
http://www.avorion.net/forum/index.php/topic,830.0.html

German: Ich habe fertig!  8)
« Last Edit: November 27, 2018, 02:50:05 PM by Ghost722nd »
I'm not a signature, I only clean here!



Gamer Senpai

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    30
    • View Profile
on: November 20, 2018, 03:31:03 AM
 Just set up my three sectors, thanks for the mod.



MassCraxx

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    13
    • View Profile
on: November 27, 2018, 10:13:38 PM
Nevermind, found a solution and the gates are working now!

Very nice!

I would prefer a mod that includes this feature into normal gameplay though. I stopped my efforts since Shrooblord seems to work on a very promising looking attempt https://www.avorion.net/forum/index.php/topic,4967.msg27205.html#msg27205.

Additionally, it would be nice if it would be required to actually maintain the gate with crew, energy and shields like stations. Unfortunately, I am not sure if it is currently possible to remove the gate (or  the Wormhole component) on destruction.



Ghost722nd

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    20
    • View Profile
on: November 30, 2018, 10:21:25 AM
Yeah, found his thread some days later after posting the mod.

At the current state it's not possible to remove the gates you've placed with the mod. But in general it should be possible to remove the placed gates because they are just entities like other stations, ships or asteroids.
I'm not a signature, I only clean here!



MassCraxx

  • Newbie
  • *
  • Status:
    Offline
    Posts:
    13
    • View Profile
on: November 30, 2018, 10:27:22 PM
But in general it should be possible to remove the placed gates because they are just entities like other stations, ships or asteroids.

Well with wormholes, the only way I found to remove them was setting both, start and end wormhole to one-way first, only then entities could be deleted, otherwise they would just respawn on delete. Since setting to one-way can only be done with wormholes in your current sector, you would need to change the sector to fully remove the connection. Therefore I assume this can not be done by the gate itself onDestroyed.