Login

russian armor

How to: Set buildings on fire

5 Feb 2014, 22:14 PM
#1
avatar of Sarantini
Honorary Member Badge
Donator 22

Posts: 2181

Are you creating a destroyed city but want other effects than markers and craters? This guide will help you with setting a building on fire at the start of the game.

Select the building you want to set on fire. You can add some destruction in it but the less hp the faster it will be completely burned down. Smaller buildings will also burn down faster than big buildings.

Press CTRL-G and add a name. I'm following Relics name system by naming it eg_xx because it is an entity group

Save your map but don't export it yet. Go to the folder of your map and open "<yourmap>_id.scar"
Add this under the entity groups:
Code
eg_burninghouse1 = EGroup_CreateIfNotFound("eg_burninghouse1")
Entity_SetOnFire(EGroup_GetSpawnedEntityAt(eg_burninghouse1, 1))

You will have to do this every time between saving your map and exporting since world builder overwrites this every time you save.

Export your map and start the game!
End result:



EDIT:
I forgot to add you can also make the buildings invulernable so they will always keep burning at 100% hp.
6 Feb 2014, 13:23 PM
#2
4 Mar 2014, 18:46 PM
#3
avatar of CookiezNcreem
Senior Strategist Badge
Donator 11

Posts: 3052 | Subs: 15

interesting,how would you do this for multiple buildings
4 Mar 2014, 18:48 PM
#4
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

Code

eg_burninghouses = EGroup_CreateIfNotFound("eg_burninghouses")
EGroup_ForEach(eg_burninghouses,
function(egid, idx, entity)
Entity_SetOnFire(entity)
end)
4 Mar 2014, 18:57 PM
#5
avatar of CookiezNcreem
Senior Strategist Badge
Donator 11

Posts: 3052 | Subs: 15

wow that was quick. lol. would you by any chance know how to make planes fly and perform certain orders using this same method(SCAR) or no?
4 Mar 2014, 19:06 PM
#6
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

I would do that by spawning a commander ability to the map.
For example ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON
6 Mar 2014, 01:03 AM
#7
avatar of CookiezNcreem
Senior Strategist Badge
Donator 11

Posts: 3052 | Subs: 15

I would do that by spawning a commander ability to the map.
For example ABILITY.GERMAN.STUKA_AERIAL_SUPERIORITY_RECON



Do you have a list of these commands somewhere?(including the Invulernability command?)


6 Mar 2014, 07:07 AM
#8
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11

For functions please see this: http://www.europeinruins.com/ScarDoc/ (for example EGroup_SetInvulernable)

And for extracting COH2 Archives for taking a look at existing files:
http://www.coh2.org/topic/14845/world-builder--only-infantry-scripting/post/129053

I think the most important file is luaconstauto.scar in AttribArchive/scar. It contains a list of all available squads, entities, abilities, and more listed.
6 Mar 2014, 19:41 PM
#9
avatar of CookiezNcreem
Senior Strategist Badge
Donator 11

Posts: 3052 | Subs: 15

So i could for example spawn an IL2 or stuka on the map,follow similar steps to setting a building on fire except use the Cmd_Attack or the EGroup_SetAutoTargetting command to make the plane loiter and attack things?
19 Nov 2019, 08:49 AM
#10
avatar of Von_Smedman

Posts: 108

Code

eg_burninghouses = EGroup_CreateIfNotFound("eg_burninghouses")
EGroup_ForEach(eg_burninghouses,
function(egid, idx, entity)
Entity_SetOnFire(entity)
end)


Thanks Jane, I have tryed this, but no luck, what am I missing in this script?

I have 18 houses that I what to set on fire from the beginning of the game.....in order to create a atmosphere of a beach landing in Dieppe.

At player 1-2-3`s starting position where the 18 burning building are located.

The map is this

Port of Dieppe

The scrip is this: - I know that in coding just a comma missing will have a influent on if the script will work or not.
---------------------------------------------------------------------------------------------------
function OnInitID()

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]
eg_burninghouse1 = EGroup_CreateIfNotFound("eg_burninghouse1")
eg_burninghouse10 = EGroup_CreateIfNotFound("eg_burninghouse10")
eg_burninghouse11 = EGroup_CreateIfNotFound("eg_burninghouse11")
eg_burninghouse12 = EGroup_CreateIfNotFound("eg_burninghouse12")
eg_burninghouse13 = EGroup_CreateIfNotFound("eg_burninghouse13")
eg_burninghouse14 = EGroup_CreateIfNotFound("eg_burninghouse14")
eg_burninghouse15 = EGroup_CreateIfNotFound("eg_burninghouse15")
eg_burninghouse16 = EGroup_CreateIfNotFound("eg_burninghouse16")
eg_burninghouse17 = EGroup_CreateIfNotFound("eg_burninghouse17")
eg_burninghouse18 = EGroup_CreateIfNotFound("eg_burninghouse18")
eg_burninghouse19 = EGroup_CreateIfNotFound("eg_burninghouse19")
eg_burninghouse2 = EGroup_CreateIfNotFound("eg_burninghouse2")
eg_burninghouse3 = EGroup_CreateIfNotFound("eg_burninghouse3")
eg_burninghouse4 = EGroup_CreateIfNotFound("eg_burninghouse4")
eg_burninghouse5 = EGroup_CreateIfNotFound("eg_burninghouse5")
eg_burninghouse6 = EGroup_CreateIfNotFound("eg_burninghouse6")
eg_burninghouse7 = EGroup_CreateIfNotFound("eg_burninghouse7")
eg_burninghouse8 = EGroup_CreateIfNotFound("eg_burninghouse8")
eg_burninghouse9 = EGroup_CreateIfNotFound("eg_burninghouse9")
German_truck_with_full_load_of_bombs = EGroup_CreateIfNotFound("German_truck_with_full_load_of_bombs")
German_truck_with_metal_barrels = EGroup_CreateIfNotFound("German_truck_with_metal_barrels")
German_truck_with_some_bombs = EGroup_CreateIfNotFound("German_truck_with_some_bombs")
German_truck_with_wood_barrels = EGroup_CreateIfNotFound("German_truck_with_wood_barrels")
Train_cargo_car_with_full_load_of_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_full_load_of_bombs")
Train_cargo_car_with_half_full_load_of_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_half_full_load_of_bombs")
Train_cargo_car_with_some_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_some_bombs")

eg_burninghouses = EGroup_CreateIfNotFound("eg_burninghouses")
EGroup_ForEach(eg_burninghouses,
function(egid, idx, entity)
Entity_SetOnFire(entity)
end)

end
19 Nov 2019, 10:25 AM
#11
avatar of Janne252
Admin Black Badge
Patrion 15

Posts: 3421 | Subs: 11



Thanks Jane, I have tryed this, but no luck, what am I missing in this script?

I have 18 houses that I what to set on fire from the beginning of the game.....in order to create a atmosphere of a beach landing in Dieppe.

At player 1-2-3`s starting position where the 18 burning building are located.

The map is this

Port of Dieppe

The scrip is this: - I know that in coding just a comma missing will have a influent on if the script will work or not.
---------------------------------------------------------------------------------------------------
function OnInitID()

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]
eg_burninghouse1 = EGroup_CreateIfNotFound("eg_burninghouse1")
eg_burninghouse10 = EGroup_CreateIfNotFound("eg_burninghouse10")
eg_burninghouse11 = EGroup_CreateIfNotFound("eg_burninghouse11")
eg_burninghouse12 = EGroup_CreateIfNotFound("eg_burninghouse12")
eg_burninghouse13 = EGroup_CreateIfNotFound("eg_burninghouse13")
eg_burninghouse14 = EGroup_CreateIfNotFound("eg_burninghouse14")
eg_burninghouse15 = EGroup_CreateIfNotFound("eg_burninghouse15")
eg_burninghouse16 = EGroup_CreateIfNotFound("eg_burninghouse16")
eg_burninghouse17 = EGroup_CreateIfNotFound("eg_burninghouse17")
eg_burninghouse18 = EGroup_CreateIfNotFound("eg_burninghouse18")
eg_burninghouse19 = EGroup_CreateIfNotFound("eg_burninghouse19")
eg_burninghouse2 = EGroup_CreateIfNotFound("eg_burninghouse2")
eg_burninghouse3 = EGroup_CreateIfNotFound("eg_burninghouse3")
eg_burninghouse4 = EGroup_CreateIfNotFound("eg_burninghouse4")
eg_burninghouse5 = EGroup_CreateIfNotFound("eg_burninghouse5")
eg_burninghouse6 = EGroup_CreateIfNotFound("eg_burninghouse6")
eg_burninghouse7 = EGroup_CreateIfNotFound("eg_burninghouse7")
eg_burninghouse8 = EGroup_CreateIfNotFound("eg_burninghouse8")
eg_burninghouse9 = EGroup_CreateIfNotFound("eg_burninghouse9")
German_truck_with_full_load_of_bombs = EGroup_CreateIfNotFound("German_truck_with_full_load_of_bombs")
German_truck_with_metal_barrels = EGroup_CreateIfNotFound("German_truck_with_metal_barrels")
German_truck_with_some_bombs = EGroup_CreateIfNotFound("German_truck_with_some_bombs")
German_truck_with_wood_barrels = EGroup_CreateIfNotFound("German_truck_with_wood_barrels")
Train_cargo_car_with_full_load_of_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_full_load_of_bombs")
Train_cargo_car_with_half_full_load_of_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_half_full_load_of_bombs")
Train_cargo_car_with_some_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_some_bombs")

eg_burninghouses = EGroup_CreateIfNotFound("eg_burninghouses")
EGroup_ForEach(eg_burninghouses,
function(egid, idx, entity)
Entity_SetOnFire(entity)
end)

end


You've added the buildings to individual egroups. Instead add ALL the buildings you want to set on fire to a single egroup: eg_burninghouses (as referenced in the code snippet).
19 Nov 2019, 13:59 PM
#12
avatar of Von_Smedman

Posts: 108

Thank you!

It worked.

I selected all the building in question and the hit ctrl+g and gave them, the name eg_burninghouses.

Cheers.

p.s the code.

function OnInitID()

-- [[ Markers ]]

-- [[ Squad Groups ]]

-- [[ Entity Groups ]]
eg_burninghouses = EGroup_CreateIfNotFound("eg_burninghouses")
German_truck_with_full_load_of_bombs = EGroup_CreateIfNotFound("German_truck_with_full_load_of_bombs")
German_truck_with_metal_barrels = EGroup_CreateIfNotFound("German_truck_with_metal_barrels")
German_truck_with_some_bombs = EGroup_CreateIfNotFound("German_truck_with_some_bombs")
German_truck_with_wood_barrels = EGroup_CreateIfNotFound("German_truck_with_wood_barrels")
Train_cargo_car_with_full_load_of_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_full_load_of_bombs")
Train_cargo_car_with_half_full_load_of_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_half_full_load_of_bombs")
Train_cargo_car_with_some_bombs = EGroup_CreateIfNotFound("Train_cargo_car_with_some_bombs")

eg_burninghouses = EGroup_CreateIfNotFound("eg_burninghouses")
EGroup_ForEach(eg_burninghouses,
function(egid, idx, entity)
Entity_SetOnFire(entity)
end)

end
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

1061 users are online: 1061 guests
0 post in the last 24h
12 posts in the last week
26 posts in the last month
Registered members: 49989
Welcome our newest member, LegalMetrologyConsul
Most online: 2043 users on 29 Oct 2023, 01:04 AM