OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Gooner861 on 21 Aug 2004, 21:47:11

Title: Exploding house
Post by: Gooner861 on 21 Aug 2004, 21:47:11
Hi again,

I got an explosion script frm the ed depot where all u need to is put [objectname] exec"explosion.sqs". Now wot i want is for wen a unit enters the house, for the house to explode.

So i find the ID of the house and put [ID 28550] exec"explosion.sqs" but nothing happens?!?

To test the script works i get a jeep, do the same as above and yeh the jeep blows away.

Why wont the house blow up?

Cheers

Gooner
Title: Re:Exploding house
Post by: Artak on 21 Aug 2004, 21:51:33
hi,

Objectname is not 'ID x'. It's 'object x'.
You've propably got a script that takes the target from the passed info, so try
[object 28550] exec "explosion.sqs" and it should work a bit better.  :)
Title: Re:Exploding house
Post by: Gooner861 on 21 Aug 2004, 22:34:40
Hmmmm, i tryed that and it came up with some error about the script.  :-\

Heres the script:

_AmmoType = "Heat120"
_Unit = _this select 0

_Explosion = GetPos _Unit

_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2

_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
~0.01
_tempobj = objNull

exit

It says there is an error with
Quote
_tempObj = _AmmoType camCreate[_cx, _cy, _cz]

something about "error type array"

Cheers

Gooner
Title: Re:Exploding house
Post by: Planck on 21 Aug 2004, 22:47:36
Try changing that to:

_tempObj = _AmmoType camCreate getPos _Unit

If that works then this part is redundant:

_Explosion = GetPos _Unit

_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = _Explosion select 2


Planck
Title: Re:Exploding house
Post by: Gooner861 on 21 Aug 2004, 22:52:37
Ok thanks for the help. Still a problem though. Ok so now there is no error message, but now the problem is there is no explosion?!?

Gooner
Title: Re:Exploding house
Post by: Mud_Spike on 21 Aug 2004, 23:00:24
And you are sure you got the correct Id number?

Try the script itself by executing it with:
[player] exec "explosion.sqs"

That should blow you up, if it doesnt, something is wrong with the script,
if it does, the object ID is wrong.
Title: Re:Exploding house
Post by: Gooner861 on 21 Aug 2004, 23:04:33
Nope nothing happens, must be the script.  >:(

Thanks

Gooner
Title: Re:Exploding house
Post by: Mud_Spike on 21 Aug 2004, 23:13:12
Then the script probably isnt executed at all.
Did you put it in your mission's folder? (i.e., ....../users/gooner/missions/my_mission/)

Since the script is really just a line or two, you can try putting those lines in the the trigger instead of [....] exec "explosion.sqs" like so:
Code: [Select]
tmp = "heat120" camCreate GetPos object 28550 ; tmp = objNull
If none of this works, something is crap.
Title: Re:Exploding house
Post by: Tyger on 21 Aug 2004, 23:20:45
are u guys blind????? ???

if im not mistaken, then
Code: [Select]
_tempObj = _AmmoType camCreate[_cx, _cy, _cz] is missing a space after camCreate!!!
re edit the script to the following:
Code: [Select]
_tempObj = _AmmoType camCreate [_cx, _cy, _cz]
you need a space after camCreate. then it should work. ;)
Tyger

Title: Re:Exploding house
Post by: dmakatra on 21 Aug 2004, 23:29:44
That's a crappy script anyway. Could be used much more effiecent and easier with triggers.

Trigg:
cond: this
on act: boom = "heat120" camcreate getpos object XXX

:beat: *Gets Shot* :beat:
Title: Re:Exploding house
Post by: Planck on 21 Aug 2004, 23:30:30
Then why is:

_tempObj = _AmmoType camCreate getPos _Unit

not working either?


Planck
Title: Re:Exploding house
Post by: dmakatra on 21 Aug 2004, 23:33:14
Just put a GL on the house instead of using this object XXX shite. It allways fecks up. GLs are convienent and trustable.

:beat: *Gets Shot* :beat:
Title: Re:Exploding house
Post by: General Barron on 21 Aug 2004, 23:37:01
are u guys blind????? ???

if im not mistaken, then
Code: [Select]
_tempObj = _AmmoType camCreate[_cx, _cy, _cz] is missing a space after camCreate!!!
re edit the script to the following:
Code: [Select]
_tempObj = _AmmoType camCreate [_cx, _cy, _cz]
you need a space after camCreate. then it should work. ;)
Tyger



It doesn't matter whether you have a space between the command and the array or not. Same goes for the "format" command, and other commands requiring an array.
Title: Re:Exploding house
Post by: Gooner861 on 21 Aug 2004, 23:48:09
Ok now it works lol, i put space in Object28550 and it worked. So much fuss over a space  ;D .

This is for use in a cutscene so wud i just need to put that code into the place i want it in my cutscene?

Not my script, was in ed depot. Works so i may as well use it  ;D .

Cheers

Gooner
Title: Re:Exploding house
Post by: Tyger on 22 Aug 2004, 00:12:00
@General Barron

im pretty sure it does matter! u try it, and i shouldn't work w/o a space.

unless v1.46 requires a space while v1.75 doesn't >:( :P. cant wait for resistance to arrive in the mail. :D
Title: Re:Exploding house
Post by: Planck on 22 Aug 2004, 00:26:34
Nope GB is quite correct, the space is not required.

Although it does look neater.  ::)

Planck
Title: Re:Exploding house
Post by: Tyger on 22 Aug 2004, 00:43:59
hmmm.
well i guess im wrong :)

thanks for the correction

Tyger

Edit: When you program a bit of C++ details like that pop out at you. Of course, OFP is not as strict and regimented as C++ is. :P
Title: Re:Exploding house
Post by: Rokket on 22 Aug 2004, 05:15:33
Here's another script I've found out there. I odified it to be a "popcorn" script - big explosion and then smaller ongoing pops, but it's easy to change (add or subtract).

===========================
_markdest = _this select 0
;explosion
~.1
"LaserGuidedBomb" CamCreate [(getpos _markdest select 0),(getpos _markdest select 1), 0]
~.5
"Shell125" CamCreate [(getpos _markdest select 0),(getpos _markdest select 1), 0]
~.35
"Heat125" CamCreate [(getpos _markdest select 0),(getpos _markdest select 1), 10]
~.25
"Heat73" CamCreate [(getpos _markdest select 0),(getpos _markdest select 1), 20]
~.5
"Shell73" CamCreate [(getpos _markdest select 0),(getpos _markdest select 1), 5]
~.75
exit
==============
don't know if it helps.
Title: Re:Exploding house
Post by: dmakatra on 22 Aug 2004, 10:21:21
LGB?!?!?! You wanna blow up the whole town or summin?! :o

:beat: *Gets Shot* :beat:
Title: Re:Exploding house
Post by: DBR_ONIX on 22 Aug 2004, 10:44:33
Of course! :P
Anyway, with the orig script.. If all else fails, run the script on a gamlogic placed where the house is ::)
- ben
Title: Re:Exploding house
Post by: dmakatra on 22 Aug 2004, 11:10:51
I allready said that, meathead. ::)

:beat: *Gets Shot* :beat:
Title: Re:Exploding house
Post by: Gooner861 on 22 Aug 2004, 15:36:35
Thanks Rokket, that's much better although i think i'll get rid of some of the smaller explosions, i only really need one big one. But thanks its more of what i wanted.

Cheers everyone

Gooner