OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: klavan on 15 Dec 2004, 22:01:10

Title: Destroy (or, at least, remove) in map objects
Post by: klavan on 15 Dec 2004, 22:01:10
Hi all.
The AI seem quite unfrendly when becomes necessay for it to enter buildings, even if the building itself is very big. A solution could be open a breach in a wall, but...
The castle ruins (the bigger one) in Nogova is a wonderful place to set up a mission, but the passages through the walls seem not to be too much large for the AI to let my squadmates follow me into. So I've decided to test the possibility to blow up the wall, with the result to discover their apparent indestructibility.
I've tried with 3 satchels. Result: 0
I've tried with a trigger (object XXXXX) setdammage 1. Result: the same.
However, it seem like some objects can be destroyed (as I've exeprienced in the past) and others not (thats new for me).
 Or am I wrong?
Title: Re:Destroy (or, at least, remove) in map objects
Post by: Tyger on 15 Dec 2004, 22:57:50
Hope you have Resistance. :P

You should have a Show IDs/Hide IDs button in the mission editor. Click on it till ids are shown. Then find the piece of wall that you want to breach, and get the object number.

Then make a trigger, with radio alpha, and type object *object's number* setDammage 1.
That will knock over walls but buildings just crumple, don't fall over.  :'( Can't use it on them.

If you want, you could create a script that would detect when you placed a satchel, then do the above for you. It would look something like this:

Code: [Select]
_wall = _this select 0
_bomber = _this select 1
_time = _this select 2
_wpn = _this select 3
_ammo = _this select 4

? _wpn != "put" || ? _ammo != "PipeBomb" : exit

hint format["You have %1 seconds before your breaching charge detonates.",_time]

~_time

_bomber action ["TOUCHOFF"]
_wall setDammage 1

exit

then just add this event handler to anyone who's going to use it (in their init line)

this addEventHandler ["fired",{[object *wall id*,this,*detonation time*,_this select 1,_this select 4] exec "*scriptsname*.sqs"}]

example:
this addEventHandler ["fired",{[object 12456,this,25,_this select 1,_this select 4] exec "breachWall.sqs"}]

Title: Re:Destroy (or, at least, remove) in map objects
Post by: Tyger on 15 Dec 2004, 23:10:59
hehe, didn't see you mentioned Nogova.

Ignore the Resistance comment.  :P  ;D
Title: Re:Destroy (or, at least, remove) in map objects
Post by: klavan on 15 Dec 2004, 23:12:29
I've tried with a trigger (object XXXXX) setdammage 1. Result: the same.

I've tried with and without ().
The dubt about the indestructibility of some object came up after trying to blow up some houses. In some cases the building went down with one satchel. In other 10 satchels seem to be not enough!!! ???
My specific need is to blow up the walls of the castle in order to allow my squadmates to enter the courtyard with me.
Title: Re:Destroy (or, at least, remove) in map objects
Post by: klavan on 15 Dec 2004, 23:16:45
I'll try your script (tomorrow) and then I'll report the effects.
It's time to go to bed, for me now.
Title: Re:Destroy (or, at least, remove) in map objects
Post by: macguba on 16 Dec 2004, 01:05:27
It may be that you cannot destroy it.     Or, even if you can, the AI will still not be able to get through.     object xxx setDammage 1 is the best test.     Try the command on some other objects to make sure you have it working properly, and double check that you have the correct ID.

Walls, windows, doors and buildings generally are one of the game's weaknesses.    The best solution is usually to rethink the mission slightly:  work with the game's strengths.
Title: Re:Destroy (or, at least, remove) in map objects
Post by: klavan on 16 Dec 2004, 12:08:10
Code: [Select]
_wall = _this select 0
_bomber = _this select 1
_time = _this select 2
_wpn = _this select 3
_ammo = _this select 4

? _wpn != "put" || _ammo != "PipeBomb" : exit

hint format["You have %1 seconds before your breaching charge detonates.",_time]

~_time

_bomber action ["TOUCHOFF"]
_wall setDammage 1

exit

The script run OK, I've only changed line 6, removing the second "?", wich give an error message, but the wall is still there...
As stated by macguba, it could be better for me to relocate the area where the mission will take place.  :-\
That's really a pity....
Thanks guys.

Title: Re:Destroy (or, at least, remove) in map objects
Post by: bored_onion on 16 Dec 2004, 18:26:39
it might look unrealistic but surely you could delete the wall?
Title: Re:Destroy (or, at least, remove) in map objects
Post by: Planck on 16 Dec 2004, 20:34:18
You can't really remove .wrp placed objects, the best you could do is damage or destroy them, but, some .wrp objects seem to be indestructable.


Planck
Title: Re:Destroy (or, at least, remove) in map objects
Post by: Tyger on 16 Dec 2004, 23:15:23
i have a feeling the ruins wall ur talking about is one of those giant ones, right?

if it is, you cant destroy it. Otherwise you should be able to  ??? Atleast i can.  :P