Scripts / AmenMoses Helicopter script and bullets

Author
Message
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 15th Sep 2017 19:09
Really love the helicopter script by AmenMoses! Fantastic! I was wondering if there was a way to avoid the bullets and rockets shot by the helicopter when going inside buildings or hiding under some kind of cover. Thanks for any help!
PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 15th Sep 2017 22:18
One way would be to combine this with my zones script.

i.e. make 'safe' zones then change the code in the scripts to check whether the player is outside the zones before triggering the decals and reducing player health.

In addition the rockets would need ray casting adding to trigger them to blow up on contact with any object, this would mean that if you were near the wall of a building and the rocket hit outside you would probably still get hurt but if you were far enough in side you may be ok.

Been there, done that, got all the T-Shirts!
PM
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 16th Sep 2017 15:11
Thank you for the quick reply. I will give that a try.
PM
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 18th Sep 2017 18:24
Thought I could figure this out but really a beginner with scripting. Am I right in thinking this is the line in the helicopter_bullet _hit script I would have to alter: if CloserThan(x, z, 150) then HurtPlayer(e,20) end. Just not sure how to add a check to see if player is not in a safe zone. (Using your zone script)

PM
AmenMoses
GameGuru Master
8
Years of Service
User Offline
Joined: 20th Feb 2016
Location: Portsmouth, England
Posted: 18th Sep 2017 19:26 Edited at: 18th Sep 2017 19:42
Nice to see someone trying for themselves.

I tried this out myself, I put a check around all the code that includes that line then realised that if you are inside the building looking out you should really be able to see any shots outside the building. For my second attempt I checked if the bullet hit x,z is outside the zone, if it is I display it and check if the player is outside the zone, if not don't do the line you indicated.

If you really want a challenge make it work for multiple zones!

When I get on my PC later I'll post up the rocket code to make rockets explode outside the building but as I expected the blast radius will affect the player inside the building, not sure if having thinker walls will help though.

btw I thought of another way of doing this, when the player enters a safe zone change the helicopter(s) to 'neutral' mode, then when the player leaves the zone set them back to 'enemy'. This should be quite simple using the monitored zone functions.
Been there, done that, got all the T-Shirts!

Attachments

Login to view attachments
PM
Pink Panther
14
Years of Service
User Offline
Joined: 1st Feb 2010
Location:
Posted: 19th Sep 2017 02:41
Thank you! I will get to work on that.
PM

Login to post a reply

Server time is: 2024-04-27 03:12:14
Your offset time is: 2024-04-27 03:12:14