Collision group tutorial/reference (including naval/amphibious/hover units) [message #486392] |
Mon, 24 February 2014 17:08 |
|
Every physics object in Renegade has a collision group type that describes which other collision types it can collide with.
Note that this has nothing to do with the rendering engine collision settings (physical, projectile, vis, camera, vehicle) that you set in gmax/3ds max
Scripts 4.x adds a number of new collision group types for various features including boats, subs, hover units, amphibious units and underground units.
The full list of collision types (and the in-game numbers that represent them) is:
- Default = 0
- Uncollideable = 1
- Terrain Only = 2
- Bullet = 3
- Terrain and Bullet = 4
- Bullet Only = 5
- Soldier = 6
- Soldier Ghost = 7
- C4 = 8
- Underground = 9
- Soldier Only = 10
- Soldier Bullet = 11
- Terrain = 15
- Water Surface = 16
- Water Edge Block = 17
- Water Edge Allow = 18
- Beach Edge = 19
- Naval Unit = 20
- Beaching Unit = 21
- Hover Unit = 22
- Amphibious Unit = 23
- Amphibious Unit Floor = 24
This image
shows what collision types each collision type can collide with.
Note that you can put any collision type on any object e.g. you aren't restricted to using C4 on just C4 objects. The names just indicate their intended purpose.
Terrain always has a collision type of "Terrain". Tiles by default have a collision type of "Terrain" by default but can be changed using the drop-down list in leveledit.
Objects (i.e. the stuff under "object" in leveledit) can have the script SH_CustomCollisionGroup added that will let you set the collision group using the numbers in the list above.
By default beacons will have a collision group type of "Terrain and Bullet", C4 will have a collision group type of "C4", Cinematic objects will have a collision group type of "Terrain", Powerups will have a collision group type of "Terrain" or possibly "Uncollideable" (I cant tell from the code which it is, seems to depend on whether its pre-placed in LE or spawned by a script/spawner), Special Effects objects will have a collision group type of "Uncollideable".
Soldiers can have various collision groups at runtime depending on their state so using SH_CustomCollisionGroup on a soldier object will not work.
For programmers you can look at the source code of SH_CustomCollisionGroup and the enum in physdefclass.h to see how to set collision group programmatically.
The Disable_All_Collisions script command sets the objects group type to "Uncollideable". The Disable_Physical_Collisions script command sets the objects group type to "Bullet Only" and the Enable_All_Collisions script command sets soldier objects to "Soldier" and all other objects to "Default"
Coming up in part 2, a guide to how to use the collision stuff to implement naval logic as seen in Red Alert: A Path Beyond (boats, subs and LSTs) and how to use it to implement units similar to the Amphibious APC and Hover MRLS in Tiberian Sun Reborn
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
[Updated on: Tue, 25 February 2014 00:35] Report message to a moderator
|
|
|