Jump to content

2.5.6 and mods: Use the new mod structure


Recommended Posts

I have only been able to test this very briefly as I, as many others, have rolled back to 2.5.5 awaiting a hotfix.

 

So far I found out that static objects still work when you refrain from using the old "GT" method and use the database structure instead.

 

An example of the old method would be:

 

-- Helicopter Handler

mount_vfs_model_path	(current_mod_path.."/Shapes")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_Dolly")

GT = {};
set_recursive_metatable(GT, GT_t.generic_stationary)
set_recursive_metatable(GT.chassis, GT_t.CH_t.STATIC);
GT.chassis.life = 1500

GT.visual.shape = "HG_Helicopter_handler.EDM"
GT.visual.shape_dstr = "HG_Helicopter_handler.EDM"

--Burning after hit
GT.visual.fire_size = 1 --relative burning size
GT.visual.fire_pos = {0,0,0};
GT.visual.fire_time = 30 --burning time (seconds)
GT.time_agony = 180;

--Name Stuff
GT.Name = "HG_Helicopter Handler"
GT.DisplayName = _("*HG_Helicopter Handler")
GT.Rate = 1

GT.DetectionRange  = 0;
GT.ThreatRange = 0;
GT.mapclasskey = "P0091000076";
GT.attribute = {wsType_Ground,wsType_Tank,wsType_Gun,wsType_GenericFort,"Fortifications",};
GT.category = "Fortification";
               
add_surface_unit(GT)

 

"New" method would be to create an entry.lua that points to a database .lua file like this:

 

entry.lua:

declare_plugin("Helicopter Accessoires Pack by DrummerNL / Hollowpointgames",

{
image     	 = "image.bmp",
installed 	 = true, 
dirName	  	 = current_mod_path,

fileMenuName = _("HAP"),
version		 = "1.5",		 
state		 = "installed",
info		 = _("Adds a number of helicopter related items to the mission editor."),


encyclopedia_path = current_mod_path .. '/Encyclopedia',
})
----------------------------------------------------------------------------------------
dofile(current_mod_path.."/Database/db_HG_objects.lua")
mount_vfs_model_path	(current_mod_path.."/Shapes") --Path to the folder with the EDM files.
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_Dolly")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_Helipad1") --Path to the folder with the textures.
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_LoggingPad") --Path to the folder with the textures.
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_LoggingPad_Winter")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_Pier")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_SlopePad")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_SlopePad_Winter")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_Tent")
mount_vfs_texture_path  (current_mod_path.."/Textures/HG_HelisimmerHQ")
plugin_done()

 

Then create the database (in this case db_HG_objects.lua)

local function add_structure(f)
if(f) then
	f.shape_table_data = 
	{
		{
			file  	    = f.ShapeName,
			life		= f.Life,
			username    = f.Name,
			desrt       = f.ShapeNameDestr or "self",
		    classname 	= f.classname   or "lLandVehicle",
			positioning = f.positioning or "BYNORMAL" -- {"BYNORMAL", "ONLYHEIGTH", "BY_XZ", "ADD_HEIGTH"}
		}
	}
	if f.ShapeNameDestr then
		f.shape_table_data[#f.shape_table_data + 1] = 
		{
			name  = f.ShapeName,
			file  = f.ShapeNameDestr,	
		}
	end
	
	
	f.mapclasskey = "P0091000076";
	f.attribute = {wsType_Static, wsType_Standing}
	
	add_surface_unit(f)
	GT = nil;
else
	error("Can't add structure")
end;
end

--Hollowpointgames Helicopter Handler

add_structure({
Name 		 =  "HPG_Helicopter Handler",
DisplayName  = _("*HPG Helicopter Handler"),
ShapeName	 =   "HG_Helicopter_handler.EDM",
Life		 =  2500,
Rate		 =  100,
category     =  'Fortification',
SeaObject    = 	false,
isPutToWater =  false,
numParking   =  1,
})

 

Hope this helps. This is what the mod file structure should look like:

database.png


Edited by Polychop Simulations

Community Manager Account



DrummerNL

[TABLE]

[/TABLE]

Discord - Facebook - Gazelle sitreps

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Thanks a lot ... it is a bit over my head, but I will try to see if this can fix the VPC Airfield Objects Mod, as that is the one I miss the most :)

 

 

Eduardo

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

Can't guarantee it works, at least my personal mods using this file and scripting structure still work in 2.5.6. I can't test any further until I update to 2.5.6 again after rolling back. Let me know if it works for you.

Community Manager Account



DrummerNL

[TABLE]

[/TABLE]

Discord - Facebook - Gazelle sitreps

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

Can't guarantee it works, at least my personal mods using this file and scripting structure still work in 2.5.6. I can't test any further until I update to 2.5.6 again after rolling back. Let me know if it works for you.

 

Everything I have personally made using the 2.5 system still works. If the shape data did not contain a LOD file then it needed to be added. Beyond that I'm still testing looking for issues.

Link to comment
Share on other sites

Everything I have personally made using the 2.5 system still works. If the shape data did not contain a LOD file then it needed to be added. Beyond that I'm still testing looking for issues.

 

Goody for you... everything I've made is borked.

 

I'm did this and it shows up in the ME but completely gone in game..

The only way to make sense out of change is to plunge into it, move with it, and join the dance.

"Me, the 13th Duke of Wybourne, here on the ED forums at 3 'o' clock in the morning, with my reputation. Are they mad.."

https://ko-fi.com/joey45

 

Link to comment
Share on other sites

Okey, the boats can wait.

 

The warning aircraft armed sign is fixed but my target buildings have a destroyed model so any info on that?

 

EDIT: scrap that they are still bugged..


Edited by joey45

The only way to make sense out of change is to plunge into it, move with it, and join the dance.

"Me, the 13th Duke of Wybourne, here on the ED forums at 3 'o' clock in the morning, with my reputation. Are they mad.."

https://ko-fi.com/joey45

 

Link to comment
Share on other sites

Thanks a lot ... it is a bit over my head, but I will try to see if this can fix the VPC Airfield Objects Mod, as that is the one I miss the most :)

 

 

Eduardo

 

Thank you! that will be awesome. It´s one of my main MODS. My "fix" for now is to use as ground vehicles/fortifications and not statics. Then they (some of them, not tested all) show up in the mission.

 

Best regards,

F.


Edited by fagulha

 - "Don't be John Wayne in the Break if you´re going to be Jerry Lewis on the Ball".

About carrier ops: "The younger pilots are still quite capable of holding their heads forward against the forces. The older ones have been doing this too long and know better; sore necks make for poor sleep.'

 

PC: I7 4790K 4.6ghz | 32GB RAM | Zotac GTX 1080Ti 11Gb DDR5x | Water cooler NZXT AIO Kraken x53 | 3.5TB (x4 SSD´s) | Valve Index| Andre´s JeatSeat.

Link to comment
Share on other sites

Tutorial with fixes, destroyed model and collision posted here : https://forums.eagle.ru/showthread.php?t=264109

 

Thanks a lot, I’m glad to see you helping to overcome this situation ... I miss the VPC mod so much, but dont want to revert to 2.5.5 as I’m sure that the moment I do revert, the Supercarrier will came along the following week :(

 

For work: iMac mid-2010 of 27" - Core i7 870 - 6 GB DDR3 1333 MHz - ATI HD5670 - SSD 256 GB - HDD 2 TB - macOS High Sierra

For Gaming: 34" Monitor - Ryzen 3600X - 32 GB DDR4 2400 - nVidia GTX1070ti - SSD 1.25 TB - HDD 10 TB - Win10 Pro - TM HOTAS Cougar - Oculus Rift CV1

Mobile: iPad Pro 12.9" of 256 GB

Link to comment
Share on other sites

  • 10 months later...
positioning = f.positioning or "BYNORMAL" -- {"BYNORMAL", "ONLYHEIGTH", "BY_XZ", "ADD_HEIGTH"}

Using "BY_XZ" implies giving coords ? ( if its the case how it should be the line ? )

There is any chance to give like the case of ships a coordinate pos from the center of the object for the landing zone ? 


Edited by Gone1Crazy

[sIGPIC][/sIGPIC]

Link to comment
Share on other sites

  • 2 years later...

When my object is destroyed instead of showing the destruction EDM , the unit just remains as is with a fire effect . The object itself  does even dissapear in game , however on map it does

Shapes are as follows :

Platform_bridge.EDM
Platform_bridge_coll.EDM
Platform_bridge.lods (to describe collision edm)

Platform_bridge_Destr.EDM


Database

local function add_structure(f)
    if(f) then
        f.shape_table_data = 
        {
            {
                file          = f.ShapeName,
                life        = f.Life,
                username    = f.Name,
                desrt       = f.ShapeNameDestr or "self" ,

                    classname   = f.classname   or "lLandVehicle",
                positioning = f.positioning or "ONLYHEIGTH"   
            }
        }
        if f.ShapeNameDestr then
            f.shape_table_data[#f.shape_table_data + 1] = 
            {
                name  = f.ShapeName,
                file  = f.ShapeNameDestr,
                fire          = { 240, 2};
            }
        end
        
        f.mapclasskey = "P0091000022";
        f.attribute = {wsType_Static, wsType_Standing} -- if 'attribute' == nil then insertion will be aborted
        
        add_surface_unit(f)
        GT = nil;
    else
        error("Can't add helipads")
    end;
end

 add_structure({
 Name          =  "Platform_bridge",
 DisplayName  = _("Platform_bridge"),
 ShapeName     =   "Platform_bridge",
 ShapeNameDestr = "Platform_bridge_destr",
 Life         =  10,
 Rate         =  100,
 category     =  'Heliport',
 subCategory     =  'SeaShelfObject',
 SeaObject    =     true,
 isPutToWater =  true,
 positioning  =     "NO",
 classname    =  "lOilPlatform",
 numParking   =  1,
} )


Any help appreciated ! Thanks

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...