szlend Posted February 4, 2008 Share Posted February 4, 2008 (edited) Yesterday i thought of a great idea, a bomb script for Hydra. Well today I've managed to script it so here it is. The bomb currently moves only on the Z axis and with constant speed but I'll fix that in the future. Feel free to use/improve the script. The bomb is dropped with the 'R' key by default. To-do: - Drop delay (To stop bomb spamming) - Bomb acceleration - Bomb XY movement Screenshots: Download: http://rapidshare.com/files/89299762/bomb.zip.html Edited February 5, 2008 by Guest Link to comment
The_Stig Posted February 4, 2008 Share Posted February 4, 2008 Thanks for this. Ive put it on my server but it seems like the bombs are not synced as i cant kill anyone with them nor can anyone see them when i drop them. Link to comment
szlend Posted February 4, 2008 Author Share Posted February 4, 2008 Maybe because the explosions are client side My bad, will fix that Edit: should be fixed now. too drunk for some serious testing atm Link to comment
TmM_Automan Posted February 5, 2008 Share Posted February 5, 2008 Stig don't forget that I put a function in the script for the GTAMP.NET server that prevents players in aircraft from killing pedestrian players with rockets, not sure if that will appy to this script , but it may well. ( I am posting this msg here just incase that is the case which would mean szlend's script is fine and he doesnt need to test it again ) With my script though, the rockets are still visible to attacker and victim its just that they don't hurt, so if the bombs or explosions are not seen maybe more work is needed damn nice idear though szlend, we'll be letting u know if its just clashing with my script or not . Plus good luck on getting movement on the other axes , that will be sweet Link to comment
DSC-L|Gr00vE[Ger] Posted February 5, 2008 Share Posted February 5, 2008 nice script, szlend, i will test it! Edit: hey, that script doesn´t work for me... ^^ Link to comment
Guest Posted February 5, 2008 Share Posted February 5, 2008 I got it to work by adding arguments "x, y, z, rz, ez" to the dropBomb function in the server-side script. Also, awesome script. Link to comment
szlend Posted February 5, 2008 Author Share Posted February 5, 2008 I got it to work by adding arguments "x, y, z, rz, ez" to the dropBomb function in the server-side script.Also, awesome script. Omg thanks, I can't believe i forgot that Will do some tests today and release the fixed script Edit: fixed and tested. Works fine now Link to comment
Mr.Hankey Posted February 5, 2008 Share Posted February 5, 2008 nice script! I made something similar for the baron for my upcoming gamemode and i also tried to add a velocity on the x and y axis to the projectile by getting the velocity of the vehicle but it didnt work for me... maybe you can make it work Link to comment
norby89 Posted February 5, 2008 Share Posted February 5, 2008 nice script! I made something similar for the baron for my upcoming gamemode and i also tried to add a velocity on the x and y axis to the projectile by getting the velocity of the vehicle but it didnt work for me... maybe you can make it work you can change the velocity only for vehicles and players atm Link to comment
szlend Posted February 5, 2008 Author Share Posted February 5, 2008 Moving the bomb with moveObject sucks, wish i could set the velocity but couldn't. Link to comment
Mr.Hankey Posted February 5, 2008 Share Posted February 5, 2008 you can change the velocity only for vehicles and players atm ah ok that's why nothing happens when i change the velocity optional arguments in the createProjectile function^^ Link to comment
norby89 Posted February 5, 2008 Share Posted February 5, 2008 ah ok that's why nothing happens when i change the velocity optional arguments in the createProjectile function^^ sorry I thought you were using setElementVelocity hmm you sure you provided all the necessary optional arguments? Link to comment
Mr.Hankey Posted February 5, 2008 Share Posted February 5, 2008 omg thx norby i always forgot about the target argument because i thought with the other projectiles i dont have to define it so i never set it to nil... gonna test it right now =) Great it works very well =) Here's the code szlend: local usedVehicle = getPlayerOccupiedVehicle (getLocalPlayer()) local x, y, z = getElementPosition(getLocalPlayer()) local velx, vely, velz = getElementVelocity (usedVehicle) createProjectile (getLocalPlayer(), 21, x, y, z - 0.1, 10, nil, 90, 0, 0, velx, vely, -0.1) For the Z Axis i think a higher value for the hydra is better i use this for bombing with a baron =) Link to comment
szlend Posted February 6, 2008 Author Share Posted February 6, 2008 Hehe it's nice but it glows too much and it's a bit small for my taste. I'll stick to my current object But using moveObject causes a lot of problems since I don't know how to detect when the object collides with the world when I set XY movement. Currently (with only Z axis movement) I use getGroundPosition so i know where to destroy the missile and create an explosion. Any ideas? Link to comment
Mr.Hankey Posted February 6, 2008 Share Posted February 6, 2008 try something like this: function checkHeight (bomb) local x, y, z = getElementPosition (bomb) z2 = getGroundPosition (x, y, z) if z <= z2 + 10 then -- check the z points and becaus of the little delay triggering server events causes you have to set the point a bit higher than he actually is z = z2 - 10 -- subsctract the 10 units to create the explosion at the right position and not 10 units above the ground triggerServerEvent ( "createexplosion", getRootElement () , x, y, z) --trigger the event the function is attached to that creates the explosion and pass the arguments x, y, z killTimer (timer) else -- nothing to do here end end function dropbomb () --in the function you create the bomb just add this --bomb = the "bomb" object timer = setTimer (checkHeight, 100, 0, bomb) end i havent tested it yet and i hope you understand what the functions are supposed to do^^ also you might have to mess a little bit around with the number that defines how many untis the checking point for the z axis is over the ground to prevent the explosion beeing created under the ground due to delay I hope i have made it all right and could help you with that though it might look a bit confusing at first Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now