Updating Unit Blueprints during a game

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

Updating Unit Blueprints during a game

Postby johnie102 » 21 May 2013, 11:57

Hey, I'm trying to create a certain map script where I would like to disable the veterancy of units.
I thought i could do this by calling unit:GetBlueprint().Veterancy.Level1 = 10000 and so on for the other levels, but this doesn't work because the unit apparantly doesn't check this stat after it has been created. So is there somekind of updateBlueprint function? Is there maybe another method that I don't know about?
Could I just get the blueprint, edit it and then re-register it as a new unit so that I simply create that new unit?

Btw, why is there no general modding forum?
johnie102
Avatar-of-War
 
Posts: 128
Joined: 27 Dec 2012, 22:26
Has liked: 0 time
Been liked: 2 times
FAF User Name: johnie102

Re: Updating Unit Blueprints during a game

Postby The Mak » 21 May 2013, 18:11

Bulletmagnet had created a mod that removed veterancy from all units except the ACU and SCU. I did not see it posted on the GPGNet Vault Mirrors so I have uploaded my copy: Penultimate Vet

What it basically does is replace the veterancy table with an empty table for all units. Maybe this can help you.
User avatar
The Mak
Contributor
 
Posts: 342
Joined: 03 Mar 2012, 21:09
Location: New York, NY, USA
Has liked: 5 times
Been liked: 39 times
FAF User Name: The_Mak

Re: Updating Unit Blueprints during a game

Postby Mr-Smith » 21 May 2013, 18:16

with cheats enabled its possible to change units stats during the game but im nit sure if that counts toward veterancy to.
else you could also try changing the function veterany refers to as they actually just add Hp so if you set the amount to 0 veterancy wont have any effect to
If you can't beat us...
...join us.
Doge This, hover ACU: https://youtu.be/a67tvWmu31Y?list=LLW-T ... O4fQ&t=179
User avatar
Mr-Smith
Evaluator
 
Posts: 523
Joined: 27 Mar 2012, 19:15
Location: Austria
Has liked: 39 times
Been liked: 36 times
FAF User Name: Mr-Smith

Re: Updating Unit Blueprints during a game

Postby FunkOff » 21 May 2013, 18:24

This is impossible. Make a mod to disable veterancy, you cannot do it via map script..... not directly. You can write a script thay remove vet buffs for all units and resets their kill counts tho,
FunkOff
Supreme Commander
 
Posts: 1863
Joined: 26 Aug 2011, 17:27
Has liked: 14 times
Been liked: 43 times
FAF User Name: FakeOff

Re: Updating Unit Blueprints during a game

Postby johnie102 » 22 May 2013, 13:43

SO Funkoff, it should be possible to overwrite the general function that handles killcounts in a map script?
I really wouldn't know how to do that though.
johnie102
Avatar-of-War
 
Posts: 128
Joined: 27 Dec 2012, 22:26
Has liked: 0 time
Been liked: 2 times
FAF User Name: johnie102

Re: Updating Unit Blueprints during a game

Postby FunkOff » 22 May 2013, 17:09

What effect do you want, excatly? Does the kill count bother you or do you just hate it when units get more hp? Each can be solved differently.
FunkOff
Supreme Commander
 
Posts: 1863
Joined: 26 Aug 2011, 17:27
Has liked: 14 times
Been liked: 43 times
FAF User Name: FakeOff

Re: Updating Unit Blueprints during a game

Postby johnie102 » 23 May 2013, 20:41

I have recently released an 8 player version of Zone Control and when you get a certain amount of kills hero units (experimentals) spawn. I would like to disable veterancy effects for them because I think it makes them slightly too powerfull.
Would it be possible to just check the amount of kills and simply hardcode to drop the hp by a certain amount when the veterancy levels are hit?
johnie102
Avatar-of-War
 
Posts: 128
Joined: 27 Dec 2012, 22:26
Has liked: 0 time
Been liked: 2 times
FAF User Name: johnie102

Re: Updating Unit Blueprints during a game

Postby FunkOff » 23 May 2013, 21:36

johnie102 wrote:I have recently released an 8 player version of Zone Control and when you get a certain amount of kills hero units (experimentals) spawn. I would like to disable veterancy effects for them because I think it makes them slightly too powerfull.
Would it be possible to just check the amount of kills and simply hardcode to drop the hp by a certain amount when the veterancy levels are hit?


Dude. Dude. Do you get how crazy you are? You want ONE unit, one SINGLE unit to not get buffs, and you on asking for the ENTIRE CONCEPT OF VETERANCY to die. Talk about using a nuke to kill a fly.

All you have to do is put this code in the script that spawns your special super unit:

local SuperUnit = [the code that spawns your super unit]
SuperUnit.AddKills = function(self, numKills)
return
end

That will make it so your super unit cannot acquire kills and cannot get veterancy.
FunkOff
Supreme Commander
 
Posts: 1863
Joined: 26 Aug 2011, 17:27
Has liked: 14 times
Been liked: 43 times
FAF User Name: FakeOff

Re: Updating Unit Blueprints during a game

Postby Mr-Smith » 23 May 2013, 22:26

nukes are very efficient for killing flys

:)
If you can't beat us...
...join us.
Doge This, hover ACU: https://youtu.be/a67tvWmu31Y?list=LLW-T ... O4fQ&t=179
User avatar
Mr-Smith
Evaluator
 
Posts: 523
Joined: 27 Mar 2012, 19:15
Location: Austria
Has liked: 39 times
Been liked: 36 times
FAF User Name: Mr-Smith

Re: Updating Unit Blueprints during a game

Postby johnie102 » 24 May 2013, 12:44

FunkOff wrote:
johnie102 wrote:I have recently released an 8 player version of Zone Control and when you get a certain amount of kills hero units (experimentals) spawn. I would like to disable veterancy effects for them because I think it makes them slightly too powerfull.
Would it be possible to just check the amount of kills and simply hardcode to drop the hp by a certain amount when the veterancy levels are hit?


Dude. Dude. Do you get how crazy you are? You want ONE unit, one SINGLE unit to not get buffs, and you on asking for the ENTIRE CONCEPT OF VETERANCY to die. Talk about using a nuke to kill a fly.

All you have to do is put this code in the script that spawns your special super unit:

local SuperUnit = [the code that spawns your super unit]
SuperUnit.AddKills = function(self, numKills)
return
end

That will make it so your super unit cannot acquire kills and cannot get veterancy.


Ok, that was what I needed then ;) Thanks.
Btw, while being slightly on this topic: Is it possible to edit where buildings are buildable in a map script? So that I can make buildings buildable underwater without using a mod.
johnie102
Avatar-of-War
 
Posts: 128
Joined: 27 Dec 2012, 22:26
Has liked: 0 time
Been liked: 2 times
FAF User Name: johnie102

Next

Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest