Forged Alliance Forever Forged Alliance Forever Forums 2018-03-11T20:00:39+02:00 /feed.php?f=53&t=15979 2018-03-11T20:00:39+02:00 2018-03-11T20:00:39+02:00 /viewtopic.php?t=15979&p=161688#p161688 <![CDATA[Re: How to modify unit blueprint stats with a map script]]>
i already tryed some programming on my own.
Sadly will will not get this to work.

The reason why it works on some values on not on others is how the game is using those blueprints.

On gamestart all blueprints are loaded and registered inside the c-engine.
If you now change some values inside the blueprint data, you only change it for the LUA side of the game.
All values that are stored inside the c-engine can't be changed.

LUA must have sim-state to change the blueprints.
And this is only possible while hooking the blueprint.lua and change blueprints BEFORE we register them inside the c-engine.

I am sorry, but this will never work :(

Statistics: Posted by Uveso — 11 Mar 2018, 20:00


]]>
2018-03-10T13:54:35+02:00 2018-03-10T13:54:35+02:00 /viewtopic.php?t=15979&p=161645#p161645 <![CDATA[Re: How to modify unit blueprint stats with a map script]]> But I can imagine someone being a douche and making tons of maps with the same name as existing ones, with units that boost his favorite faction, for example, then uploading to the Vault to act as standard maps, so I see your point. Ty for the answer.

The thing is, such code would have to start with "local xy = import xy, at the first few lines of the script, and that would be pretty easy to spot, and such a person to be banned. Not to mention the very blueprint file itself, inside the map folder :p

...if only people weren't douches, we'd have so many nice things :/

Statistics: Posted by DDDX — 10 Mar 2018, 13:54


]]>
2018-03-10T12:21:43+02:00 2018-03-10T12:21:43+02:00 /viewtopic.php?t=15979&p=161642#p161642 <![CDATA[Re: How to modify unit blueprint stats with a map script]]>
And that's why we won't make this possible.

You will need a sim mod to edit blueprints.

Statistics: Posted by speed2 — 10 Mar 2018, 12:21


]]>
2018-03-10T11:12:57+02:00 2018-03-10T11:12:57+02:00 /viewtopic.php?t=15979&p=161641#p161641 <![CDATA[Re: How to modify unit blueprint stats with a map script]]>
Code:
    function EditBlueprints(self)
        for UnitID, UnitBlueprint in __blueprints do
           if (UnitID == 'xsb2401') then -- Yolona Oss
                UnitBlueprint.Intel.VisionRadius = 5
                UnitBlueprint.Defense.Health = 22000
                UnitBlueprint.Defense.MaxHealth = 22000
            end
        end
    end


Code:
    __blueprints['xsb2401'].Defense.Health = 22000


does anyone here know how would one go about making the game use a custom made blueprints.lua that would come together with the map, which contained only a few units inside, those that would get edited? (ofc, cause the units.scd file is 1.04 GB large, too big for any map).

It would open up so many possibilities for map makers, being able to edit unit stats right from the blueprints.
Or has it been done already, in a certain map, that I can utilize?

Statistics: Posted by DDDX — 10 Mar 2018, 11:12


]]>
2018-03-09T21:37:02+02:00 2018-03-09T21:37:02+02:00 /viewtopic.php?t=15979&p=161626#p161626 <![CDATA[Re: How to modify unit blueprint stats with a map script]]> Wouldn't you know it, I got a follow-up question. Have put it in the linked topic, no sense having 2 essentially same ones.

Statistics: Posted by DDDX — 09 Mar 2018, 21:37


]]>
2018-03-08T04:10:19+02:00 2018-03-08T04:10:19+02:00 /viewtopic.php?t=15979&p=161570#p161570 <![CDATA[Re: How to modify unit blueprint stats with a map script]]>
take a look here:
viewtopic.php?f=53&t=15960&start=10

Statistics: Posted by Uveso — 08 Mar 2018, 04:10


]]>
2018-03-08T00:49:56+02:00 2018-03-08T00:49:56+02:00 /viewtopic.php?t=15979&p=161566#p161566 <![CDATA[How to modify unit blueprint stats with a map script]]>
Is it possible to make a map where a unit/building has different stats, for example less HP or different cost?
Not the ones the map script spawns, but the regular ones, built by the player after the game has started.

If yes - how would one go about doing it?
It would require the customized unit BP inside the map folder,but how do I direct the game to look it up and use it and overwrite the game's native data of that unit in the UNITS.SCD?
Is this even possible, without using a mod that edits the unit?

Much obliged,
DDDX

Statistics: Posted by DDDX — 08 Mar 2018, 00:49


]]>