OFPEC Forum

Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Chrispy on 18 Aug 2007, 00:37:38

Title: Suicide explosion
Post by: Chrispy on 18 Aug 2007, 00:37:38
Okay, I'm working on an .sqs thingy for OFP. Basically what I want is an option to suicide yourself.

I know you have to do this to make the action:
this addAction ["Suicide", "suicide.sqs"]

BUT, for the .sqs creation/editting part, I don't know how to make it so that an explosion happens right on the player. I could use the player setdammage 1 but I want an explosion!

Any help? Thanks guys.

Chris :)
Title: Re: Suicide explosion
Post by: Rellikki on 18 Aug 2007, 00:40:50
Use the createVehicle command to create a tank shell or some other explosive at the player's position. List of weapons and ammunition (http://www.ofpec.com/COMREF/weapons.php). The magazines under Artillery & Cannon create some good explosions. Here's an example command for the script:

Code: [Select]
_bomb = "Heat73" createvehicle getpos player
Title: Re: Suicide explosion
Post by: Chrispy on 18 Aug 2007, 01:49:59
Didn't work... Is it because I don't have Res?

Chris
Title: Re: Suicide explosion
Post by: schuler on 18 Aug 2007, 11:18:13
i dont understand, you want the player to have the option of killing himself and those around him,? if so a simple script and a radio camand should do the trick.. player clicks radio " blowup" or what ever you type for radio and bamm she blows,, even if you dont have Res, and hey res should be on shelves for $9.99 by now  :scratch: ,,, i would think!?!?  i will take the time to give you this if someone doesnt come up with a better idea  :D schuler

Edit , i wouldnt , myself use a sqs , the radio could be like a cell phone and setDammage 1 to your car or truck,, by if you know where the suicide would take place you could ad (object #####) setDammage 4 to house's or a truck or tank. much more dammage!!!!!  all depends on the mission your planing and where you what to 'off yourself!"  lol ,,, but the radio and a small script is the trick on this i think  ;)
Title: Re: Suicide explosion
Post by: Chrispy on 18 Aug 2007, 21:36:50
Okay... I'll switch to the radio command thingy then.

So would anyone like to guide me on this one? I pretty much have no knowledge on how to have a radio command trigger the explosion.

Thanks guys.

Chris :)
Title: Re: Suicide explosion
Post by: schuler on 19 Aug 2007, 09:58:48
hey i'll try it out and post you a sqm. file,, short mission and you can copy it into your mission, give you a readme with instructions on how to copy and paste it to your mission, and the hole 9 yards,, what island are you using? can a car or truck be used for the bomb? i think i can set it up so the player and a truck explowed , u will use the radio to set of the bomb at any time. but i dont know what the after life will be like  :D i'll try to check out what you can do. you really should buy the gold upgrade or res, pack. give me some time to look at this for you! schuler
Title: Re: Suicide explosion
Post by: schuler on 19 Aug 2007, 14:16:45
if this looks like something you want , i can seen more info on how to use it  :)
i added a script of "onplayerkilled" so the ending shows the dammage youve done,
just put in in your ofp / user file and it will come up on island Eden in your editor. not in missions,, ok ?
Title: Re: Suicide explosion
Post by: h- on 20 Aug 2007, 08:53:28
Schuler, don't double post.

If you have something to add after a short period of time modify your post instead of replying to yourself...
Title: Re: Suicide explosion
Post by: Chrispy on 22 Aug 2007, 09:09:49
It's good bro.

Mind if I edit this, save it as my own, and release it to the Editors' Depot? Don't worry, you'll be definitely creditted. Time to play around now!

Chris :)
Title: Re: Suicide explosion
Post by: JasonO on 22 Aug 2007, 15:10:20
I suppose you could realease it but its more of a few lines of code than a whole script. Anyway give it a shot ;)
Title: Re: Suicide explosion
Post by: schuler on 23 Aug 2007, 04:49:01
Chris your welcome  :D note i also make it so the player can walk away from the car and use the radio to blow the car and kill himself at the same time! theres lots more u can do with it.
  my pc broke down on me that night i uploaded that sqm  :weeping: my C: drive may be wasted and i'll lose all my info and missions on it plus tons of other stuff  >:(
   cheers schuler
Title: Re: Suicide explosion
Post by: Chrispy on 23 Aug 2007, 06:07:09
I couldn't put the explosion thingy on the player - it didn't work! Damn!

Do I have to use a car? Can't it be the player?

Chris
Title: Re: Suicide explosion
Post by: Mandoble on 23 Aug 2007, 12:25:11
try with this slight modification:
Code: [Select]
;Script by MP - markpalmer@hotmail.com
;Based on script created by David Berka (David.Berka@nmi.at) respect is due

;creates a large explosion at an object location, vehicle, infantry etc..
;can be easily modified to accept coords, but you know that already ;-)
;usage: [objectname] exec "explosion.sqs"

_AmmoType = "Shell125"
_Unit = _this select 0

_Explosion = GetPos _Unit

_cx = _Explosion select 0
_cy = _Explosion select 1
_cz = (_Explosion select 2)+1

;two shells at the same space position = immediate BOOM
_tempObj = _AmmoType camCreate[_cx, _cy, _cz]
_tempObj = _AmmoType camCreate[_cx, _cy, _cz]

in the activation field of the radio trigger put:
[vehicle player] exec "explosion.sqs"

note that vehicle player returns the player itself when the player is not into any vehicle, and the corresponding vehicle when the player is in a vehicle.
Title: Re: Suicide explosion
Post by: schuler on 24 Aug 2007, 02:26:35
Chris , you may have to change the "onplayerkill" script , my pc is broke so i cant look at it. but open it and change the 'camtarget bomercar' , [i think it is] to player or,,, better to say it this way, anything that says bomber or bombecar just replace it with player.
Title: Re: Suicide explosion
Post by: Chrispy on 27 Sep 2007, 00:12:51
Damnit I think I kinda forgot about this topic!

@ Mandoble, the code doesn't work. I get a Generic Error thingy (it's because I don't have Res?).
@ schuler, the onplayerkilled.sqs script? That's only the camera script isn't it?

I'll play around a bit and see what I can do. Is there any way whatsoever I can get an explosion on the player via a trigger in the mission editor (as opposed to .sqs files)? Without Resistance?

Chris :)
Title: Re: Suicide explosion
Post by: schuler on 27 Sep 2007, 01:11:36
Quote
@ schuler, the onplayerkilled.sqs script? That's only the camera script isn't it?
when the player die,,