Lookup Posted October 9, 2017 Share Posted October 9, 2017 Hello Everybody, I would like to create a mode that works a little bit like the autopilot from the X Games. My plan would be to use it to auto dock the player to a given station. So you dont need to fly on your own :) I tried to somehow get all points together about where and what but to be honest im kind of lost. For my first test I added a new script under scripts\commands that should work like this /flyto x y z According to the documentation in the gamefolder I dont see a way to do this, Im quite sure I somehow missed a point. What I have so far is this: package.path = package.path .. ";data/scripts/lib/?.lua" function execute(sender, commandName, ...) local args = {...} --empty array for cords local cords = {} for i, v in pairs(args) do print(i) print("--") print(v) Server():broadcastChatMessage("TEST", 0, v) cords[i] = v --add cord to array end local p = Player() Server():broadcastChatMessage("TEST", 0, Player().Name) return 0, "", "" end function getDescription() return "Fly to given x y z cordinate and stops" end function getHelp() return "Fly to given x y z cordinate and stops Usage: /flyto x y z" end Please dont laugh, I cant find a way to activate the debug console... How do I do this? Why do i see the first output in the chat but not the player name? Link to comment Share on other sites More sharing options...
Dirtyredz Posted October 9, 2017 Share Posted October 9, 2017 Ill start by answering your questions I cant find a way to activate the debug console Im assuming you mean opening the console in the game? if so the the ' key is default. if you mean doing print that are meant only for debug purpose then i suggest looking at http://www.avorion.net/forum/index.php/topic,3799.0.html Why do i see the first output in the chat but not the player name? Server():broadcastChatMessage("TEST", 0, v) Is used to send chat to the entire server print(v) is used to print to the console If you want the name of a player who called the command you should do this: function execute(sender, commandName, ...) local player = Player(sender) if not player then return end print(player.name) end Here your forced to generate the players object using the "sender' variable which is the index of the player who called that command this is unlike other files in avorion each type of file is uniuq and requires furthor explanation. About your mod idea, Its been a long sought after mod, unfortunetly the best we can do is point the craft and throttle and engine. This is becuase the ShipAI() that has function built in to perform automated flights is disabled when a player is in the cockpit. I beleive their is already a mod that does its best with what restrtrictions we have http://www.avorion.net/forum/index.php/topic,3319.0.html although the mod is old, and im unsure how far the modder got with that mod or if it still works. Myself an many other modders are working on an Avorion BoilerPlate, to help new modders get started, and help explain some of avorions unique scripting methods. Until then your welcome to talk to me and other modders on my discord https://discord.gg/7AcgGf Avorion also has an official discord which you can use here https://discord.gg/rkNduU Best of luck to you Link to comment Share on other sites More sharing options...
Lookup Posted October 10, 2017 Author Share Posted October 10, 2017 Thanks for the reply and many many thanks for the link to the other mod. I guess thats a good point on learning how it works :D The strange thing on my side regarding the debug log is that the ' Key just does not trigger it or Im blind... Is there any other way like a start parameter for the game to force it? I will have a look at the mod scripts and try my luck. In case im blocked I will come back here or try the mentioned discords Link to comment Share on other sites More sharing options...
DracoNB Posted May 8, 2018 Share Posted May 8, 2018 Myself an many other modders are working on an Avorion BoilerPlate, to help new modders get started, and help explain some of avorions unique scripting methods. Until then your welcome to talk to me and other modders on my discord https://discord.gg/7AcgGf Avorion also has an official discord which you can use here https://discord.gg/rkNduU Best of luck to you Hey I was wondering if you'd gotten any farther on the mod template? I saw one on your github but wasn't sure if that was the most up to date. I wanted to start doing some modding as I just recently found this game and have been loving it, but wasn't sure where to start and a lot of the info seems outdated. Also both of the discord links are invalid now, do you have new ones? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now