OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: Sniperwolf572 on 13 Sep 2005, 01:14:39
-
Hello everyone,
Problem:
I'm making a cutscene for a campaign and I need to create ECP's Fuse Hand Grenade (Hand Grenade that bounces around and detonates after a while).
This is the situation:
There is Soldier named gerksk1 hidden behind stack of crates, there are some soldiers shooting at him (they don't hit him) but they're behind camera so lets forget about them. Now I want to create ECP's Hand Grenade with CamCreate and make it look like it came from behind the camera over the crates and near the soldier, wait for a while and detonate. But, as you can see I can't figure out how to create ECP's Grenade.
Someone help me out please.
-
First find the classname of the ECP Hand Grenade.
Then just type this in where you want the grenade to explode in your script:
_grenade1 = "ECPGrenadeClassName" camCreate [getMarkerPos "grenadepos" select 0,getMarkerPos "grenadepos" select 1,0]
Then place an empty marker at the spot where the grenade is to go off and name it
grenadepos
-
AFAIK an ECP grenade has the same classname as a normal BISgrenade
"grenadehand"But when you camcreate it, it will explode immediately.
-
Problem is that there is not ECP Grenade Class name, Grenade you throw in OFP is classed as regular bis grenade, but I suspect that ECP team has used fired event handler to replace default grenade and substitute it with their model witch is probably thing class (Witch would explain rolling and animation).
In the meantime, I managed to make a simple script to do the desired effect, might me kinda complicated but here it is:
; Create ECP Grenade model and setpos it 4m above Nade1 unit (Invisible H in my case)
ECP_GRENADE= "ECP_MKIIDummy" CamCreate [(getpos Nade1 select 0), (getpos Nade1 select 1), (getpos Nade1 select 2)+4]
; Rotate the grenade 90 degrees so grenade is sideways
ECP_GRENADE setdir 90
; "Bump" the grenade to the right and up a bit
ECP_GRENADE setvelocity [10,0,1]
; It should take grenade 1.05 seconds to reach the ground (in my case)
~1.05
; Bump the grenade again to achieve bouncing effect
ECP_GRENADE setvelocity [5,0,2]
; And again
~0.38
ECP_GRENADE setvelocity [3,0,1]
; After 2 Seconds create explosive BIS grenade to simulate explosion
~2
EXPLOSIVE_GRENADE= "GrenadeHand" CamCreate [(getpos ECP_GRENADE select 0), (getpos ECP_GRENADE select 1), (getpos ECP_GRENADE select 2)-0]
; Delete the "fake" grenade
deletevehicle ECP_GRENADE
exit
Needs a little tweaking on detection when grenade has hit the ground but generally thats it.
EDIT: I'll leave the thread unsolved because someone might find out ECP's way or make simpler script than mine.
-
Bah, who needs ECP, if you grab my Grenade Pack you can get realistic time fused bouncing grenades. All sorts of throwables are included, like the M67, M61, Mk2, ANM8 smoke, M18 smoke, and a few flashbangs. You can grab it here (http://ofp.gamezone.cz/index.php?showthis=8760).
Now I can help you:
_unit = _this
_pos = (getpos _unit)
_grenstart = [_pos select 0, (_pos select 1)+5,(_pos select 2)+1.5]
_grenvel = [0,-11,8]
_grenade = "BD_M61" createvehicle _grenstart
_grenade setvelocity _grenvel
[_grenade,_grenade] exec "\BD_GrenadePack\firedM61.sqs"
exit
Just mess with the rel pos and velocity a bit, or tell me the desired distance and direction (north, south, east, or west) of the grenade in relation to the unit (the guy behind the crates) and I can try and calculate it.
-
WHO NEEDS ECP?!?
Have you tried ecp?? its fookin awesome! ::) :-X
-
WHO NEEDS ECP?!?
Have you tried ecp?? its fookin awesome! ::) :-X
I don't believe in those eye-candy conversion mods, its just extra lag and HD space. I'm not trying to make ECP look bad, I am just saying that its only for the "unenlightened" ones among us. Anyways I garentee you will have better results with my grenade pack than with the ECP one ;)