Home   Help Search Login Register  

Author Topic: Destroying buildings....properly.  (Read 2005 times)

0 Members and 1 Guest are viewing this topic.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Destroying buildings....properly.
« 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
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline LCD

  • Former Staff
  • ****
    • Everon Cartel
Re:Destroying buildings....properly.
« Reply #1 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
"guess being the community has downsides .." - cheetah
Help Perfecting Da Next Best Thing - O-Team Beta

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Destroying buildings....properly.
« Reply #2 on: 30 Apr 2005, 20:16:56 »
Thanks LCD. I'm trying that now  8)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

DBR_ONIX

  • Guest
Re:Destroying buildings....properly.
« Reply #3 on: 30 Apr 2005, 20:29:42 »
The create vehicle bit needs a position, gmaybe make logic where building is, and getpos it?
- Ben

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Destroying buildings....properly.
« Reply #4 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  :-[ )
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline Planck

  • Honoured
  • Former Staff
  • ****
  • I'm never wrong ....I'm just not always right !
Re:Destroying buildings....properly.
« Reply #5 on: 30 Apr 2005, 21:00:53 »
Try :

b1 = "AAA548" createvehicle getpos whereever


Planck
I know a little about a lot, and a lot about a little.

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Destroying buildings....properly.
« Reply #6 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
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

Offline penguinman

  • Contributing Member
  • **
  • Money is worthless, just paper, ink, and threads
Re:Destroying buildings....properly.
« Reply #7 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

DBR_ONIX

  • Guest
Re:Destroying buildings....properly.
« Reply #8 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

Crassus

  • Guest
Re:Destroying buildings....properly.
« Reply #9 on: 03 May 2005, 00:58:28 »
Maybe this is off yer topic, but isn't COLONEL KLINK working basically the same thing you're all after?  

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Destroying buildings....properly.
« Reply #10 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  ;)
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB

DBR_ONIX

  • Guest
Re:Destroying buildings....properly.
« Reply #11 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
« Last Edit: 03 May 2005, 13:53:20 by DBR_ONIX »

Ash

  • Guest
Re:Destroying buildings....properly.
« Reply #12 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  :)

Offline greg147

  • Contributing Member
  • **
    • Royal Air Assault Battalion
Re:Destroying buildings....properly.
« Reply #13 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  :(
Royal Air Assault Battalion - [L/Cpl] Greg
RAAB