OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: GodHatesUsAll on 15 May 2003, 04:02:53

Title: SmokeShells and Airstrikes
Post by: GodHatesUsAll on 15 May 2003, 04:02:53
NO, this is not "HOW DO I CALL AN AIRSTRIKE".

I need to know how to make bombs drop wherever my smokeshell lands.

Example:

Return to Castle Wolfenstien MP. How the officer can throw a smoke shell, then bombs land at that area.

So, say i, the officer, throws a smoke shell, then some grenades will explod around the smokeshell, randomly.

Ive seen it in an OFP MP mission, but have no idea how to do it...
Title: Re:SmokeShells and Airstrikes
Post by: Tomb on 15 May 2003, 09:54:36
where the shell lands?!    hmm, well honestly, I've never tried this particular thing (does ppl do that - throw smoke and then a bird comes in and start dropping eggs?? odd.)

well, nevermind m8 :) whatever...

I think ya should have a looksie in the "Ed.Depot"  :-* p'haps a "missile detection" sort of scroll is what you're looking for?!









Title: Re:SmokeShells and Airstrikes
Post by: Knut Erik on 15 May 2003, 09:55:07
The script should look kinda like this. (Not sure about this)


_Bombarea = NearestObject [_man,"Smokeshell"]

#check
@_man ammo smokeshell == 0
         ~10
shell1 = "Shell120" camcreate [(getpos _bombArea select 0) + 1, (getpos _bombArea select 1) + 2, getpos _bombarea select 2]
shell2 = "Shell120" camcreate [(getpos _bombArea select 0) + 2, (getpos _bombArea select 1) + 2, getpos _bombarea select 2]
shell3 = "Shell120" camcreate [(getpos _bombArea select 0) - 1, (getpos _bombArea select 1) + -1, getpos _bombarea select 2]
shell4 = "Shell120" camcreate [(getpos _bombArea select 0) - 2, (getpos _bombArea select 1) - 2, getpos _bombarea select 2]

~10
goto "check"
Title: Re:SmokeShells and Airstrikes
Post by: Tomb on 15 May 2003, 09:56:06
yea, that looks fine  :D 8)  .....except from.... who is _man  ???
Title: Re:SmokeShells and Airstrikes
Post by: GodHatesUsAll on 15 May 2003, 10:06:19
Shit!

Chears dude!

Where _man is, can that be replaced with the Officers name?

For example _officer1

?
Title: Re:SmokeShells and Airstrikes
Post by: GodHatesUsAll on 15 May 2003, 10:15:48
Hmmm, getting an error:

Code: [Select]
_Bombarea = NearestObject [_man,"Smokeshell"]|#|': Error 0 elements provided, 3 expected
Where do i exec this script?

Will it work in MultiPlayer if the Officer respawns?

Whats the _man bit for?
Title: Re:SmokeShells and Airstrikes
Post by: LCD on 15 May 2003, 10:26:50
Knut erics script goot som basic flaws :P

u didnt defind who is man ::)

nd

Code: [Select]
@_man ammo smokeshell == 0

wat hapens if he have more dan 1 smokeshell ? ::)

but u can try dat

in da init of da man put

this addeventhandler ["Fired","_this exec {scriptname.sqs}"]

now da script named scriptname ::) do

Code: [Select]
_man = _this select 0
_shel = _this select 1

? _shel != "smokeshell" : exit
_Bombarea = NearestObject [_man,"Smokeshell"]

~10

shell1 = "Shell120" camcreate [(getpos _bombArea select 0) + 1, (getpos _bombArea select 1) + 2, getpos _bombarea select 2]
shell2 = "Shell120" camcreate [(getpos _bombArea select 0) + 2, (getpos _bombArea select 1) + 2, getpos _bombarea select 2]
shell3 = "Shell120" camcreate [(getpos _bombArea select 0) - 1, (getpos _bombArea select 1) + -1, getpos _bombarea select 2]
shell4 = "Shell120" camcreate [(getpos _bombArea select 0) - 2, (getpos _bombArea select 1) - 2, getpos _bombarea select 2]

exit

shud work ;) - but i didnt try so tel us ;D

LCD OUT
Title: Re:SmokeShells and Airstrikes
Post by: Knut Erik on 15 May 2003, 11:22:43
Ooops..  ::)
Sorry for not giving you the correct info, GodHatesUsAll

Anyway, LCD's script looks MUSH better than mine  ;)
Title: Re:SmokeShells and Airstrikes
Post by: GodHatesUsAll on 15 May 2003, 12:00:18
No Errors, but it doesnt work :/

I throw the smokeshell, and nothing happens....
Title: Re:SmokeShells and Airstrikes
Post by: macguba on 15 May 2003, 12:29:18
Try camcreating 2 shells at each location, so that they collide and explode.
Title: Re:SmokeShells and Airstrikes
Post by: Knut Erik on 15 May 2003, 12:55:42
I had to modify the script a little, but here ya go!  ;)
I've created an exsample mission for you to play with.
Also I've added a cool smoke effect that followes the shells from the sky!  :o 8) :o

CRAP! You can't post .rar files, so I have to pbo it. (Use de-pbo to see how I did.)
Title: Re:SmokeShells and Airstrikes
Post by: GodHatesUsAll on 15 May 2003, 12:59:59
Cheers dude!

Ill give it a try!
Title: Re:SmokeShells and Airstrikes
Post by: GodHatesUsAll on 18 May 2003, 09:23:57
Ok, now for some reason, when my guy fires a gun, it exec's the script for however many times i fire.

So for example, if i fire 5 times, it'll exec the script 5 times :/

Any way to get around this?
Title: Re:SmokeShells and Airstrikes
Post by: LCD on 18 May 2003, 12:45:18
try dat ;D

fixed wat knut eric did  ;D

LCD OUT
Title: Re:SmokeShells and Airstrikes
Post by: GodHatesUsAll on 19 May 2003, 09:31:08
Cheers man!

Can East and West both use it?
Title: Re:SmokeShells and Airstrikes
Post by: LCD on 19 May 2003, 13:34:13
yeah

LCD OUT