Sign up Calendar Latest Topics
 
 
 


Reply
  Author   Comment  
HaydenBarca

Registered:
Posts: 36
Reply with quote  #1 
Has anyone figured out a way to make a shuttle "dock" (stop, stick, not just keep flying past) a base?  Again planning the LARP and taking a shuttle to an away mission is a pretty basic component.  I know the TSN Expansion/Sandbox has a way to fly by bases and hit waypoints that drop off NPC teams, but I was hoping to have the players pile into a shuttle, take it to a base, dock, and get out (and still have the shuttle be there).

The only alternative I can think of is to require the main player ship to dock before the players can board, but what is a shuttle for at that point?  Or alternatively, have the shuttle pilot stay in and keep flying.

Just hoping someone had a clever plan.  It doesn't seem like there are a lot of scripting hooks for shuttles/fighters/bombers.
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,049
Reply with quote  #2 
You run into two limitations in Artemis 2.71 here:

  1. A shuttle is just another console on a bridge of a capital ship. It can only dock with that bridge.
  2. A script can only place shuttles on a capital ship once and it must be before the capital ship is spawned.
You could write a mission script that allowed a shuttle to dock in a manner of speaking. When the shuttle gets close to the space station destroy it, then put a replacement shuttle on the space station with the same name. Of course if the capital ship has 2+ shuttles then the pilot would immediately find himself/herself back in the launch bay of said capital ship.

Even if the capital ship has only one shuttle, you face the problem that the shuttle pilot cannot launch from the space station; he/she would be stranded there until the bridge crew came by and docked, picking up the "new" shuttle.

If you want to do this for a LARP you could try this:

  1. When the shuttle gets close to the space station, spawn a second capital ship (e.g. Athena) just above or below the space station. Athena has no crew but it has a shuttle aboard with the same name.
  2. When the player "docks" with the space station your script destroys the shuttle, then the shuttle pilot must log in as a shuttle pilot on Athena.
  3. The pilot now has a brand new version of the original shuttle that can launch at will. The shuttle is a console of Athena.

The pilot is now essentially based at the space station. The main problem now is that I do not believe a shuttle from Athena can ever dock with the original capital ship Artemis. This problem is harder to solve because you don't want to keep respawning Artemis, which has a live crew.

I hope some idea in all of this helps.

__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
Mike Substelny

Avatar / Picture

Administrator
Registered:
Posts: 2,049
Reply with quote  #3 
Addendum: If the crew returning to Artemis after their away mission is the end of the game then you don't need to worry about docking with Artemis and re-launching. You can just destroy the shuttle when it docks and have the away team join the Artemis bridge crew in celebrating victory. All of this will work as long as the shuttle never launches again after returning from the space station.
__________________
"The Admiralty had demanded six ships; the economists offered four; and we finally compromised on eight."
- Winston Churchill
HaydenBarca

Registered:
Posts: 36
Reply with quote  #4 
Thanks for the ideas.  I tried to do something tricky with a script detecting when the distance between the shuttle and the station is under 260 and then reducing the shuttle top speed to 0 (relying on a GM button to restart its top speed when they're ready to "launch"), but I never could get it to detect the distance between the station and the shuttle.  I might try again later, but at this point I think I'll just require the ship to dock with the station to transfer players.
ryleyra

Registered:
Posts: 2,846
Reply with quote  #5 
I usually have a shuttle close with 400 meters to interact with a base or other ship. It isn't removed from the map, but it can "exchange cargo" or unload a passenger or the like. Docking would be a neat option if it were possible, but for now it's the same mechanism that's used for two ships "docking".

This is my command for testing distance: (in this case to a ship)

<if_distance name1="Icarus" name2="Niobe" comparator="LESS" value="400" />

where Icarus is the shuttle and Niobe is the ship. This should work properly with a station name as "name2".

You might also want to make sure your distance from the home ship is greater than say 600, to keep the home ship from "crowding" the shuttle while it is trying to dock. In addition, if you're trading with two ships or bases, you might want to make sure you clear 600 from the first ship before you check if you are closer than 400 to the second. Otherwise if the two ships are too close to each other you'll just go into an infinite loop where you "dock" with each of them in turn.

You could set the top speed to 0 to have the shuttle "dock" with the station but another possibility (in case that doesn't work) is to keep resetting the shuttle's position. If the shuttle is within 400 meters (and the GM has not deactivated the function) just keep adding 1 or 2 to the X and Z coordinates if they are not at your given location off the station. (or subtracting if the coordinate is too high) You might have to tweak the value you add to make sure the motion is fluid and overcomes the shuttle's momentum.

If you REALLY want to get complicated, you could create a tractor beam graphic between the base and the shuttle and set the shuttle's position, instead of reducing its speed to zero. So it would act like a ship docking. You'd need a graphic, but I have one here: https://artemis.forumchitchat.com/post/tractor-beam-a-model-and-mission-stub-7767572
HaydenBarca

Registered:
Posts: 36
Reply with quote  #6 
Thank you very much, ryleyra.  I may give it another shot (especially with the graphic you developed).  It's also nice to hear that I'm not barking up a broken tree.

If only the listen-for-keystrokes was more reliable, I'd love for the fighter to undock by hitting the boosters (or "R").  I take it that listen-for-keystrokes wasn't fixed in the latest version and I'm just seeing reference to old versions (he asks hopefully).
HaydenBarca

Registered:
Posts: 36
Reply with quote  #7 
I tried to mimic a tractor beam with set_relative_position as ryleyra suggested and got an unusual behavior.  It appears that the shuttle model stayed in the same location in space, but the functions recognized it in its newly set position, which made for some very weird phenomenon.  I tried to send it 10,000 km away and the effect was very pronounced (its functional position and its visible position were quite different).

So I tried setting top speed to zero when distance was <= 100km and that worked, but then had to figure out how to let them undock.  I tried a couple of keypress listening attempts and finally got it to work (but the letter had to be a capital in the <if_client_key keyText="U" />, lowercase wouldn't work).  This is with a single player ship and single shuttle (with client and server on the same computer), but it works.  I made a Comms Button as well and they both work.

A range of 100 lets you get in nice and close:
Screenshot - 11_29_2018 , 10_51_01 PM 002.jpg 
Thanks for helping me think through this one.

 
Attached Files
zip MISS_ShuttleTest.zip (1.59 KB, 0 views)

ryleyra

Registered:
Posts: 2,846
Reply with quote  #8 
Quote:
Originally Posted by HaydenBarca

If only the listen-for-keystrokes was more reliable, I'd love for the fighter to undock by hitting the boosters (or "R").  I take it that listen-for-keystrokes wasn't fixed in the latest version and I'm just seeing reference to old versions (he asks hopefully).


One way to do this (I think) is to read the currentRealSpeed property of the shuttle. It should normally be 0 or 0.4/0.6, if it is 1.2/1.8 the player is holding down boost. Any value over 1.0 has to be boosted, no matter what type of singleseat craft it is.

Of course, if you set topSpeed to 0, currentRealSpeed will also always be zero. So you will have to use my method of resetting the location each time. (possibly in absolute coordinates) Alternately, you could set topSpeed to like 0.01 and test for 0.03. The shuttle would drift, but you could reset the location if it gets too far away from the station. Or maybe you could change the angle property so the shuttle "orbits" the station.

As you noted, keystrokes have not been fixed, but they've been replaced with Comms buttons so the issue isn't as big as it was before. You can still use keystrokes to give fighters or shuttles special functions, but it does have to be a capital letter. You also have to remember to call start_getting_keypresses_from unless you are only accessing GM keys.

I'll have to play with set_relative_position to see if I can reproduce the behavior you reported. I seem to remember being able to teleport shuttles in previous versions of Artemis, but the location could have been absolute (set by set/copy_object_property with positionX/Z) or set by set_to_gm_position. It's possible that the way shuttles work prevent them from being relocated by the script, or at least screw up the visual representation of the data stream coming from the server.

Then again, if player ships can be relocated I'm not sure why fighters would not be relocate the exact same way. A fighter is basically just a player ship that is summoned as needed and destroyed when the player docks.

HaydenBarca

Registered:
Posts: 36
Reply with quote  #9 
I forgot to mention that I did try to detect the currentRealSpeed of the shuttle first and it returned the speed of the mothership, rather than the shuttle.  Perhaps I was doing wrong, though (I put in a warning_popup to fire off when shuttle currentRealSpeed hit zero, expecting it to only fire off when I hit the brakes, but it went off nearly immediately even with the shuttle moving).  I did not try setting absolute coordinates, so maybe that would work better.  With this I have something I can use, at least.

I'm glad to find the shuttle can use keystrokes -- that opens up a lot of possibilities, especially for LARPs.  I also really like what the TSN RP folks did with their expansion by adding engineering, medical, and marine teams with shuttle missions of drop-off and extraction.  
ryleyra

Registered:
Posts: 2,846
Reply with quote  #10 
Quote:
Originally Posted by HaydenBarca
I forgot to mention that I did try to detect the currentRealSpeed of the shuttle first and it returned the speed of the mothership, rather than the shuttle. 


In retrospect, it makes sense that it would work that way. A singleseat player has a separate ship created for him, but the code also refers back to the mothership. (As noted by Science and VIS displays, sometimes inconsistently) I have never tested the idea, so I didn't know. I'll have to see exactly what object properties actually work correctly with singleseat craft and which refer to the mothership.

HaydenBarca

Registered:
Posts: 36
Reply with quote  #11 
I got it to work and put together some additional capabilities like loading cargo on the shuttle and bringing it back to the ship (energy, torpedoes, and a DamCon team right now).  I posted it in its own thread for ease of search.  Thanks to all for your help in thinking through this.
Previous Topic | Next Topic
Print
Reply

Quick Navigation:

Easily create a Forum Website with Website Toolbox.