OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: greg147 on 30 Apr 2005, 19:06:51

Title: Destroying buildings....properly.
Post by: greg147 on 30 Apr 2005, 19:06:51
Hi all,

Well, I decided to try my hand in scripting. But failed.  :-[
So maybe someone else can make this think for me  ;)

My plan was to place a building in the editor, then when it was hit (say, damage 0.3), it was deleted and replaced by a slightly destroyed building, one of the kolgujev ones. Then, when that building was hit to about damage 0.7, it was deleted and replaced by the near enough flat destroyed building.

Nice effect, see?  ;)

Unfortunatly, it didn't go too well.

Does anyone have the skill/time to make a script like this?

Thanks (http://dynamic6.gamespy.com/~ww2ec/forum/html/emoticons/army.gif)
Title: Re:Destroying buildings....properly.
Post by: LCD on 30 Apr 2005, 19:45:25
Yo guys this is part of a kinda bet

the answer would be trigers like that

condition : dammage buildingname <0.7 (put the dammage you want instead of 0.7)
onactivios : deletevehicle buildingname; buildingname = createvehicle "buildingtype"

youll have to find the building type by using the editor, place the building u need and check the cpp to c what type it is

:cheers:

dont give up on scriptin ;)

LCD OUT
Title: Re:Destroying buildings....properly.
Post by: greg147 on 30 Apr 2005, 20:16:56
Thanks LCD. I'm trying that now  8)
Title: Re:Destroying buildings....properly.
Post by: DBR_ONIX on 30 Apr 2005, 20:29:42
The create vehicle bit needs a position, gmaybe make logic where building is, and getpos it?
- Ben
Title: Re:Destroying buildings....properly.
Post by: greg147 on 30 Apr 2005, 20:44:49
OK, I ran into a problem. In my trigger, I have this:

b1 is the name of the building.  ;)

condition: damage b1 <0.7
on activation: deletevehicle b1; b1 = createvehicle "AAA548"

But I get a 'unknown operator' error. Any idea where i've gone wrong?

@DBR_Onix:
How would I do that? (I'm real new at this sort of thing  :-[ )
Title: Re:Destroying buildings....properly.
Post by: Planck on 30 Apr 2005, 21:00:53
Try :

b1 = "AAA548" createvehicle getpos whereever


Planck
Title: Re:Destroying buildings....properly.
Post by: greg147 on 30 Apr 2005, 21:11:05
Hmmm.....I put in the trigger
Code: [Select]
b1 = "AAA548" createvehicle getpos logic1
And made a game logic called 'logic1'
But got this error after shooting the building  :P

error reserved variable in expression
Title: Re:Destroying buildings....properly.
Post by: penguinman on 30 Apr 2005, 22:36:01
if anybody does get it to work, make sure to have a noise when it switches like crumbling and falling debree, and also a large dust cloud so the player wont see whats really happening

good luck with it
Title: Re:Destroying buildings....properly.
Post by: DBR_ONIX on 02 May 2005, 16:19:37
Just writing this here, I'll test later if I remeber..
Code: [Select]
_building = _this select 0
_pos = getpos _building
#loop1
~1
?(dammage _building < 0.8):goto "loop2"
goto "loop1"

#loop2
~1
; Code for smoke/debris here
deletevehicle _building
_building = "Building2" camcreate _pos
?(dammage building < 0.8): goto "loop3"
goto "loop2"

#loop3
~1
; Code for smoke/debris here
deletevehicle _building
_building = "Building3" camcreate _pos
?(dammage building < 0.8): goto "loop4"
goto "loop3"
;ect

That's the best way I can think of doing it, never liked using lots of triggers, call it [this] exec "scriptname.sqs"
- Ben
Title: Re:Destroying buildings....properly.
Post by: Crassus on 03 May 2005, 00:58:28
Maybe this is off yer topic, but isn't COLONEL KLINK (http://www.essentialasair.com/dc3d/index.php?board=20) working basically the same thing you're all after?  
Title: Re:Destroying buildings....properly.
Post by: greg147 on 03 May 2005, 07:59:42
Yeah. Having taken a look at that forum, he has a project much like this one. But his will be much more complicated, and will require lots of work. If this script works, people can do that easily, even if it doesn't look good, until his project is released.  ;D

I basically am trying to do as he is, but with 4 different sections of damage, and using BIS buildings  ;)
Title: Re:Destroying buildings....properly.
Post by: DBR_ONIX on 03 May 2005, 13:51:53
The DIB project was (I'm almost totaly sure) *Twitches* scraped for OFP and is now a VBS1 only project...
Hmm, "DIB for the Falklands Mod".. Sounds OFP-like.. Unless Falklands mod is only for VBS1.. :P
- Ben
Title: Re:Destroying buildings....properly.
Post by: Ash on 29 May 2005, 22:05:30
Falklands mod will incorporate a limited version of DIB, and don't worry.. It isn't for VBS1 and will be released free just as we set out to do  :)
Title: Re:Destroying buildings....properly.
Post by: greg147 on 29 May 2005, 22:12:39
Well, I've failed miserably at this script. Too damn confussing. I just can't get the setpos to work, or the deleting the building  :(