OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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)
-
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
-
Thanks LCD. I'm trying that now 8)
-
The create vehicle bit needs a position, gmaybe make logic where building is, and getpos it?
- Ben
-
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 :-[ )
-
Try :
b1 = "AAA548" createvehicle getpos whereever
Planck
-
Hmmm.....I put in the trigger
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
-
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
-
Just writing this here, I'll test later if I remeber..
_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
-
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?
-
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 ;)
-
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
-
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 :)
-
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 :(