Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Release Forum » MapFix Plugin
MapFix Plugin [message #492305] Thu, 27 April 2017 18:39 Go to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
I have not worked on this in a while, thought I would post it. It still needs some work before public use. I Hope this is helpful to someone else. This can be useful if your server has custom stock maps. You can apply the zone fixes Iran added to stock maps long ago.
Also if you want to use the pure stock maps you can still apply the zones fixes or replace the existing zones. You can disable/enable each zone individually. Specify the Zone, Add your own script to the zone and send parameters. Create a custom zone.
As well as adding my attempt to fix the missing nod refinery aggregate.


Readme Info

Toggle Spoiler


Add settings to da.ini

Toggle Spoiler


Example mapfix.ini

Toggle Spoiler





http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: MapFix Plugin [message #492307 is a reply to message #492305] Thu, 27 April 2017 23:12 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4309
Registered: April 2011
Karma: 0
General (4 Stars)
Can't you just get the MCT position based on Refinery position and rotation/facing?

I'll see about adding support for b2b prevention.


Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Thu, 27 April 2017 23:19]

Report message to a moderator

Re: MapFix Plugin [message #492310 is a reply to message #492307] Thu, 27 April 2017 23:56 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
iRANian wrote on Fri, 28 April 2017 00:12

Can't you just get the MCT position based on Refinery position and rotation/facing?

I'll see about adding support for b2b prevention.


Yea but its not exact. Has an offset for some reason. If you check it out disable MCT_ReadINI and you will see what I mean.


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

[Updated on: Fri, 28 April 2017 00:03]

Report message to a moderator

Re: MapFix Plugin [message #492311 is a reply to message #492305] Fri, 28 April 2017 04:13 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4309
Registered: April 2011
Karma: 0
General (4 Stars)
Ah. Apparently LevelEdit places stuff higher by 2.0f Z height

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases

[Updated on: Fri, 28 April 2017 04:13]

Report message to a moderator

Re: MapFix Plugin [message #492313 is a reply to message #492305] Fri, 28 April 2017 05:39 Go to previous messageGo to next message
Wyld1USA is currently offline  Wyld1USA
Messages: 396
Registered: January 2004
Karma: 0
Commander
OMG you all get me excited when you talk coding......

http://i66.tinypic.com/24ca5ur.jpg
"Who cares what people think, it is what you know." "Feel the Love."
~Original Demo Player~
Re: MapFix Plugin [message #492314 is a reply to message #492305] Fri, 28 April 2017 05:41 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

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.


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
Re: MapFix Plugin [message #492316 is a reply to message #492305] Fri, 28 April 2017 12:44 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4309
Registered: April 2011
Karma: 0
General (4 Stars)
btw jonwil that frametime checker thing using those variables you showed works extremely well bro

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: MapFix Plugin [message #492333 is a reply to message #492313] Sun, 30 April 2017 00:21 Go to previous messageGo to next message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
General (3 Stars)
Wyld1USA wrote on Fri, 28 April 2017 06:39

OMG you all get me excited when you talk coding......


Yea we are a bunch or nerds. HaHa


http://s18.postimage.org/jc6qbn4k9/bricks3.png
Re: MapFix Plugin [message #492337 is a reply to message #492314] Sun, 30 April 2017 12:47 Go to previous message
Gen_Blacky is currently offline  Gen_Blacky
Messages: 3250
Registered: September 2006
Karma: 1
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

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: Mon Dec 30 10:06:44 MST 2024

Total time taken to generate the page: 0.00953 seconds