Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Collision group tutorial/reference (including naval/amphibious/hover units)
Re: Collision group tutorial/reference (including naval/amphibious/hover units) [message #486398 is a reply to message #486392] Tue, 25 February 2014 04:00 Go to previous message
jonwil is currently offline  jonwil
Messages: 3555
Registered: February 2003
Karma:
General (3 Stars)

Ok, now for the tutorial on naval units. Other than the aforementioned worldbox changes, they are just like any other vehicle. The boats (including naval transports) are set up as tracked vehicles (with invisible wheels). The submarines need to be set up as VTOL vehicles so the can move up and down in the water. The only other setting required is to set the "type" as appropriate (either Boat or Sub depending on what you are making). Everything else is as normal for vehicles.

As for scripts, both boats and subs require SH_CustomCollisionGroup with a setting of 20 aka "naval unit".
Units that can come onto the beach but not onto land more generally (i.e. naval transports) need a setting of 21 aka "beaching unit".

For the water surface in the naval logic, you need to make the actual visible water surface a separate mesh. You need 2 meshes, one facing up for the top surface (which will dictate how low into the water boats will go) and one facing down for the bottom surface (which will dictate how high up subs will go) and is what people in submarines see when they are underwater. They need "physical" collision ticked and nothing else (technically they dont need to be 2 separate meshes but the example I am working from has them as 2 separate meshes). Export this as terrain. In leveledit, you need to make this as a tile with StaticPhys, "IsNonOccluder" ticked, "water surface" collision and "default" visibility mode and place it in your level.

Next up, you need a blocker around the edge of the water (this will limit where naval vehicles can go). This should also be "physical" collision only and should be hidden so it cant be seen. In-game, its the same as the water surface (StaticPhys etc) except that it needs either collision group "water edge (allow)" (if you want to allow soldiers and normal vehicles into the water) or "water edge (block)" (if you want to block soldiers and normal vehicles from entering the water).

Finally, if you have any vehicles with "beaching unit" set on them, you need another blocker further in (just like the water edge) with "beach edge" collision group.

This concludes the tutorial on collision detection and how to use it to build boats, submarines, naval transports, amphibious units and hover units.

Anyone with questions on all this stuff (or if you are having problems getting it working), feel free to post here or hit me up on IRC/IM.

A tutorial for Naval Factories is on my todo list and will be done soon.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Team Collision
Next Topic: 2 changes to leveledit made in 4.1
Goto Forum:
  


Current Time: Wed May 08 08:56:51 MST 2024

Total time taken to generate the page: 0.00656 seconds