Home   Help Search Login Register  

Author Topic: Detecting if RPG missed a chopper... [SOLVED]  (Read 1178 times)

0 Members and 1 Guest are viewing this topic.

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Detecting if RPG missed a chopper... [SOLVED]
« on: 28 Jan 2010, 20:36:23 »
What I am trying to do is detect if RPG fired by player did or did not hit a chopper.

Basically I am having a mission where player as member of Resistance must grab an RPG and use it to destroy a V80, so if he misses, mission ends with a failure.

Any ideas on how to do this?

Thanks,
Krieg
« Last Edit: 31 Jan 2010, 08:21:25 by Krieg »
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline Clayborne

  • Members
  • *
Re: Detecting if RPG missed a chopper...
« Reply #1 on: 29 Jan 2010, 00:34:35 »
If the player only has access to a limited number of RPG rounds, you could run a check with a looping script to detect when he has no more ammo left, followed by a check to see if the chopper is still alive (if you are actually checking to see if it is dead and not just hit). Something like

Code: [Select]
#check

~1

?(Playername ammo "RPG" == 0): goto "start"

goto "check"

#start

~5

? (alive chopper1) then {choppermissed = true}

?!(alive chopper1) then  {chopperhit= true}

exit

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: Detecting if RPG missed a chopper...
« Reply #2 on: 29 Jan 2010, 15:01:50 »
Thanks, Clayborne! I'll test it right away! :good:
If you see a light at the end of the tunnel, then it's probably an enemy tank.

Offline savedbygrace

  • Intel Depot
  • Administrator
  • *****
  • Be swift to hear...slow to speak...slow to wrath.
Re: Detecting if RPG missed a chopper...
« Reply #3 on: 31 Jan 2010, 04:01:39 »
Rather than the alive command, you may want to consider using the getdammage command for the check in the case that the player just clips the chopper.
Code: [Select]
? (getdammage chopper1 < .1) :
? (getdammage chopper1 > .1) :
Of course, the dammage level can be adjusted to what you require.

There is also no need to name the player as it already has it's own built in variable called "player"

Offline Krieg

  • Mission Maker
  • Members
  • *
  • Who dares wins.
Re: Detecting if RPG missed a chopper...
« Reply #4 on: 31 Jan 2010, 08:21:11 »
Thanks, savedbygrace!
I'll check it out immediately!
If you see a light at the end of the tunnel, then it's probably an enemy tank.