Login

russian armor

How-to: Blizzard in Custom maps

18 Nov 2013, 17:22 PM
#1
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Highlight:


How-To: Blizzard in Custom maps



Basics



You will need a basic text editor for this. Microsoft Notepad is great for this. Even better would be notepad++, which you can download from notepad-plus-plus.org

Lets get into adding the Blizzard to your custom map:
Goto your map folder, e.g.
Code

C:\Program Files (x86)\Steam\SteamApps\common\Company of Heroes 2\CoH2\Data\scenarios\mp\YourMapName


Save the following code as <YourMapName>.scar with notepad++/notepad:
Code

-------------------------------------------------------------------------
-------------------------------------------------------------------------

import("ScarUtil.scar")
import("Systems/BlizzardMulitplayer.scar")

-------------------------------------------------------------------------
-- [[ ONINIT ]]
-------------------------------------------------------------------------

function OnInit()


MP_BlizzardInit("data:art/scenarios/presets/atmosphere/DLC/mp_don_river_01_blizzard.aps" ,"data:art/scenarios/presets/atmosphere/DLC/mp_don_river_01.aps", nil, nil, true, nil)

end



More atmosphere presets



You can look for more atmospheres by extracting Data.sga (located in CoH2 installation folder\CoH2\Archives).

Save following content as Extract_Data.bat with notepad to your Company of Heroes 2 installation folder:
Code

archive.exe -a CoH2\Archives\Data.sga -e CoH2\Data


and run it. Once prompt closes extraction process is complete and you can continue with this tutorial.

After the extraction process is complete, navigate to this folder:
Code

C:\Program Files (x86)\Steam\SteamApps\common\Company of Heroes 2\CoH2\Data\art\scenarios\presets\atmosphere


This folder contains all atmosphere presets. To use them in the <YourMapname>.scar, make sure the path is correct, e.g.
Code
"ata:art/scenarios/presets/atmosphere/DLC/mp_don_river_01_blizzard.aps


Conclusions


Adding blizzard via YourMapName_ID.scar is kinda hacky but currently the only way achieve this. Currently you can't use your own custom atmosphere presets but hopefully this will be available in the future.
19 Nov 2013, 05:41 AM
#2
avatar of Ryan

Posts: 32

I've been searching and searching for this since world builder was released, and found absolutely nothing - nary a mention of the topic. Thank you for explaining it, and for making it so easy - it worked on the first try!
Hux
2 Dec 2013, 15:02 PM
#3
avatar of Hux
Patrion 14

Posts: 505

Props, Janne. helped me out a lot. thank you!
2 Dec 2013, 16:48 PM
#4
avatar of Qvazar

Posts: 881

In the "Atmosphere Properties", you can add multiple atmosphere presets in the "Transitions" panel, ie. _mp_2p_Kholodnaya_Ferma.aps and _mp_2p_kholodnaya_ferma_blizzard.aps and specify how many seconds the transitions should take and how long each atmosphere should live.

With the "Load" and "Save" buttons at the top, you can even load the standard presets and edit them.

Is that not the same thing? :)

Edit: Ah, no it's not the same thing. But with this you can make your map start out at night and transition to daytime.
2 Dec 2013, 18:27 PM
#5
avatar of Srinidhalaya

Posts: 357

jump backJump back to quoted post2 Dec 2013, 16:48 PMQvazar
In the "Atmosphere Properties", you can add multiple atmosphere presets in the "Transitions" panel, ie. _mp_2p_Kholodnaya_Ferma.aps and _mp_2p_kholodnaya_ferma_blizzard.aps and specify how many seconds the transitions should take and how long each atmosphere should live.

With the "Load" and "Save" buttons at the top, you can even load the standard presets and edit them.

Is that not the same thing? :)

Edit: Ah, no it's not the same thing. But with this you can make your map start out at night and transition to daytime.


Yes, but I believe IF you enable the blizzard script through the SCAR file, it over-rides the atmosphere settings. But if you wanted the look of the blizzard, without the gameplay affects, then transitions is what you would use, but keep in mind, I don't think it repeats, so whatever sequence you set up, the last preset will be the final settings used once the timers get to it.

I actually wanted to customize the blizzard sequence, starting in fair weather, and half way switching to a blizzard for the remaineder of the map, but I don't think its possible.
9 Dec 2013, 21:46 PM
#6
avatar of ofield

Posts: 420

....

Oh okay, found the problem...
9 Dec 2013, 21:58 PM
#7
avatar of IronMedic

Posts: 318

jump backJump back to quoted post9 Dec 2013, 21:46 PMofield
....

Oh okay, found the problem...

was the line " true, -- Start in Blizzard" was a hint? :D
9 Dec 2013, 22:12 PM
#8
avatar of ofield

Posts: 420


was the line " true, -- Start in Blizzard" was a hint? :D


Yea it was one of those "to stupid to read the comments in the code"-problems xD
24 Dec 2013, 21:30 PM
#9
avatar of apofisz22

Posts: 35

What does that have to do exactly?
Can not you do a video tutorial? D
Please help

The same way and did nothing
4 Jan 2014, 23:24 PM
#10
avatar of Leodot

Posts: 254

6 Jan 2014, 13:15 PM
#11
avatar of Srinidhalaya

Posts: 357

I think I have almost figured out how to change the intervals and time of the blizzards, using coding from the MP_Blizzard scar file. So far, I was able to get it to successfully use my times, but after 1 cycle of blizzards it crashed the map to desktop. I'll post some coding after work.

EDIT: After a few tries, I was unsuccessful at getting it to work. The coding I was trying was doubling the blizzard rotation, in effect having two simultaneous blizzards, one at the times I set, and one at the default times.


I haven't been able to define these variables in the scar file. These were pulled from blizzardmultiplayer.scar
Code
-- timing variables
blizzard_interval_min = t_blizzardData.blizzard_interval_min or 400 -- min seconds between blizzards
blizzard_interval_max = t_blizzardData.blizzard_interval_max or 800 -- max seconds between blizzards
blizzard_exit_min = t_blizzardData.blizzard_exit_min or 160 -- min duration of a blizzard
blizzard_exit_max = t_blizzardData.blizzard_exit_max or 240 -- max duration of a blizzard
blizzard_transition_time = t_blizzardData.blizzard_transition_time or 60 -- how long it takes to transition in or out of a blizzard
blizzard_transition_time_out = t_blizzardData.blizzard_transition_time_out or 30 -- how long it takes to transition out of a blizzard
blizzard_transition_ticks_per_second = t_blizzardData.blizzard_transition_ticks_per_second or 2 -- defines how smooth the gameplay transitions are
20 Mar 2014, 19:38 PM
#12
avatar of IronMedic

Posts: 318

This is some what related to this.
Turns out MP_BlizzardInit() enables you to build camp-fires, but lets say you want to be able to build camp-fires but don't want a blizzard.
The answer is a "Blizzard-less Blizzard" ^^
Code
import("ScarUtil.scar")
import("Systems/BlizzardMulitplayer.scar")
function OnInit()
MP_BlizzardInit(
nil, -- Blizzard atmosphere
nil, --Default atmosphere
nil, -- Start in Blizzard
nil, -- Blizzard Data
nil, -- Use Speech
nil --Blizzard out transition atmosphere
)
end
Scar_AddInit(OnInit)
20 Mar 2014, 19:40 PM
#13
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Code

for i=1,World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_CompleteUpgrade(player, BP_GetUpgradeBlueprint("allow_building_campfires")) end
20 Mar 2014, 19:44 PM
#14
avatar of IronMedic

Posts: 318

Code

for i=1,World_GetPlayerCount() do
local player = World_GetPlayerAt(i)
Player_CompleteUpgrade(player, BP_GetUpgradeBlueprint("allow_building_campfires")) end

Guess that works to =P
15 Jul 2015, 06:04 AM
#15
avatar of Tyknapp

Posts: 16

Hello, I am trying to make a snow map for the very first time. Though, I cannot seem to get the blizzard to work. I have everything else set up correctly (abandoned vehicles, custom pop cap, winter skins), but how to I correctly set up blizzards? I basically copied the blizzard file provided by you (after making the "yourmapname.scar" file in note pad. Did I miss something?

*Edit
Never mind, I found what I was suppose to do. Thanks for tutorial!
1 Mar 2016, 03:18 AM
#16
avatar of optical21

Posts: 95

What was the problem? cause i can't get it to work for myself, how did you solve it?
8 Mar 2016, 09:04 AM
#17
avatar of Mocco

Posts: 18

SAME HERE!!! WHAT did you do to solve the PROBLEM?!
8 Mar 2016, 10:08 AM
#18
avatar of Mocco

Posts: 18

Ok, I got the Blizzard to work as well. So here is what I did.

I opened the rostov scarfile and compared it to jannes code. The only difference was that there are some more settings in there that specified the blizzard. Starting time, duration finishing time and so on. So it dawned to me that the blizzard wont come if it doesn't know when and for how long. So I just coppied the settings and played a little around with them. This is my scarcode of my <yourmapname.scar>.

-------------------------------------------------------------------------
-------------------------------------------------------------------------

import("ScarUtil.scar")
import("Systems/BlizzardMulitplayer.scar")

-------------------------------------------------------------------------
-- [[ ONINIT ]]
-------------------------------------------------------------------------

function OnInit()

local blizzarddata =
{
blizzard_interval_first = 900,
blizzard_interval_min = 900,
blizzard_interval_max = 1000,
blizzard_exit_min = 120,
blizzard_exit_max = 200,
}

MP_BlizzardInit("data:art/scenarios/presets/atmosphere/DLC/mp_rostov_blizzard.aps" ,"data:art/scenarios/presets/atmosphere/DLC/mp_rostov.aps", nil, blizzarddata, true)

end


Scar_AddInit(OnInit)
19 Mar 2016, 18:54 PM
#19
avatar of optical21

Posts: 95

jump backJump back to quoted post8 Mar 2016, 10:08 AMMocco
Ok, I got the Blizzard to work as well. So here is what I did.

I opened the rostov scarfile and compared it to jannes code. The only difference was that there are some more settings in there that specified the blizzard. Starting time, duration finishing time and so on. So it dawned to me that the blizzard wont come if it doesn't know when and for how long. So I just coppied the settings and played a little around with them. This is my scarcode of my <yourmapname.scar>.

-------------------------------------------------------------------------
-------------------------------------------------------------------------

import("ScarUtil.scar")
import("Systems/BlizzardMulitplayer.scar")

-------------------------------------------------------------------------
-- [[ ONINIT ]]
-------------------------------------------------------------------------

function OnInit()

local blizzarddata =
{
blizzard_interval_first = 900,
blizzard_interval_min = 900,
blizzard_interval_max = 1000,
blizzard_exit_min = 120,
blizzard_exit_max = 200,
}

MP_BlizzardInit("data:art/scenarios/presets/atmosphere/DLC/mp_rostov_blizzard.aps" ,"data:art/scenarios/presets/atmosphere/DLC/mp_rostov.aps", nil, blizzarddata, true)

end


Scar_AddInit(OnInit)


Thank you very much for this, if only the main post from the start would have had this in the post it would probably help people more, now i finally have blizzards on my map, so again, thank you!!! :)
20 Mar 2016, 12:03 PM
#20
avatar of optical21

Posts: 95

Thanks again Mocco!!!!

EDIT: I solved my problem again thanks to Mocco, hence the edit
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

780 users are online: 780 guests
0 post in the last 24h
8 posts in the last week
38 posts in the last month
Registered members: 49083
Welcome our newest member, debethiphop
Most online: 2043 users on 29 Oct 2023, 01:04 AM