Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Directly manipulate col-settings in w3d?
Directly manipulate col-settings in w3d? [message #326747] Fri, 18 April 2008 19:49 Go to next message
rrutk is currently offline  rrutk
Messages: 617
Registered: June 2007
Karma: 0
Colonel
Is there a way to directly change collision settings of meshes in the w3d-file?

In w3d-viewer it seems to be possible to SEE each setting, but not to change?

http://tw.united-forum.de/Renegade/Temp/col.jpg
Re: Directly manipulate col-settings in w3d? [message #326755 is a reply to message #326747] Fri, 18 April 2008 21:01 Go to previous messageGo to next message
saberhawk
Messages: 1068
Registered: January 2006
Location: ::1
Karma: 0
General (1 Star)
Import it and edit the settings and then export it again is one option.

The other option, if you are good with a hex editor, is to look for w3d_file.h and parse out the file, editing the "Flags" field of the CHUNK_MESH header.
Re: Directly manipulate col-settings in w3d? [message #326774 is a reply to message #326747] Sat, 19 April 2008 01:12 Go to previous messageGo to next message
LR01 is currently offline  LR01
Messages: 842
Registered: April 2006
Location: The Netherlands
Karma: 0
Colonel
rrutk wrote on Sat, 19 April 2008 04:49

Is there a way to directly change collision settings of meshes in the w3d-file?

In w3d-viewer it seems to be possible to SEE each setting, but not to change?

http://tw.united-forum.de/Renegade/Temp/col.jpg


well, maybe that is why the called it w3d-viewer?


Moding can be real Fun...
Re: Directly manipulate col-settings in w3d? [message #326792 is a reply to message #326755] Sat, 19 April 2008 05:32 Go to previous messageGo to next message
rrutk is currently offline  rrutk
Messages: 617
Registered: June 2007
Karma: 0
Colonel
Saberhawk wrote on Fri, 18 April 2008 23:01

Import it and edit the settings and then export it again is one option.

The other option, if you are good with a hex editor, is to look for w3d_file.h and parse out the file, editing the "Flags" field of the CHUNK_MESH header.


Tried the import thing for hours, doesnt work properly.

within this model only the collision-setting for the mainbody must be set the "projectile", then it is fixed.

And yes, I've used a hexeditor a few times.

BUT NEED TO KNOW THE CORRECT PLACE...

The flags are:
define W3D_MESH_FLAG_COLLISION_TYPE_MASK 0x00000FF0 // mask for the collision type bits
#define W3D_MESH_FLAG_COLLISION_TYPE_SHIFT 4 // shifting to get to the collision type bits
#define W3D_MESH_FLAG_COLLISION_TYPE_PHYSICAL 0x00000010 // physical collisions
#define W3D_MESH_FLAG_COLLISION_TYPE_PROJECTILE 0x00000020 // projectiles (rays) collide with this
#define W3D_MESH_FLAG_COLLISION_TYPE_VIS 0x00000040 // vis rays collide with this mesh
#define W3D_MESH_FLAG_COLLISION_TYPE_CAMERA 0x00000080 // camera rays/boxes collide with this mesh
#define W3D_MESH_FLAG_COLLISION_TYPE_VEHICLE 0x00000100 // vehicles collide with this mesh (and with physical collision meshes)

[Updated on: Sat, 19 April 2008 05:53]

Report message to a moderator

Re: Directly manipulate col-settings in w3d? [message #326794 is a reply to message #326755] Sat, 19 April 2008 06:59 Go to previous message
rrutk is currently offline  rrutk
Messages: 617
Registered: June 2007
Karma: 0
Colonel
Saberhawk wrote on Fri, 18 April 2008 23:01

Import it and edit the settings and then export it again is one option.

The other option, if you are good with a hex editor, is to look for w3d_file.h and parse out the file, editing the "Flags" field of the CHUNK_MESH header.


Saberhawk, you are a hero! Smile

I wasted hours and hours trying to redo the beta orca, but without the best result.

changing the collision settings in the hexeditor is real easy, if one got the trick.

so you have to lock in the header of each mesh for this string: "02 00 04 00 XX"
-> the XX is the Col Settings flag!

E.g. change it to 02 00 04 00 20 to make projetiles hit!

Edit: The 02 00 04 00 was just for this model. The best way is to make an other w3d-file with the settings you like and compare the two files in hexeditor to find the correct place for editing.

Its always the fourth byte before meshname.

[Updated on: Sat, 19 April 2008 11:46]

Report message to a moderator

Previous Topic: Target Aim Lasers [help]
Next Topic: Powerups
Goto Forum:
  


Current Time: Tue Nov 19 03:19:30 MST 2024

Total time taken to generate the page: 0.00701 seconds