GiveStorage Function

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

GiveStorage Function

Postby Duck_42 » 19 Jul 2012, 04:00

Is there any way to get BOTH energy and mass storage boosts out of this function, or do I have to come up with a ridiculous workaround because some programmer at GPG was half asleep the day he wrote it? :evil:
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42

Re: GiveStorage Function

Postby FunkOff » 19 Jul 2012, 16:55

What do you mean, ridiculous workaround? Just put the command in twice. Specify mass in one and energy in the other.
FunkOff
Supreme Commander
 
Posts: 1863
Joined: 26 Aug 2011, 17:27
Has liked: 14 times
Been liked: 43 times
FAF User Name: FakeOff

Re: GiveStorage Function

Postby Duck_42 » 20 Jul 2012, 00:16

Yeah...that's what I thought too. Individually, both calls work. ArmyBrain:GiveStorage('MASS', 10000) will correctly augment mass storage by 10000 and ArmyBrain:GiveStorage('ENERGY', 10000) will correctly augment energy storage by 10000.

Try them both together though

ArmyBrain:GiveStorage('ENERGY', 10000)
ArmyBrain:GiveStorage('MASS', 10000)

and only the second function call will remain in effect. Throw in a WaitSeconds(5) in between the calls and you'll see that the second call replaces the first. I get a +10000 energy storage boost, but as soon as the second call is made, I lose the energy storage boost and I get a +10000 mass storage boost instead.

So as best I can tell, I can have a mass storage boost or an energy storage boost but not both. :(

By the way, I already came up with my workaround. I created a custom unit with the mass and energy storage values that I needed and spawned it off the map where, hopefully, it will not be seen or disturbed.
User avatar
Duck_42
Avatar-of-War
 
Posts: 237
Joined: 29 May 2012, 03:16
Has liked: 5 times
Been liked: 18 times
FAF User Name: Duck_42


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest