Creating several unit bp sharing same graphics ressources

Everything about mods can be found here.

Moderator: Morax

Creating several unit bp sharing same graphics ressources

Postby Franck83 » 31 Jul 2017, 05:47

Hi, maybe someone can help me :

I need to create a certain number of units with little different bp informations but with same mesh, albedo and normal map. Maybe juste some specular differences (like in the screenshot below).

Spoiler: show
Some unit features cannot be modified on the fly during mod execution. They need to be in the unit bp at mod loading.

For example i want to do an upgrade to my tech 3 aircraft so they can target and destroy nuclear nukes at post-combustion speed. At the same time, another upgrade allows my tech 3 interceptors to do fast storm ground attack with special missiles amo. This is possible but i need to create an alterego bp unit which will remplace my normal unit at upgrade.



Image

Since, i need to create 1 bp unit for each upgrade, i would not like my mod to be heavy with a lot of duplicated graphical data. So is it possible to create only bp units that can share graphical data (meshes...) ? I tried with no success but i've no experience with graphical part of unit creation.
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Creating several unit bp sharing same graphics ressource

Postby CookieNoob » 31 Jul 2017, 10:30

yes thats possible, just put the complete path of the ressources you want to share in the blueprints.
https://github.com/Nomads-Project/nomad ... nit.bp#L63
this is the civilian version of the spaceship of the nomads, it uses the same model, albedo, specteam as the ship that drops the acu at the start of a nomads game.

unit folder for INC0001: https://github.com/Nomads-Project/nomad ... ts/INC0001 (no scm or dds file here)
assets are loaded from INO0001: https://github.com/Nomads-Project/nomad ... ts/INO0001


for these things you want to do: why dont you just add weapons to the original unit and enable them when the unit is upgraded?
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: Creating several unit bp sharing same graphics ressource

Postby Franck83 » 31 Jul 2017, 11:02

That's amazing, thank you cookienoob :)

for these things you want to do: why dont you just add weapons to the original unit and enable them when the unit is upgraded?


Good idea i need to brainstorming it a little :). So you can add weapons at the blueprint.lua file, without editing bp files. But i need to make some little graphics differences (specular / albedo) so the player will now what kind of aircraft is coming after the upgrade.
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Creating several unit bp sharing same graphics ressource

Postby CookieNoob » 31 Jul 2017, 11:25

I worked a lot on nomads, thus my examples are mostly from there :) the nomad acu has an upgrade (PowerArmor) that changes the appearance of the unit a bit
https://github.com/Nomads-Project/nomad ... it.bp#L603
The upgrade overwrites several texture files:
https://github.com/Nomads-Project/nomad ... or_Mesh.bp
that should be possible in this case as well.
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: Creating several unit bp sharing same graphics ressource

Postby Franck83 » 31 Jul 2017, 11:30

Very nice, So you just need to do a setmesh method after the upgrade ?
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83

Re: Creating several unit bp sharing same graphics ressource

Postby CookieNoob » 31 Jul 2017, 11:35

yes (I cant test it at though)

for the upgrade of the acu it is done here: https://github.com/Nomads-Project/nomad ... t.lua#L610
Check out the next level of maps: viewtopic.php?f=53&t=13014
For adaptivity, customizability and less clutter in the vault.
User avatar
CookieNoob
Priest
 
Posts: 477
Joined: 02 Aug 2014, 17:07
Has liked: 65 times
Been liked: 249 times
FAF User Name: CookieNoob

Re: Creating several unit bp sharing same graphics ressource

Postby Franck83 » 31 Jul 2017, 11:37

My brain is burning, ty a lot this opens some fantastic path for modding :shock: !
Alliance of Heroes Mod is out ! Try it ! It's in the Mod Vault !
User avatar
Franck83
Evaluator
 
Posts: 538
Joined: 30 Dec 2016, 11:59
Location: France
Has liked: 114 times
Been liked: 122 times
FAF User Name: Franck83


Return to Mods & Tools

Who is online

Users browsing this forum: No registered users and 1 guest