A little backstory
For those who have been playing GMod since around 2011, you may remember an old addon called the Gravity Hull Designator. It was one of the most revolutionary addons to ever come out! It was created by SuperLlama, who later also created another addon called Map Repeater, sharing a lot of the same code with Grav Hull. In essence, it was a way to make infinite maps. Unfortunately, motivation started to drain from the project, and GMod 13, which broke everything, was the final nail in the coffin. SuperLlama moved on to other projects, including Morrowind VR (which is fookn awesome if you’ll excuse the tone-shift.).
Jump to a couple months ago, and the GHD popped up on the workshop a couple times, but most of them were still terribly broken. One kinda-stable one was from user Nightshade (or Derek or Admin or Erik The Born), who was approached by another user, Bull (Par on Facepunch), who had a fix for a few of the issues on the tool. Unfortunately, Map Repeater was left untouched, because the code in it is pretty sophisticated and jeez that’s a lot of variables that loop back on themselves. It was disabled and planned to be cut out of GHD completely.
Then I found the workshop item while browsing, downloaded it, and did a lot of bugfinding. I posted a couple discussion posts, and eventually added Bull and Nightshade. After a quick chat, I decided to dive into the Map Repeater code and see if I survive. Two days later, I discovered a single hook that was mistyped. I corrected it and bam, Map Repeater was fixed. And there was much celebration (I got drunk on accident while playing CS: GO). Anyway, after that I added SuperLlama, who has been acting as an advisor for the project, and we’ve been working on fixin’ this addon for you guys.
Onto stuff that actually matters!
What defines the hull?
The interior of the hull is defined as the set of locations where there is a floor under you, and if the point’s elevation from the floor exceeds the vertical protrusion factor, it also requires at least one non-floor (a wall or ceiling).
What this ISN’T:
• NOT a module, the mod is made entirely with lua and has no dependencies.
• NOT a reimplementation of source physics, it’s a complex illusion that involves a room in the middle of nowhere.
• NOT a wall walking mod, though it can be used on something and then rotated 90 degrees so that down is now the wall.
• NOT a spherical planet mod. “Down” inside the ship is defined as the orientation gravity was pulling when the tool was first used. Spawn a dumpster, shoot it, flip it upside-down, and you’re on the ceiling.
• NOT a way to stick to things. Again, down is only one direction internally and you cannot walk around the inside of a ring unless you make it out of multiple hulls, each with their own down. This might be made easier in the future.
• NOT a map entity. I might make a map entity later on that allows the effect to be present, but for now it’s just something you build with.
• NOT a collision engine. This mod uses nothing more than source’s built-in havok implementation, but it sure fools it a lot. Many shortcomings of havok are avoided by making it think something different is happening.
What this mod IS:
• a localized physics environment for any contraption, essentially behaving as if each hull was its own map.
• a tool that anyone can use on any set of welded props that has a clear interior and exterior.
• the first and only complete spazz protection for ships. Since the ghost doesn’t move, entities inside cannot be thrown through the wall.
NOTE: In the future there will be a slider to control how much entities are thrown around by motion, but it will be applied in a backwards manner (negative velocity to the props, not positive velocity to the ghost) to avoid wallclipping, so even a 0% dampener will still stop spazz deaths even though it will throw things around just as much as before.
•** a separate area with its own sense of “down.”** Gravity’s internal direction is defined when you first designate your hull, and does not change relative to the ship’s rotation.
• a stabilizer for pretty much any vehicle you can think of. Boats are especially interesting with the tool applied, because you actually rock back and forth in the water.
• linked with the outside world as seamlessly as possible (WIP)-- the physgun behaves properly for the most part, and you can toolgun entities on the outside while you’re inside a hull, as well as press buttons/get in chairs.
• an override of many built-in functions such as GetPos, so there is a chance that your favorite mod might work with it already without any changes.
• a very convincing illusion. You’re not actually in your ship, but it sure looks like you are. For this reason a lot of things (manhack lights for example) might render in the wrong place. But hey, a video game is just an illusion too, so who cares.
• a simple change brought on by extremely non-simple code, that can revolutionize almost everything else that’s already possible with the simple addition of walking in a moving object and gravity being affected by rotation.
Q: My contraption isn’t working, it says it was designated but it isn’t!
A: Does it have walls or a ceiling? If not, you need to increase the Vertical Protrusion Factor.
Q: Does this work with spheres?
A: Not in the way you’re asking.
Q: Does this work with <<SUBJECT ADDON HERE>>
A: Maybe; depends on what the addon does. There may or may not be conflicts and there’s a decent chance it won’t work inside the hull, but lots of mods do. It’s a matter of overriding the right things and I plan to fix as many of these as I can.
Q: I just want to fly a spaceship, I don’t want people running around climbing walls like spiderman.
A: They can’t. The only way you can walk on a wall is by making a “ship” and rotating it so that its floor is on the wall (or designating the wall with hit surface defines floor checked)-- it’s not just a “climb wherever you want” deal.
Mod work is extremely tiring and hard to get motivated for. Stuff you make for fun gets dropped below stuff you made for money in terms of priorities. Donations? That’s one hell of an incentive to get back to work on it.
[Donate to SuperLlama here! He made this all possible!](https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=OcUYStib-j55V4q1e3ogCrP5eGdDhfuuis1USdFGPVWspGbVmO66rABV4Fa&dispatch=5885d80a13c0db1f8e263663d3faee8d64ad11bbf 4d2a5a1a0d303a50933f9b2)
• Optimize the constraint-enabled in/out scanner to reduce lag.
• Add the ability for the effect to be (adv)duplicated, including objects welded to the inside of the ship.
• Fix the hull within a hull within a hull from sending you to limbo
• Work on making major mods work flawlessly with the mod, especially wire and spacebuild.
• Implement a dampening percentage slider so that values below 100% will allow some inertia through.
• Implement a dampening threshold slider so that only velocity changes above the value will obey the above.
• Recode the physgun beam in lua so that it renders.
• Add a stencil system so you can have the classic “cloaked ship with a doorway” effect.
• Fix parenting with Map Repeater.
• Fix adv dupe weirdness with Map Repeater.
• [del]Fix thirdperson camera colliding with nonexistant brushes in Map Repeater[/del] Done!
• [del]Fix vehicles teleporting to the wrong side of cells[/del] Done!
• Fix NPC walking off a hull causing prop bouncing weirdness.
• Add LOD for infinite maps to render distant cells.
• Cloaking for GHD’s
• [del]Fix weapons in GHD’s being visible when they shouldn’t.[/del] Done!
• Extend cell keyvalues, such as [del]space[/del]Done!, spawning brushes if another brush spawned or didn’t spawn, etc.
Revision 31: The Vehicle Update!
• Fixed thirdperson camera on vehicle colliding with brushes not in your cell.
• Fixed vehicle cell transitions, so now you don’t get teleported to the wrong side of the new cell.
Revision 30: Space added for MapRepeater.
• ShouldCollide confliction resolved with NeuroTec
• Fixed weapons being visible when they shouldn’t.
• Removed FireBullets override that caused crashes.
• Fixed applying a hull on a WAC causing spazzes.
• Changed tool text on GHD.
• Fixed various underwater bugs.
• Added a couple of infinite maps for you guys to play with.
• Uploaded the addon to workshop.
Revision 29: Lots of bug fixes for Map Repeater and GHD, converted both to net messages rather than usermessages.
Revision 28: Fixed Map Repeater for GMod 13.
Revision 27: Fixed the underwater system in gm13.
Revision 26: Ported to Gmod 13, some infinite map fixes, physghosts also should work now.
Revision 25: Fixed smartsnap in infinite maps (partially), fixed spawning initially without weapons.
Revision 24: Fixed hulls from erroring when broken. Added the map used for Map Repeater – uncomment the second line in lua/autorun/gravityhull_init.lua in order to enable it.
Revision 23: Stopped maprepeat from loading, it was breaking spacebuild even in unaffected maps.
Revision 22: SUBMARINES YEAHHHHH
• added the prealpha maprepeat code-- don’t use it yet though.
• fixed players in hulls being invisible underwater.
• fixed players in hulls having incorrect lighting (sort of).
• stopped the water warp effect from being visible when in a hull.
• increased the minimum distance for water fog while in a hull.
Revision 21 fixed the rocket launcher and improved velocity support so that ship velocity is added/subtracted during transitions.
• added FireBullets support, fixing most SWEPs
• fixed ghosted explosives from infinitely exploding
• fixed a stack overflow when welding a contraption to the inside of a hull
• fixed transitions between ships taking too long to reset
• added a player gravity slider (will work on props later on)
• added a Help button to explain how to use the tool
• added a GravHull.RegisterHull(ent,protrusion,gravity) function for developers (YOU WILL NEED TO CALL GravHull.UpdateHull(ent) AFTERWARDS)
Revision 19 fixed stack overflow when welding an object to the inside of a ship
Revision 18 fixed easy weld and keep upright causing an error
Revision 17 added/fixed:
• New Tool Handler
- most tools work both inside and outside the ship now, including many wiremod ones
- physghosts can be constrained, colored, etc, redirecting to the actual entity
- ship prop modifications can be applied from the inside (i.e. color, material)
- should fix most trace-related errors including the WAC helicopter bug
• Fixed entities spawning hundreds of physghosts by accident
• Fixed physghosts permanently setting a prop’s mass to 4768
• Added client console command ‘ghd_fixcamera’ which, if run enough times, should fix the camera bug whenever it occurs
• Fixed open sbep doors in a hull being closed on the inside
Revision 16 re-fixed buttons and chairs
Revision 15 fixed sbep lifts and hopefully spacebuild and stargate.
Revision 14 fixed the AddCSLuaFile bug.
Revision 13 fixed the floor checkbox designating hulls with extremely wrong angles, various lag/crash problems involving the new hull scanner, stopped the tool from designating something that’s already designated, and fixed a bug with physghosts where a prop would disappear if you held a prop, put it in the ship, then walked in yourself without letting go.
Revision 12, added/fixed:
• New Hull Scanner
- ignores no collides
- builds a hull out of welded/nailed props
- adds anything constrained without a weld (ropes, hydraulics) to the “moving parts” list for permanent physghosting, allowing hydraulic doors to function with collision
- two constrained hulls will also add each other as permanent physghosts
• SBEP Door Support
- uses SetNotSolid, so props will remain in the ship until they exit the door
• Vertical Protusion Factor Slider (0 to 300)
- sets the maximum distance from the floor for an entity to be inside the ship without a ceiling or walls
• Hit Surface Defines Floor checkbox
- if checked, gravity will be perpendicular to the normal of your tool’s hit trace
- in laymen’s terms, shoot the surface you want to walk on.
• Stopped rotating objects in a ship from pressing Use
• Applied Divran’s file splits and loader
• Cleaned up the code a bit and moved the globals into a table called GravHull
Revision 11 fixed the chair teleport issue.
Revision 10 re-fixed physghosts, added explosion effects to gas cans, and stops physboxes from crashing
Revision 9 fixes vehicles, the invisible toolgun, no collide (sort of), and hopefully player respawning in ships
Revision 8 should fix the thruster crash (the ship was absorbing itself) and stargates, and the following hooks for easier mod integration:
• ValidHull(ent) – return false to disallow ent from being considered part of the hull geometry
• OnCreatePhysghost(ship,ent,physghost) – used for custom extra steps in the setup of physghosts (the objects you’re actually dragging when you drag physgun something outside from inside a ship)
• AllowGhostSpot(pos) – return false if pos should not be used to spawn ghost ships (i.e. underwater, though this is disabled by default)
Revision 7 should fix Smartsnap and possibly certain aim-based E2’s
Revision 6 should fix the GetPhysicsAttacker crash
Revision 5 fixed:
• Chairs/Buttons not working when welded to a ship
• Sharpeye compatibility (and hopefully other view mods too, if you had the camera bug this should fix it permanently (EDIT: or not))
• Physghosts (they were nonfunctional due to a typo)
Revision 4 fixed entities not ghosting properly
Revision 3 fixed the in/out algorithm giving unexpected results
Why was this reposted?
Bull and I felt like fixed map repeater was a feature to merit a new, fixed release.
And because Bull was having trouble with changing the title :^)