The Quest To Spew

More
19 years 1 month ago #13800 by GrandpaTrout
Replied by GrandpaTrout on topic The Quest To Spew
mdvalley, the script.ini file in MS_Mod_Main let's you turn off all traffic. Just read the comments at the bottom of the file to see which lines to comment out.

It can make testing go much easier when there is no traffic to fight with over docking rights.

Please Log in or Create an account to join the conversation.

More
19 years 1 month ago #13804 by mdvalley
Replied by mdvalley on topic The Quest To Spew
I’ll consider turning off the traffic. Once I found a snrv sitting on a port that didn’t want to let go. Is there a way to start not in the lifepod, but in a particular ship (like the Dakota or Venice)? It would make testing a lot faster.

tSpewerOps is done. Barring any bugs (a - instead of a + shut off the spewer after 3 pods. Oops.), all that needs to be done is altering the Epic Trade buy and sell scripts to talk to it the right way. tSpewerOps is independent; it does not need any other Epic script to function. Unlike the last spewer functions, it does not need tPodUtil, making tPodUtil.DockPods legacy (it had it coming, that’s the bugged one). It does, however, need its calling scripts to jump through a couple hoops. Big spiky flaming hoops. Good news is most of that is to keep the player from doing anything stupid. The code is one function away from AI traffic support (okay, so it’s not done) which are much more predictable.

I just spent the last hour or so looking over the tETrade.OnPurchasePress (and butchering it in the process), working out how to make it do what I want. The old code places pods individually, whereas my tSpewerOps wants the pods passed as a set. Toss in distinguishing out the player systems and it gets ugly. Not to mention two extra checks (is a player ship docked and does that ship have enough space for the order?) before the player can buy. I still have to iron out the kinks and write it all in.

Why does tSpewerOps.LoadShip want a set? Simple. Like the AI, pods will be spewn with a slight delay, instead of 4 at once. I think it’s cool.

If the sell code puts up this much of a fight, you might find me shaking and typing gibberish sometime tomorrow.

When I get the whole kit and caboodle done, I’ll be sure to send them to you. You can add them into Epic 8.2, maybe 8.1 if I’m fast enough.

PS-Talk of pirating spewer traffic pods in the bug thread reminded me to write anti-piracy lines into the sell code. You nearly had an exploit there, but ya blew it. Such code already exists on the Spewer Sell 1.0 (working title) I sent you. I dare you to re-gain a pod you sold! (Bugged pods on the universal ports don’t count).

Please Log in or Create an account to join the conversation.

More
19 years 1 month ago #13813 by mdvalley
Replied by mdvalley on topic The Quest To Spew
It’s alive! IT’S ALIIIIVE!

I have finished writing the selling code and am happy with it. One more time, the full description of the spewer operation:

To buy pods, the ship that will receive them must be docked to the spewer. If there is no spewer on the trade station, then a dock is not required and the pods will appear by magic. You cannot buy more pods than there is room available to receive them. Upon the beginning of cargo transfer, the docking lock will be engaged. It will not be released until the last bought pod docks with the receiving vessel. You do not need room to buy player systems, or even to dock.

Informative messages will be shown in that green text in the lower-left. The possible messages for buy are:

Vessel locked: This means the docking lock has been activated, the ship will not be able to undock until transfer is finished.

You must dock a cargo ship to buy goods: There is no cargo vessel docked to the spewer. Dock one and try again.

Insufficient cargo room: You are ordering more pods than the docked ship can hold. Buy less or sell some pods first.

Vessel unlocked: The docking lock has been deactivated. You are free to go.

To sell pods, the ship with the pods must be docked to the spewer. Again, if there is no spewer on the station, the pods will simply vanish. You cannot sell more pods of a type than are on that one ship. The docking lock will engage upon the start of the transfer and will release upon the undocking of the last sold pod.

Hidden feature: If a player ship is docked, then the offer all button will offer the number of pods of that type that the ship is carrying, instead of all pods in the area.

Possible messages for selling:

Vessel locked: Same as above.

You must dock the ship you will sell pods from: A cargo ship is not docked to the spewer. Dock one.

All offered pods must be on docked vessel: You are offering more pods of a type than the docked ship is carrying. Offer less.

Vessel unlocked: As above.

Due to the limitations of the spewer itself, only 4 pods can be in transit at a time. Because of this, a large freighter’s sale can take a while for all the pods to detach. However, the code is smart enough to know that the freighter will have enough room eventually, and you may buy the whole ship’s worth immediately after the sale is approved. The bought pods may or may not start rolling out before all the sold ones are gone, but they will all come out eventually. If the spewing ones outpace the detaching ones, the spewer will wait for slots to open up on the freighter, and not spew a pod it can’t dock.

There is one last kink to work out: If you dock right after an AI is done selling, the floating pods can occupy a spewer slot the code thinks is free. This can result in lost pods and pods on the universal ports (and the dock lock not letting go). I know how to work that one out, and once it’s done, tSpewerOps goes beta.

Another thing is that saving could really muck up the code. hship tSpewerOps.ShipDocked(hhabitat station, bool lock) returns the player cargo vessel docked to the station (don’t lock it). If that ship’s int property “md_epic_podstogo� is 0 (or non-existent), then it’s safe to save. Otherwise, it would be wise to disable entering the hangar.

While testing, I had an AI megafreighter on the dock. It took quite a while to unload that thing. Not to imply what I plan on doing after the spewer code is out the door, but I watched that ship VERY closely. And you wanted me to turn off the traffic. Maximum eight pods per big pod, thirty-six big pods per ship. Empty a station? You could empty a SYSTEM with that thing!

Please Log in or Create an account to join the conversation.

More
19 years 1 month ago #13815 by cambragol
Replied by cambragol on topic The Quest To Spew
Sounds awesome mdvalley. I am really looking forward to this mod. Anything that can improve the simulation aspect of the Middle States is good by me.

About the Megafreighter....and cargo levels at stations. We have to keep in mind that the levels we see are 'surpluses' that are open to sale to independent traders. The station itself probably has 10 times the cargo you would see when docking. However, most of the stock is reserved for contracted shippers.
It might be interesting to let the player join a shipping or trade faction eventually, and thus open up these hidden stocks (or code this all in as I described)

Please Log in or Create an account to join the conversation.

More
19 years 1 month ago #13817 by mdvalley
Replied by mdvalley on topic The Quest To Spew
I sent off the (hopefully) final spewer package to GrampaTrout (because he’s the head dev) and cambragol (because I have his e-mail address). If the rest of you want this, post your spambot-safed e-mail here or ask GT/cambragol to send it. Tell me if you manage to break something. Saving and the wingman cargo commands are the only things I can think of that I haven’t covered. The files I sent assume that tETradeBuy and tETradeSell haven’t changed from the ones in the release. If they have, well then you have some merging to do.

Please Log in or Create an account to join the conversation.

More
19 years 1 month ago #13818 by GrandpaTrout
Replied by GrandpaTrout on topic The Quest To Spew
This is really great! We will work it into the code for the next release. Those into realistic simulation should really enjoy it.

Please Log in or Create an account to join the conversation.