Login

russian armor

Clone all attributes at once?

28 Feb 2018, 15:59 PM
#1
avatar of EagleOne

Posts: 12

Hi there COH2 Modding Community,

I've just recently gotten into COH2 after playing the first COH about a year ago. I've been loving it so far, and very much enjoy playing around with the modding tools. I've already successfully created some tuning packs that my friends and I are enjoying.

However there is one thing that bothers me...

Is there a hotkey or macro that will allow me to clone an entire category of blueprints? If I want to make sweeping changes to every entity blueprint (say cost/build time) I have to right click and clone every single one. I've been trying to come up with something to speed up this process, but if there is already a solution I'm unaware of I'd like to not waste my time. The only "shortcut" I can think of right now is to manually clone every single blueprint and save the attribute.xml and instances as a template and use it for every other mod going forward. This still involves having to clone them all manually one by one which is... time consuming.

Am I just missing something? Or is this really the only way about doing it? Or would I be better off creating a Win Condition pack and making my changes using LUA/Scar?

28 Feb 2018, 18:43 PM
#2
avatar of RagnarTheGamer
Master Modmaker Badge

Posts: 317

Hello EagleOne,
I don't think there is a function to copy all files. I did copy thinks as I modded them.

Making Win Condition pack is also a good thing to do if you know SCAR and you know what you want from it. Also combining Win Condition pack with Tunning pack isn't a bad thing to do because you can achieve more like that in my opinion. You could look at Wikinger: Europen Theater of War mod that is using WCP and Tunning together.

Regards,
RagnarTheGamer
1 Mar 2018, 15:00 PM
#3
avatar of EagleOne

Posts: 12

Ah, thanks for the clarity.

I've gone ahead and just started making my global changes using a SCAR win condition which has cut down the amount of work significantly. It also allows me to make different flavors using the win condition options without creating entire new mods.

I do have a few questions if you can answer them:

  • There is however one thing I have yet to be able to find out how to do, and that is just issue simple print() statements to the development console. Using lua's print(string) doesn't throw an error, but it doesn't get sent to the console. Is there a SCAR built in version for issuing prints to the console? The only ScarDoc reference I can find relating to the console is "Scar_DebugConsoleExecute( String command )" which to my understanding just sends a string command to the console. Seems redundant to have to do: Scar_DebugConsoleExecute( "print('My debug message')" ), but if that is the only way then so be it.

  • Is there a way to import your own SCAR scripts that don't originate in the data archive sga into a win condition? My codebase is growing rapidly and having to keep it in one large file is becoming unwieldy. For example I have one file that just contains a global table of all of the unit blueprints, their shortnames, some flags like "is_vehicle" etc, and it's rather large. I've tried using import statements, but relative paths didn't seem to work, nor did replicating the file location string found in the win condition.

  • Can my win condition scar scripts reference blueprints that are added inside a tuning pack? For example, if I use a steam workshop mod that adds new units to the game with their own blueprints, will I be able to set their availability using Player_SetSquadProductionAvailability()?


For reference, I'm building an infantry only mod where a player's units receive less suppression the closer you are to your population cap, "strength in numbers." I'm trying to fire a debug statement with each new suppression value calculation to make sure it is working as intended.

I'm sorry to pester you with the questions. I would download your mod and take a look at the source code, but I can't access steam most of the day being at work and have limited time at night when I get home. I can't seem to find the mod tools online besides through steam either, which is probably a good thing or I would be fooling around all day with mods instead of developing stuff for my actual job :)

Much appreciated if you can enlighten me.
1 Mar 2018, 22:50 PM
#4
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

1. For whatever reason, they decided not to have SCAR logging in CoH2, which makes debugging tedious. For Fortress Europe we came up with this solution:


logs = ''
function log(l)
logs = logs..tostring(l)..'\n'

PersistentMode_SerializeResults('userdata:logs/scarlog.'..modId..'.txt', logs)
end


It's not the same as print, but it does the job. It saves a .txt file in Documents/My Games/Company of Heroes 2/logs. See #3 for info about the mod Id.

And yes, this can be used to save .lua files and such as well. :)

2. Your Win Condition Pack should have a data/scar folder. The import function works for files from either data.sga or your own data/scar folder, so just organize files however you'd like and import them where you need them.

3. Yes, just prepend your mod Id and a semi-colon before the blueprint name. For example:


BP_GetSquadBlueprint(modId..':custom_grenadier_squad')


You can get this Id from Mod Builder by right-clicking at the bottom right and hitting copy.

If you have more SCAR questions, I would advise posting them in a different topic since this one is about cloning attributes. Otherwise, some people might gloss over it or miss it in searches.
2 Mar 2018, 02:07 AM
#5
avatar of EagleOne

Posts: 12

Thanks a bunch, plus your YouTube tutorials are a great starter so thanks for those too!
2 Mar 2018, 06:03 AM
#6
avatar of eliw00d
Honorary Member Badge

Posts: 756 | Subs: 8

1 user is browsing this thread: 1 guest

Ladders Top 10

  • #
    Steam Alias
    W
    L
    %
    Streak
Data provided by Relic Relic Entertainment

Replay highlight

VS
  • U.S. Forces flag cblanco ★
  • The British Forces flag 보드카 중대
  • Oberkommando West flag VonManteuffel
  • Ostheer flag Heartless Jäger
uploaded by XXxxHeartlessxxXX

Board Info

757 users are online: 2 members and 755 guests
kitsos, trigg
3 posts in the last 24h
39 posts in the last week
131 posts in the last month
Registered members: 45086
Welcome our newest member, buycashapppoint652
Most online: 2043 users on 29 Oct 2023, 01:04 AM