Some Basic Mod questions

Talk about general things concerning Forged Alliance Forever.

Moderators: FtXCommando, Ze Dogfather

Some Basic Mod questions

Postby Crazy Cossack » 07 Jun 2014, 06:46

First some basic background about my modding. I only have very basic modding knowledge. All I can do so far is modify unit blueprints and implement them. So, for example I can change the speed or build range of an ACU or I can change the Mass and Energy cost of a unit. Anything else in the unit.bp file that I understand I can also change, obviously.

However, if I want to make slightly more complicated changes I cannot do them yet. For example, I want to give the ACU a speed of 0 at start of game (can't move) and I think I can do that in the unit.bp by setting speed to 0. However, then I want to tie the (re-)gaining of the ability to walk to certain upgrades. For example, I would want the gun upgrade or the T2 upgrade of the ACU to give back to the ACU the ability to walk at standard speed. How and where would I add the conditional statement that "if T2 upgrade or Gun upgrade is done then set ACU walk speed to speed x "? Actually, I would go further than that and any ACU upgrade except the super cheap one like UEF drone would give the ACU back his normal walking speed.

My learning style is that I learn by example. If people can give me an example of how to implement the above then I will make a big leap in my understanding of modding, thanks.

Note: You might question the wisdom of the change to ACU walking ability. I have a vision of a less tactical and more strategic mod. It would be very different from standard FAF Sup Com. Standard FAF is perfect for what it is. I figure on a very different mod that is almost like a new game in gameplay style and economy but still uses all the familiar units and weapons. Stopping early ACU charges or rushes is consistent with this concept. Early expansion will have to occur more by engies and T1 units without ACU assistance or interference. Of course, there are senses in which this will make the game more strategic and also senses in which T1 tactics could be intensified without other changes.

There are various other changes I would make but I don't want to bore people with too long a screed here. Suffice it to say that I want LABs to take a more classic infantry role. LABs would continue to be useful for much of T1 land phase. LABs and tanks would interact more like classic infantry and tanks. How I would achieve that is an open question. The LABs' standard weapon would be less effective on tanks and structures. A new more expensive T1 LAB type would probably be necessary to mix with standar LABs; one with a anti-tank rocket. I might also implement T1 crawling anti-tank mines which when placed still are invisible to tanks but LABs can spot them and shoot them. Thus advancing tanks would need LAB screening troops to spot and kill immobile crawling mines. This is just one example of the concepts I have in mind.

I would try to more consistently theme bots, wheeled/tracked vehicles and hovers. Hovers will be light and fast in a straight line, have little armour but be hard to turn. Bots would be fast and manouverable and have medium armour. Tracked vehicles would have the heaviest armour and be slower but still manouvreable and provide heaviest hitting power. T1 hovers will probably not exist for any faction or else will exist for all factions. Engies will still be amphibious. T3 tracked tanks will become necessary for all factions and will hit heavier even than T3 Bricks, Percies etc but not have Bricks and Percies "walk under water" ability.

I will move the economy from a high exponential growth model to a more linear growth model. There are ways to do that which I won't go into here. The reason for doing it is that high exponential growth exaggerates the outcomes of early tactical victories which cause huge subsequent differences to the eco growth path. A linear growth path means it is more possible to recover from small early tactical setbacks and still play a strategic game. Large early tactical setbacks will still result in a lost game though. I would reduce the reclaim gain from wrecks to a lower percentage. Sorry, I rambled on more than I promised. But that should give some idea of what I envisage.
Crazy Cossack
Avatar-of-War
 
Posts: 53
Joined: 13 Mar 2013, 12:44
Has liked: 0 time
Been liked: 9 times
FAF User Name: Crazy_Cossack

Re: Some Basic Mod questions

Postby Myxir » 07 Jun 2014, 09:23

Unhappy with balance http://i.imgur.com/q5G2BlM.png
User avatar
Myxir
Evaluator
 
Posts: 791
Joined: 09 Apr 2012, 14:01
Has liked: 94 times
Been liked: 306 times
FAF User Name: Washy (irc)

Re: Some Basic Mod questions

Postby Sheeo » 07 Jun 2014, 10:34

Crazy Cossack wrote:However, if I want to make slightly more complicated changes I cannot do them yet. For example, I want to give the ACU a speed of 0 at start of game (can't move) and I think I can do that in the unit.bp by setting speed to 0. However, then I want to tie the (re-)gaining of the ability to walk to certain upgrades. For example, I would want the gun upgrade or the T2 upgrade of the ACU to give back to the ACU the ability to walk at standard speed. How and where would I add the conditional statement that "if T2 upgrade or Gun upgrade is done then set ACU walk speed to speed x "? Actually, I would go further than that and any ACU upgrade except the super cheap one like UEF drone would give the ACU back his normal walking speed.


You'll need to hook into some methods in the unit class, besides setting the walk speed to 0 in the bp.

One way to do it would be to hook the OnWorkEnd function.

It looks like this:

Code: Select all
OnWorkEnd = function(self, work)
        --LOG('CreateEnhancement workEND:'..tostring(work))
        self:SetActiveConsumptionInactive()
        self:PlayUnitSound('EnhanceEnd')
        self:StopUnitAmbientSound('EnhanceLoop')
        self:CleanupEnhancementEffects()
end


You can check if your current unit is a commandunit like so:

Code: Select all
if EntityCategoryContains(categories.COMMAND, self) then
...
end


So you'd have something along the lines of

Code: Select all
OnWorkEnd = function(self, work)
   if EntityCategoryContains(categories.COMMAND, self) and tostring(work) == 'enhancement-you-want' then
     ... update whatever values for the unit
   end
end


I've omitted how to hook the function properly. See Myxirs post for that.

Someone who knows the intricasies of the engine may say that there is a better more moho-like way of doing this, but I haven't coded enough with it to know.

Hope this gets you started.

Perhaps this should be moved to a more appropriate forum.
Support FAF on patreon: https://www.patreon.com/faf?ty=h

Peek at our continued development on github: https://github.com/FAForever
Sheeo
Councillor - Administrative
 
Posts: 1038
Joined: 17 Dec 2013, 18:57
Has liked: 109 times
Been liked: 233 times
FAF User Name: Sheeo

Re: Some Basic Mod questions

Postby Crazy Cossack » 08 Jun 2014, 00:36

Thanks for replies but my knowledge is currently limited to unit blueprint files. I will explain what I have done and what I want to do next.

In the UEF ACU blueprint file, in "physics", I have set MaxSpeed = 0, . This works. The ACU cannot walk but still has all other functions and attributes.

Then in the enhancements section, T2 enhancement, I simply added in the extra command MaxSpeed = 1.7, to the other enhancements for T2 thinking, this might work. It did not work. Then I tried NewMaxSpeed = 1.7, as this is like the commands above like NewHealth = 3000, . Of course, I was hoping a function NewMaxSpeed already existed somewhere else in the game code but it must not exist because this did not work. However, it did not error either which was interesting.

So it seems to me I need to create a new function called NewMaxSpeed so I can call it. However where do I create it? If I could see an example of another like function, like NewHealth = 3000, and where it actually resides, then I could create a function NewMaxSpeed in the same way. Actually it now occurs to me I should have tried syntax NewSpeed but again that won't work if a NewSpeed is not already declared as a function somewhere. So my basic question is, how do I create a NewSpeed function (which when used would add the declared speed to the old speed)? And where do I place the new (presumably LUA) function?
Crazy Cossack
Avatar-of-War
 
Posts: 53
Joined: 13 Mar 2013, 12:44
Has liked: 0 time
Been liked: 9 times
FAF User Name: Crazy_Cossack

Re: Some Basic Mod questions

Postby nine2 » 08 Jun 2014, 05:18

nomads has acu speed upgrade
nine2
Councillor - Promotion
 
Posts: 2416
Joined: 16 Apr 2013, 10:10
Has liked: 285 times
Been liked: 515 times
FAF User Name: Anihilnine

Re: Some Basic Mod questions

Postby Crazy Cossack » 08 Jun 2014, 06:34

Yes, I have checked out the Nomads speed upgrade. I thought I understood it but when I tried to implement something like it, it just did not work.

IN blueprint file UEL0001 under physics I tried setting ACU speed = 1.7 then SpeedMulti to 0. This should have given ACU speed of 0. Then I set Speedmulti = 1 in a new line in the T2 upgrade enhancement section. None of this worked. Just would not work and I do not know why.

So then I tried a test of setting ACU speed = 1.7 in physics and Speedmulti = 2 in the T2 enhancment so that after T2 upgrade it should walk twice as fast. It did not. So it seems the command or function Speedmulti just does not work anywhere for me. Mind you I was testing not in FAF but in ver 1.6.6 started from my desktop FA icon.

Can anyone tell me why my above tests don't work? I can reset the ACU speed by itself. I can make the ACU have 0 speed or some other speed but I can find no way that the Speedmulti command has any effect on speed.

I am getting very frustrated. My modding knowledge is so basic it is almost non-existent. I only know how to play around in the blueprints files a bit. Is there a modder with the patience to help a dope like me learn from scratch? At least help with a few answers. I know it's a big ask.
Crazy Cossack
Avatar-of-War
 
Posts: 53
Joined: 13 Mar 2013, 12:44
Has liked: 0 time
Been liked: 9 times
FAF User Name: Crazy_Cossack


Return to General Discussions

Who is online

Users browsing this forum: No registered users and 1 guest