Jump to content

tangowrangler

Members
  • Posts

    22
  • Joined

  • Last visited

tangowrangler's Achievements

0

Reputation

  1. I have been off of Avorion for a long time. Will pick this one up. Lost a big part of my progress as I formatted my pc without keeping backups. Will start from the stuff that is available here sadly. Hope to have something running soon. Anyone using it having queries or suggestions, do post them.
  2. Thanks for looking through it. I saw those examples but i messed that they need to be inside updateClient(). I tried the following but sadly that didnt work too.... function updateClient(timeStep) mycraft = Entity(Player().craftIndex) -- sp = Sphere(vec3(1000,0,0),4799) if valid(mycraft) then print("valid") drawDebugSphere(mycraft:getBoundingSphere(), ColorRGB(1, 0, 0)) end end The only example of the Render callbacks i found were using the UIRenderer() object. Still i tried with the following without success function update(timeStep) if onClient() then Player():registerCallback("onPreRenderHud", "onPreRenderHud") end end function onPreRenderHud() mycraft = Entity(Player().craftIndex) if valid(mycraft) then print("valid") drawDebugSphere(mycraft:getBoundingSphere(), ColorRGB(1, 0, 0)) end end I am trying to slash around the need to use a debugsphere. It is being very inconvenient though. I need it cause i am trying to implement an object detection radar thingy for path planning in a sector. first i was using a sphere to get entities. than i kinda figured i can just iterate over all the entities in a sector. the get getEntitiesByLocation is faster than getting all entities; however, if u have relatively big spheres, the performances are comparable. I still have to test it out in an asteroid field, that may explode the algorithm iterating over all entities.
  3. Have been trying to use the drawDebugSphere() function to draw a sphere without any success. local sp = Sphere(spcent,sprad) drawDebugSphere(sp, ColorRGB(1,0,0))
  4. You have the following comment in line 135 of carriercraftorders.lua. incase you havent already figured it out the fix is calling the following function near the start of script (i think it needs to come before initui). function getIcon() return "data/textures/icons/freedom-dove.png" end FYI: thanks for your mod; based the frame of my mod on yours. especially the UI.
  5. They are all really awesome. I am gonna be looking forward to "Co-op ship piloting"
  6. TL;DR: This mod INTENDS to put in features and functionalities which let you captain your ship. The idea is to be able to hand down higher level commands to the ship other than going through all the maneuvers. You should have a look at the "Notes" section to find out about the numerous caveats before starting with the mod. You need to have a captain aboard and the commands only work when in keyboard control mode (i.e., you have to be in keyboard mode or shift to it for the orders to execute). Updated to work with 0.14.5 Disclaimer: first time with lua; first time modding. i know i messed up things. let me know down below... Contents: [*]Features [*]Installation [*]Notes/Readme [*]Motivation [*]Preview [*]Plans Features: Autopilot to [*] face targeted object [*] travel to targeted object if heading is to targeted object [*] face and travel to targeted object [*] initiate retrograde burn to bring craft to a stop Installation: Follow the readme in github. https://github.com/lethargi/CaptainMyShip Notes/Readme: Motivation: It would be nice to have a mod that actually lets you captain your ship than having to be at its helm 24-7. A captains needs his chill time. So simple features like flying to a station and docking autohiring crew boosting away from the sector the ai attacks, the ai mining etc. I think the current modding capacities MAY allow these Could be even more complex where you can plot multi-jump courses/trade-routes Auto-explore greens or yellows setup attack tactics, thave it distribute different fighter squads to different asteroids, interface for commanding other ships in the sector However, I do not believe it is possible to implement these features with the current modding API. Preview: Excuse the shitty screen grabbing and video editing; new to this stuff too. Plans: Most of thoughts in motivation are left as ideas to explore. There is 90% chance that i will not improve this mod. Doing just this little bit took out about 3-4 days from me. However, if i do get back to it (and for other people willing to pick it up), i have some general directions to go towards. [*]Most importantly object avoidance [*]Next most important interface to set the control parameters that determine the control behavior of the mods [*] System identification in the loop for better control [*]Captain information interface [*]Path planning in sector [*]Docking [*]Attack stances and maneuvers (Hard) [*]Inter-sector navigation using gates and jump [*]Auto-trade; Auto-hire; Auto-harvest CaptainMyShip_v01.zip If you have thrusters for braking only accounts for the brake thrust of those; if you do not have thrusters for braking assumes brake thrust is 75% of acceleration You can force your ship to boost faster by changing the estimated brake-thrust of your vehicle in the CMSlib.initialize() function of the CMSlib.lua file. It defaults to 0.75; this number is factor of your maximum acceleration; if your brake-thrust is 3 times your acceleration, you can safely set it to 2.5 and get faster boosts. I could not find a way to obtain the brake thrust of my ship as of yet Your ship needs to have a captain for the commands to work The commands only work when in keyboard control mode The UI is based on Nexus' mod Alpha! Carrier Commands Not suited for multiplayer yet; i tried implementing all the functionality clientside to minimize the loads. this may leave options for exploits if used in a multiplayer setting. Being careful for unknown unknowns here There is NO object avoidance functionality At the current state, it just points and goes to within 2kms of the target All the control algorithms are hard-coded; so don't expect optimized flying Due to some of the tuning, the algorithm is more suited for medium to larger ships (5-10 slots) with "average" velocities and rotation rates ( recommended < 1.5 rad/s pitch and yaw, algorithm does nothing with roll yet); it works in smaller ships but behaviour maybe wonkier and disclaimer for crashes :P there MAY STILL BE a bug which causes the ship to boost before turning for one instance if the target is changed after arriving at the destination while using boosttotarget. This is not a big deal for larger ships but for tiny ships may cause issues sometimes.
  7. I am working on a mod that attempts to implement autopilot functionality to the player controlled ship. For that i need to estimate the brakethrust of my vessel to plan good maneuvers. The only place the AI uses this variable is in dock.lua which maybe a a real bug. Look at the screenies below for details. No brakethrust with the whole ship being an inertia dampener Brakethrust shows up with directional thrusters
  8. do you place blocks at places where they are disallowed in build mode?
  9. From the metadata of your quote i thought u were talking to Splutty. hehe Anywho, the code already makes a list of the goods being bought and sold in the sector. It is done using the buildGoodsList function in the haulgoods.lua file. incase you feel inspired to have a look at the script and change it for the rest of us ;)
  10. I keep getting an error with the scriptloader.lua file, although the "Carrier orders" icon appears in my interface. Checked that Devious brought this up some time ago in the thread, but i think the conversation died out. attempt to call global 'Server' (a nil value) I was trying it out in the single player. I am running the game in Ubuntu 14.04, on the beta branch with version 0.11 r7857. Did an uninstall, removed folder and reinstall before installing the mod. That did'nt seem to fix it. Any ideas on what maybe causing it?
  11. Thanks JohnnySinclair for taking the time. I had skimmed over that line of comment. Going further the AI scripts DO not work, but that does not mean i cannot try :) Edit: removed findings and merged it with the opening post of the thread.
  12. Current questions: 1. Can I increase the update frequency of update functions in the ai scripts? I was hoping someone who has experience or insight into the ShipAI object can help me out. I want to be able to give the ship i am currently on orders. So I modified the check in craftorders.lua which prevents the option of ordering my ship while i am in it. Sadly my ship still does not do the AI tasks while i am on it. I tested using the patrol sector by putting some print commands to check if my script is being run and it is. When I leave the ship, it starts with the task (ie the patrol). Interestingly, when i get back on, it does not come to a stop, instead it keeps the THE VELOCITY as long as i dont give it any other control inputs. Note that it does not do the Patrol, it only keeps the last commands that the script gave them. This leads me to believe, it must be possible to give my ship velocity commands while I am onboard. I also found that the Entity object has the properties desiredVelocity, controlActions and aimedPosition which maybe the things i need to modify. Findings 9th April: The desiredVelocity and controlActions are sufficient to give the boarded craft all the motion commands. One must be in the keyboard control for them to occur though. the first parameter is self-explanatory; the second one represents the angular and the translational thruster commands. I tried manipulating a number of other variables but they didnt seem to influence the velocity. This effectively answers question 2. I was able to introduce changes to the velocity (and potentially angular velocity) by making a Velocity() object. This is not what i want, because i think that object is there to simulate external forces causing changes to the craft states. My current goal is to find some kind of looping to make my craft face and head towards sth, sth i am targeting. I plan to achieve this by using if statements in an update function. Update 9th April: RIght now i am trying to get my craft to face a target using the primitive control actions. I managed to extract the required yaw and pitch to face a target (took a whole day of work and gave me new found respect for the devs). However, since the function only allows me to set the pitch values once every second, it cannot control it. i.e. it keeps overshooting if u have relatively fast pitching. So now i am looking for a way to control the update rate of the update functions in ai. Any help will be appreciated. Edit: DIscussion moved to mod thread http://www.avorion.net/forum/index.php/topic,3319.0.html
  13. Had a skim of the script. The relative complexity and my lack of knowledge of lua led to very shallow understanding. Thankfully, i found the /haulgoods status command while re-reading your title post. I mainly built all this for my own sector with my own factories This is what I am hoping to use it for. the problem is I built my things in a neutral zone where there are trade posts. So it sometimes makes those trades. Thats why I was thinking maybe when u populate your table in your "buildGoodsList" function, there can be column which stores the owner of the station. Later that information maybe used to restrict the hauler to only the players station. Regarding the recovery mode, it can be useful even when building in an empty sector because of servers crashes. I do not know what is easier, checking the cargo, or periodically writing the state. I am gonna see if there is any way to give captain commands to the ship i am commanding. Sth I would really like to be able to do. Also gonna play around with the haulgoods status command. P.S I myself imagine/assume many things are possible (modwise), but my lack of programming experience makes me overzealous. so excuse me if i sound thick. :) Cheerio
  14. Have been playing around more with your mod and have an idea regarding point 2. Might an if check which looks for what the hauler has in its cargo and all the things it can sell in the sector before it starts doing trade routes alleviate the problem? I must confess, i havent looked at your script yet. And after i am done doing these trade runs, i will have a look 8). if i have better ideas, i will let you know.
  15. It would be nice to have a mod that actually lets you captain your ship than having to be at its helm 24-7. A captains needs his chill time. So simple features like flying to a station and docking autohiring crew boosting away from the sector the ai attacks, the ai mining etc. I think the current modding capacities MAY allow these Could be even more complex where you can plot multi-jump courses/trade-routes Auto-explore greens or yellows setup attack tactics, thave it distribute different fighter squads to different asteroids, interface for commanding other ships in the sector However, I do not believe it is possible to implement these features with the current modding API. Edit: Made an early publish of sth like this... http://www.avorion.net/forum/index.php/topic,3319.0.html
×
×
  • Create New...