Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » MapFix Plugin
Re: MapFix Plugin [message #492337 is a reply to message #492314] Sun, 30 April 2017 12:47 Go to previous messageGo to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma:
General (3 Stars)
jonwil wrote on Fri, 28 April 2017 06:41

If you want to find the exact position/facing of, say, the Nod Refinery MCT (that is, the physics object that counts as the MCT and will take the extra MCT damage when hit), do this:

#include "buildingaggregateclass.h"
#include "buildinggameobj.h"
#include "matrix3d.h"

//somewhere in your code
BuildingGameObj *obj = Find_Refinery(0);
BuildingAggregateClass *ba = obj->Find_MCT();
Matrix3D tm = ba->Get_Transform();
Vector3 position = tm.Get_Translation();
float rotation = RAD2DEG(tm.Get_Z_Rotation());


Change the first line of code as appropriate to find the MCT for different buildings.
The position/rotation values you just obtained can be passed to Commands->Set_Position and Commands->Set_Facing as appropriate.

The values you get here should match exactly to what you would see if you opened up the .lvl file in LevelEdit and double clicked on the MCT object.







Toggle Spoiler


The Position I get from Find_MCT on canyon.
I cant get the facing it is always 0.

Position -74.823540 -128.861725 1.024454 Rotation 0.000000 Facing 0.000000

Do you know if this is something that could be fixed by editing the mctfix w3dfiles. The mct is centered 0.0.0 in the gmax file.

The correct position for canyon

MCT_Position_X=-74.803001
MCT_Position_Y=-128.895004
MCT_Position_Z=1.486000
MCT_Facing=90.000000


Correcting the facing and position in game.

https://s3.postimg.org/mlw3gua5r/Screenshot.6.png

https://s3.postimg.org/59vqvegof/Screenshot.7.png

https://s3.postimg.org/t2526xipb/Screenshot.8.png





http://s18.postimage.org/jc6qbn4k9/bricks3.png

[Updated on: Sun, 30 April 2017 12:51]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Some simple C# code for retrieving servers and server info from the GameSpy master list
Next Topic: [SSGM 4.0 Plugin] Building Revival Console Commands v2.0
Goto Forum:
  


Current Time: Thu Jan 02 18:52:20 MST 2025

Total time taken to generate the page: 0.00692 seconds