Joseph_Porta
Pukovnik
Half-Czech / Half-Norwegian
Posts: 398
|
Post by Joseph_Porta on Sept 28, 2009 11:03:01 GMT 1
Hi, I am working on a map which requires a destroyed bridge. As far as I know, you can only do this by saving the map as a .xml file and then change the health status of the bridge parts. However, when I open my map as a .xml file (with Bk-Tools: Object Tree), I can only change the terrain. When I make another map, I can change the status of the bridge. Is there some sort of lock on the map? If so, is there a way to open it? In case this is not possible, is there another way to change the bridge from undamaged to destroyed? In case there is no other way, I would be forced to ask somebody to make a destroyed bridge as an object (a la The Day After) - something I'd rather not do. Thanks in advance for your help! Kindest regards, Martin Haugland / Joseph_Porta
|
|
Ocelo
General
Map Artist/Eastern Front enthusiast
Posts: 1,400
|
Post by Ocelo on Sept 28, 2009 22:05:27 GMT 1
Hey, JP: Leon did this via scripting. See the mission found at the link for more details. rapidshare.com/files/286224674/Crossing.zip.htmlThere are similar thing in several of the maps in GPW, which include detonators (again, scripting). But the bridge itself doesn't make a sound when destroyed, so that should be OK.
|
|
Desert
Vojna Policija - Military Police
Posts: 1,230
|
Post by Desert on Sept 28, 2009 22:17:20 GMT 1
Leon wrote this on the BKHQ:
This one could be shared with the mapping section as it uses both.
One of the most common questions for new mappers/scripters is "How do I blow something up." Mostly it is a bridge.And normally it is only one bridge. But the theory is the same.
Create your map and place the bridge on the map.Note the name of the bridge. In my case I used "WoodenBig_Heavy_02) Save the map in .xml format. Exit the Map Editor Open the map you have just created with a XML editor (I use FOXE as it is free and easy to use).
Now search for "WoodenBig_heavy_02" My search revealed this (it is a 3span bridge I made):
Code: <Objects> <item Direction="0" Player="0" ScriptID="-1" HP="1" FrameIndex="1"> <Name>WoodenBig_Heavy_02</Name> <Position x="896" y="978" z="0"/> <Link LinkID="2" Intention="0" LinkWith="0"/> </item> <item Direction="0" Player="0" ScriptID="-1" HP="1" FrameIndex="2"> <Name>WoodenBig_Heavy_02</Name> <Position x="896" y="1074" z="0"/> <Link LinkID="3" Intention="0" LinkWith="0"/> </item> <item Direction="0" Player="0" ScriptID="-1" HP="1" FrameIndex="4"> <Name>WoodenBig_Heavy_02</Name> <Position x="896" y="1170.1" z="0"/> <Link LinkID="4" Intention="0" LinkWith="0"/> </item> </Objects>
Now we have to allocate scriptID's to each one we want destroyed.
I have edited to this:
Code: <Objects> <item Direction="0" Player="0" ScriptID="750" HP="1" FrameIndex="1"> <Name>WoodenBig_Heavy_02</Name> <Position x="896" y="978" z="0"/> <Link LinkID="2" Intention="0" LinkWith="0"/> </item> <item Direction="0" Player="0" ScriptID="750" HP="1" FrameIndex="2"> <Name>WoodenBig_Heavy_02</Name> <Position x="896" y="1074" z="0"/> <Link LinkID="3" Intention="0" LinkWith="0"/> </item> <item Direction="0" Player="0" ScriptID="750" HP="1" FrameIndex="4"> <Name>WoodenBig_Heavy_02</Name> <Position x="896" y="1170.1" z="0"/> <Link LinkID="4" Intention="0" LinkWith="0"/> </item> </Objects>
Now save the map in the XML editor.
Open the map editor and load in the xml version of th emap.
Continue mapping.
To have the bridge destroyed in the game you have to script the bridge to be destroyed. Normally an officer or a unit has to
enter a certain area. This area also needs to be defined in the map editor.
When scripting the destruction of the bridge the following portion in the script will accomplish this:
Code: function Bang() -- blow bridges if GetNScriptUnitsInArea(88, "bang") == 1 then -- where 88 is the officer and bang is area DamageObject(750, GetObjectHPs(750)); --damage bridge with script id of 750 to destroy Suicide(); end; end;
This however is a silent destruction of the bridge. And we all like some BANG to it. To accomplish this it is best to place
a few mines on the bridge set to Player ="2". Allocate a scriptID to them as well.
Then do the script as such:
Code: function Bang() -- blow bridges if GetNScriptUnitsInArea(88, "bang") == 1 then -- where 88 is the officer and bang is area DamageObject(750, GetObjectHPs(750)); --damage bridge with script id of 750 to destroy DamageObject(751, GetObjectHPs(751));--damage mines with script id of 751 to destroy Suicide(); end; end;
Now a nice bang accompanies the destruction.
The same technique can be used to destroy a building.
NOTE: BRIDGES ARE NOT DESTROYED IN THIS FASHION IF PLAYING IN GOD MODE
|
|
Joseph_Porta
Pukovnik
Half-Czech / Half-Norwegian
Posts: 398
|
Post by Joseph_Porta on Sept 28, 2009 23:29:35 GMT 1
Thanks for all your advice - I'll check them out.
|
|