Jump to content

How to add statics with collision and destroyed model in 2.5.6


dimitriov

Recommended Posts

If an admin could stick this ;)

 

Hi guys,

 

So, let's get started.

 

Example linked in end of the post.

 

1) Mod organization :

 

Post 2.5.6 static mods shall use the new database way of working. Which means this :

 

attachment.php?attachmentid=227921&stc=1&d=1582041858

 

 

 

 

 

 

In the Shapes folder, you need this kind of organization :

 

attachment.php?attachmentid=227922&stc=1&d=1582042334

 

 

With in this example :

 

- Container_coll.EDM : The collision file for your object. You need to make it in

3dsMax.

- Container_Desert.EDM : Your main file EDM

- Container_destr.EDM : Your destroyed model

- Container_Desert.lods : a txt file whose extension has been changed to "lods", with this included :

 

model = {

lods = {

{"Container_Desert.edm",30000.0},

},

collision_shell = "Container_coll.edm";

}

 

 

In this simple example : there is only one LOD, it will appear up to 30 000 m (not good for optimization for you info), and the collision model is selected.

 

 

2) The Database folder

 

It only needs to contain one file, though you can create as many as you want, it should be named this way, the "DIM" being the name you want to give :

 

attachment.php?attachmentid=227923&stc=1&d=1582042661

 

In this file, you get this :

 

A) The call for textures and shapes, written this way :

 

mount_vfs_model_path (current_mod_path.."/Shapes")

mount_vfs_texture_path (current_mod_path.."/Textures/Containers")

 

 

B) The main function, which has to be written only once at the beginning, and which differs from the already given POLYCHOP user (little mistake in the destroyed shape file designation) :

 

 

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.ShapeNameDestr,

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

 

 

C) Finally, your file description :

 

add_structure({

Name = "Container_Desert", --ID name

DisplayName = _("FARP CONTAINER DESERT"), --Ingame display name

ShapeName = "Container_Desert", --Main shape name (Lods selection will be automatic)

ShapeNameDestr = "container_destr", --Destroyed Shape

Life = 10, --Life

Rate = 10, --Score when destroyed

category = 'Fortification',

SeaObject = false,

isPutToWater = false,

})

 

 

 

THE SHAPE NAMES SHOULD NOT BE ENDED BY A .EDM, like "Container_Desert.EDM", else, the collision will not work !

 

 

4) Finally, your entry.lua in the main folder :

 

declare_plugin("J'ai une énorme queue",

 

{

image = "SOO.bmp",

installed = true,

dirName = current_mod_path,

 

 

fileMenuName = _("SOO"),

version = "2.5",

state = "installed",

info = _("Bloub"),

 

 

 

})

----------------------------------------------------------------------------------------

mount_vfs_model_path (current_mod_path.."/Shapes")

mount_vfs_liveries_path (current_mod_path.."/Liveries")

mount_vfs_sound_path (current_mod_path.."/Sounds")

-------------------------------------------------------------------------------------

 

-------------------------------------------------------------------------------------

 

-------------------------------------------------------------------------------------

dofile(current_mod_path.."/Database/db_DIM_objects.lua")

 

plugin_done()

 

 

 

 

 

 

 

 

 

 

 

EXAMPLE / https://drive.google.com/file/d/1nqJ_-4qzJEQdYKL5QuO2gOJ44ro1-D9p/view?usp=sharing

1.thumb.jpg.2d9bcc9f6a65c4bcafe40f91b89bf9b7.jpg

2.jpg.05a7d0d397cb3e447beee14432996272.jpg

3.png.9ee4b2ae4cbf41b596dddef918d5e90e.png


Edited by dimitriov
  • Like 1
Link to comment
Share on other sites

declare_plugin("J'ai une énorme queue",

 

That's what i call a nice plugin description :lol::lol::lol:

Member of the Virtual Patrouille Suisse Since 2010. High and slow, fast and low.

Intel i9-12900k | 64GB RAM | RTX4090 | HP Rerverb G2 | T-50CM3 Base | WinWing Set

Link to comment
Share on other sites

This is only for statics? I was using the VPC objects as fortification units, in order to have their lighting animations to work.

 

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

I checked the collisions in the old version of VPC, everything works fine.

 

Hello Voc, glad to see you back. Can you please upload the most current version of your Mod somewhere (or update the one that is at VirPil's website) ?

 

I can't get the Mod to work anymore, since the release of 2.5.6 :(

 

Thanks a lot,

 

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

Rudel_chw Hi Eduardo. I haven't decided whether I'm going to fix it or not. There are so many things to fix, it will take a lot of time.

 

Thanks for the response .. I fully understand you, real life is important and DCS is just a hobby :)

 

If you finally do decide to fix it, perhaps you could consider to do a smaller Mod Pack, as many items are not actually widely used (at least that's my experience), while others are used a lot.

 

A useful subset of the current Mod, would be these elements:

 

VPC-NATO-Light Tower v2 & v3

VPC-NATO-Protection

VPC-NATO-Control Tower

VPC-NATO-Canopy

VPC-NATO-Firehouse

VPC-NATO-AGM65 Containers

 

VP-Lighting Tower

VP-GOTB 100m 250m & 750m

VP-CZT-1 2 & 3

VP-CZT-Kaponir

VP-Big Angar

VP-Barrier

VP-RZona

VP-Zabor 200m

VP-Firehouse

VP-Angar

VP-Su 24

VP-Su 35 Damage

VP-Su 35 Stair

VP-Su 35 Cloth

VP-Su 35 Car

VP-T-50 Cloth

VP-House Admin

VP-URAL Apa

VP-URAL Tent

VP-Streetlight

VP-SKP

VP-Electric Sub Station

VP-AZT-60

 

Best regards and thanks a lot for creating this Mod on the first place :)

 

 

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

  • 1 month later...

Hi dimitriov,

 

Thanks a lot for sharing this valuable info.

 

I wish I could find a post like this like a year ago...

I learned the few things I know digging in other people Mods and was not a very productive technique to be honest.

 

I was up to write a post about how to static objects with liveries and then just found yours.

 

Happy that I can learn something else in your post (I am in a very basic stage of DCS code understanding...)

 

I uploaded a Small example also here (more BASIC than yours):

 

https://www.digitalcombatsimulator.com/en/files/3308885/

 

The EDM and textures can be easily replaced by any user to display their own model ingame without touching any line of code. That way maybe people get hooked and start the journey to their own mods and so on... :]

 

Will be great if you continue to share your knowledge with us in "another chapter" :thumbup:

 

Thanks!

Link to comment
Share on other sites

  • 9 months later...

This post looks like it would be very useful for someone (like me) trying to figure out how to get a static object into the game. Unfortunately, the image attachments in the original post are broken, which makes it much less useful. Would it be possible to fix the attachments?

Link to comment
Share on other sites

  • 3 weeks later...
  • Recently Browsing   0 members

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