Home   Help Search Login Register  

Author Topic: getPos of an RPG  (Read 743 times)

0 Members and 1 Guest are viewing this topic.

tehhunter

  • Guest
getPos of an RPG
« on: 07 Jul 2005, 04:24:37 »
I was thinking of a way to improve cutscenes in which rpg's are shot at tanks and thought that having a camera follow an RPG to its ultimate destination would be very nice. However, I am not sure if the RPG is an actual object when fired and if so how I would use getPos on it. This would make for an interesting cutscene, but I am afraid I am not experienced enough in OFP to do such a thing.

If there is no way that I would assume I would have to camCreate an RPG near the camera and set it's velocity, but that is no fun.

So to sum that up, is there a way to use getPos on an RPG?

qqqqqq

  • Guest
Re:getPos of an RPG
« Reply #1 on: 07 Jul 2005, 12:29:03 »
Use a fired eventhandler to detect the firing.   It calls a script which uses nearestobject to label the missile in flight.

Offline 456820

  • Contributing Member
  • **
Re:getPos of an RPG
« Reply #2 on: 07 Jul 2005, 19:45:35 »
yep thats right but a bit more detail you dont have to use event handlers but it would be better using them aswell but you can just use the nearest object command wich i used to think was confusing now i think its easy
but anyway
this method will use the fired command
create a script name it check.sqs
then at the start copy this in
Code: [Select]
_shooter = _this select 0
_ammotype = _this select 4

then check what theat unit just fired i think its
? _ammotype == "Rpg"
or something
then if it it goto "camera" else exit the script

#camera
_rpgfollow = nearestobject [_shooter,rpg]

then hear create the camera and make a loop init continuoulsy targetting _rpgfollow wich is now that neame of the rpg the unit fired
note if you want to do this with a law just change the rpg to the name of the law ammo
note-i dont think rpg is the actual name of the ammo

hope that helps alittle more

EDIT - that wont actually get the pos of the prg just get the camera to follow it
« Last Edit: 07 Jul 2005, 19:47:12 by 456820 »