Changing beams and projectiles id on the fly

Everything about mods can be found here.

Moderator: Morax

Changing beams and projectiles id on the fly

Postby Franck83 » 25 Apr 2017, 21:47

Hi everybody,

Maybe you can help me. I'm currently on developping a mod that allows units to upgrade and changing their weapons. Everything is working fine with data about damage, range, radius...thanks to the supcom buff system.

The thing i wanna do now is changing graphical projectiles on the fly when upgrading my units. It's not just a cosmetic change. I can give usefull infos on damage type by looking at projectile graphical effect. The matter is that it's not like modding a fixed unit. And i didn't succeed in hooking createprojectile methods in weapons.lua files. There are so much files. I try modding every area where i found some blueprintid info. I had no success with ChangeProjectileBlueprint method too. I found no example of its use. (maybe because i tried to change a beam weapon ?)

I got the feel i missed something. Is there a function that allows overriding everything to change the projectile id on the fly ? somebody got some experience on this ?

Thanks for your help !
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: Changing beams and projectiles id on the fly

Postby KeyBlue » 25 Apr 2017, 23:07

I don't know much about projectiles, but i think you can probably solve your issue by making multiple variants of the same weapon but each with a different projectile. And when you want to switch projectile you could just change weapon completely.
Or something like that.

Not sure if you can change projectile on the fly, should probably check ACUs to see how they handle upgrades. (if you haven't already ofcourse)
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: Changing beams and projectiles id on the fly

Postby Franck83 » 26 Apr 2017, 08:32

Thanks for your reply Keyblue. Why not adding weapons profile at all units bps at the start. But how switching weapons in the same unit during game ?
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: Changing beams and projectiles id on the fly

Postby KeyBlue » 26 Apr 2017, 13:54

You can enable/disable weapons .
Like in this example: https://github.com/FAForever/fa/blob/de ... pt.lua#L58
Where the UEF ACU only has his maingun and tml and billy are disabled until later.
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: Changing beams and projectiles id on the fly

Postby Franck83 » 26 Apr 2017, 18:39

Thanks for your help Keyblue. But adding new weapon definitions to the bp and activate it need to mod lua scripts unit by unit. I didn't succeed by just modding Blueprints.lua. I wanted a global method not modding each lua unit script. This is because i wanted to let the units bp less modded as possible. A global method is much easier for futher FAF patching and long term maintenance.

But i succeed in the simplest way by using the ChangeProjectileBlueprint method. That was so simple :roll: !
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: Changing beams and projectiles id on the fly

Postby KeyBlue » 26 Apr 2017, 19:07

Ah :p i thought it was only for a specific unit.
Yes its probably not great if you want it for every single unit.

Well good thing you figured it out.
User avatar
KeyBlue
Priest
 
Posts: 403
Joined: 28 Jan 2016, 01:06
Has liked: 140 times
Been liked: 93 times
FAF User Name: KeyBlue

Re: Changing beams and projectiles id on the fly

Postby Exotic_Retard » 26 Apr 2017, 21:08

if you dont want 100 weapons you can have the projectile mesh change with things like SetMesh

and then lots of other stats can be changed too.

if you need more drastic changes you can create a child projectile and pass whatever data needed to it and destroy the original projectile; this is used for a couple of select things like splitting projectiles and mercies
User avatar
Exotic_Retard
Contributor
 
Posts: 1470
Joined: 21 Mar 2013, 22:51
Has liked: 557 times
Been liked: 626 times
FAF User Name: Exotic_Retard

Re: Changing beams and projectiles id on the fly

Postby Franck83 » 26 Apr 2017, 23:11

And changing mesh size in game for units is possible ?
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