Jump to content
Sign in to follow this  
NickThissen

Start mission with destroyed objects

Recommended Posts

Hi,

I want to create a two-part co-op mission where the first part ends with the destruction of a large building. I'd then like the second part to start off with that building already destroyed, but I can't figure out how to do that. I can get the building object via its ID and then destroy it via setDamage, but it will only start to get destroyed when the mission starts, and everyone can see it sink in the ground in a big pile of smoke. Is it not possible to skip that and just start with the rubble to begin with, without any of the 'building is being damaged' effects?

In other words: how do I replace buildings by their destroyed counterparts without actually destroying them "live" in the mission? Thanks.

Share this post


Link to post
Share on other sites

That's the only way to do it. You can use a black fade in screen to help mask its destruction. I think that's what most people do. Or shift your starting position to somewhere out of sight.

I made a mission where a whole village was leveled and used the black fade in method.

I really hate those few buildings that don't have damaged models though. Like the churches, hospital, and office buildings.

Share this post


Link to post
Share on other sites

You could try using hideobject and spawn the a ruin from another building in it's place.

One important thing to know is that sunken buildings can lower FPS dramatically as they're only moved underground and still using the CPU.

Share this post


Link to post
Share on other sites
That's the only way to do it. You can use a black fade in screen to help mask its destruction. I think that's what most people do. Or shift your starting position to somewhere out of sight.

I made a mission where a whole village was leveled and used the black fade in method.

I really hate those few buildings that don't have damaged models though. Like the churches, hospital, and office buildings.

The dust cloud takes like half a minute to settle, way too long for a fade in :(

You could try using hideobject and spawn the a ruin from another building in it's place.

One important thing to know is that sunken buildings can lower FPS dramatically as they're only moved underground and still using the CPU.

Could you show an example of this? How do I spawn ruins?

The FPS hit shouldn't be a problem as it's only one building, and it's on Takistan (the Arma 2 map) which is pretty good on FPS at least for me.

BTW HideObject does nothing :(

Share this post


Link to post
Share on other sites
Setdamage to 1 then set it to 0 then set it to 1 and sorted it will start destroyed with no smoke or destruction animations

Doesn't seem to work, still destroys like usual. Do I need to add sleeps or something? at the moment I have a Game Logic object near the building with this in the init box:

fact = (getPos this) nearestObject 32425; 
fact setDamage 1; 
fact setDamage 0; 
fact setDamage 1;

Share this post


Link to post
Share on other sites

Hide object will work on some buildings, if it doesn't you will need to attach the building to a game logic and move the logic away somewhere and the building will go with it.

hide chapel

in game logic

{ _x  hideobject true} foreach (nearestobjects [getpos this,["house"],12])

attachto

{ _x  attachto [this]} foreach (nearestobjects [getpos this,["house"],12]); this setpos [0,0,0];// warning building is gone until new map loaded 

Recording ruins so you can replace building with ruin model and no smoke/dust

First destroy chapel, place a game logic over the building and name it gl

{ _x  setdamage  1} foreach (nearestobjects [getpos this,["house"],12])

next you need to find the ruins

in a trigger and run after the building has been destryed

blds=[]; pos_blds=[];blds = (nearestobjects [getposatl gl,["ruins"],12]);{blds=blds+[typeof _x];pos_blds=pos_blds+[getposatl _x] } foreach blds;hint str (typeof blds);copyToClipboard str (blds+pos_blds)

You can now past the array containing type of ruin and it's position into a script it should look like this

["Land_Chapel_V2_ruins_F","Land_BellTower_02_V2_ruins_F","Land_BellTower_02_V2_ruins_F","Land_BellTower_02_V2_ruins_F","Land_Chapel_V2_ruins_F",[9176.1,12014.7,0.0791817],[9168.96,12021,-0.0419731],[9171.42,12023.2,0.0419521],[9167.6,12008.9,-0.0550385],[9180.48,12007.6,0.000762939]]

To use it in a mission place this in a game logic placed on the chapel

{ _x  hideobject true} foreach (nearestobjects [getpos this,["house"],12]) ; null=[] execvm "chapel.sqf"

save script as chapel.sqf

_bld=["Land_Chapel_V2_ruins_F","Land_BellTower_02_V2_ruins_F","Land_BellTower_02_V2_ruins_F",[9176.1,12014.7,0.0791855],[9168.96,12021,-0.0419617],[9167.6,12008.9,-0.0550117]];

_many = (count _bld)/2;

for "_i" from 0 to _many-1 step 1 do {
  _obj = createvehicle [(_bld select _i),(_bld select (_many + _i)),[],0,"none"];
};

Edited by F2k Sel

Share this post


Link to post
Share on other sites

F2k Sel, is it not possible to simply do it in the init.sqf file? By setting the damage on the building to 1 from the beginning. Or this this not work, and we have to use all of ^^this.

Share this post


Link to post
Share on other sites

It is possible but some people don't want to have a delay or see a load of dust which takes a while to clear.

If you not starting in the area than this wouldn't be a problem.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×