OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started 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
-
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. :)
-
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 _tempObj = _AmmoType camCreate[_cx, _cy, _cz]
something about "error type array"
Cheers
Gooner
-
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
-
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
-
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.
-
Nope nothing happens, must be the script. >:(
Thanks
Gooner
-
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:
tmp = "heat120" camCreate GetPos object 28550 ; tmp = objNull
If none of this works, something is crap.
-
are u guys blind????? ???
if im not mistaken, then _tempObj = _AmmoType camCreate[_cx, _cy, _cz] is missing a space after camCreate!!!
re edit the script to the following:
_tempObj = _AmmoType camCreate [_cx, _cy, _cz]
you need a space after camCreate. then it should work. ;)
Tyger
-
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:
-
Then why is:
_tempObj = _AmmoType camCreate getPos _Unit
not working either?
Planck
-
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:
-
are u guys blind????? ???
if im not mistaken, then _tempObj = _AmmoType camCreate[_cx, _cy, _cz] is missing a space after camCreate!!!
re edit the script to the following:
_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.
-
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
-
@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
-
Nope GB is quite correct, the space is not required.
Although it does look neater. ::)
Planck
-
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
-
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.
-
LGB?!?!?! You wanna blow up the whole town or summin?! :o
:beat: *Gets Shot* :beat:
-
Of course! :P
Anyway, with the orig script.. If all else fails, run the script on a gamlogic placed where the house is ::)
- ben
-
I allready said that, meathead. ::)
:beat: *Gets Shot* :beat:
-
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