Grenade launcher
#1

Hi y'all, been inactive on the forums for a small time..
Anyway, I felt like making a grenade launcher script, but I've spotted a problem..
Is there any way, to detect if the grenade hits a building/wall/mountain?
Plus, I think my GetPosFromView is kinda f... up, is there a better way to find where the player is aiming at?
Any help will be appreciated ofcourse.
Best regards, Martin.
Reply
#2

is your script applying some sort of "fake gravity"? i mean, is the grenade object falling down after you threw it away? if so, then you can check if the grenade falls down (the z axis height decrementing). the mapandras plugin will detect if it hits the ground, and even if it hits a wall bigger than 1 unitІ regardless its direction.
Reply
#3

Quote:
Originally Posted by Babul
Посмотреть сообщение
is your script applying some sort of "fake gravity"? i mean, is the grenade object falling down after you threw it away? if so, then you can check if the grenade falls down (the z axis height decrementing). the mapandras plugin will detect if it hits the ground, and even if it hits a wall bigger than 1 unitІ regardless its direction.
You stole my words. LOL

I've already did that method and its working.
Reply
#4

Actually, my grenade's just fucked up, it moves to where i clicked the grenade launcher to, if it's on the ground, if i shoot it in the air, the explosion & grenade will simply be on the ground, and their positions are crap too, not where i am at.. so that's why i wonder how to improve aim position..
Reply
#5

Quote:
Originally Posted by Mike_Peterson
Посмотреть сообщение
Actually, my grenade's just fucked up, it moves to where i clicked the grenade launcher to, if it's on the ground, if i shoot it in the air, the explosion & grenade will simply be on the ground, and their positions are crap too, not where i am at.. so that's why i wonder how to improve aim position..
As the person said above, use MapAndreas (by Mauzen beacuse its more improved). Just stay a bit with that plugin to understand it functions, it becomes easy and powerful.
Reply
#6

But I am using MapAndreas -_-, so how do i create this 'fake' gravity with a grenade object?
Reply
#7

To make it arch? Just move it down over time.
I don't see how you're going to do this though - you can't detect walls.
Reply
#8

walls below a size of 1mІ (meters or units, its the same in GTA) cant be detected by the mapandreas plugin, its resolution is too low, and it wont detect custom objects. if any object is bigger than that mІ, like a house, sometimes a plant/tree, or simply a canyon, can be detected.
to apply the (fake) gravity can be easy:
pawn Код:
new Float:ZVelocity[NAX_GRENADES];
then, in a really short timer which loops through all grenades, increase the ZVelocity[grenade] about 0.01 and add this ZVelocity to the objects current position (even while its moving, the new speed will get applied to the grenade).
Reply
#9

[ame=http://www.youtube.com/watch?v=wvwkcYZn4Ts]Grenade launcher by Mauzen[/ame]

Now, this looks interesting.. Created by the awesome Mauzen, but unfortunately, there is no release of this script, anyway. Going to bed now.
Reply
#10

Wow, that looks sweet.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)