Jump to content

Ransom

MTA Team
  • Posts

    4,892
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Ransom

  1. blah i totally forgot you can pick that crap up hitting F2, all mapper controls: https://wiki.multitheftauto.com/index.php?title=Map_Editor_Manual
  2. Some objects arent selectable so name them accordingly so you can select them in the objects menu and move them with the keyboard.
  3. Oooh I'll set up a paypal, I'll leak it to ya after you pay, honest! j/k Unless you offer like $10,000... then we got a deal pal
  4. i do my part, shouting it from the tops of mountains
  5. GTAIV isnt going to put up. It'll have some lame standard MP if anything to make people happy. They don't have to be fancy to advertise MP as a big feature and make millions more.
  6. Ransom

    MTA on Vista

    I'm not upgrading till the last possible second.
  7. There are positive and negative sides to both aspects. The effects ARE known by the team since it was in incremental releases once upon a time. If you are serious about your stance then you should already know some of the basic counter arguments so I won't waste my fingers. I will say however that I agree that MTA has gotten beyond a 1-time release project, and the name of the game has changed. With most of the original core developers grown up and moved on, development is MUCH slower. ESPECIALLY with a project that requires 10x more work with the "blue" core. I remember a little while after I came on the scene as a newbie, when current MTA developer eAi was only a halfop on IRC and a big fan. We were acquainted a few times before he joined the MTA team as a newbie, and now hes one of the most vital torch carriers and among the most vetern members remaining in the MTA project. Much of the work I do as a QATEAM member, I ask for his permissions first (as he is one of the top contributors in terms of work completed). As I mentioned in an above post it is hard to find people to do the work. I've seen new faces come and then go just as quickly as they arrived. It really is hard to find people have the REAL skills and the passion to do this work. Its been very exhausting for me to help these guys release the mod. I've put in countless hours of work myself doing some important tasks (as have other qa members) and I'm not even coding! I can't imagine the amount of time and stress these guys deal with, especially with all this bitching and moaning about how they should do it despite the fact it is their project being created by their work on their own free time. Yet, they are some of the best sports I've ever seen. They can decide a path and stick to it, no matter what opposition they face (and theres been so much different opposition over the years!) I think this time, however, the current path needs to be changed in light of such extreme unexpected changes over the past 2 years. Anyway here I am rambling about the intrestingly long existence of MTA, I better stop. I will say that I am campaigning for incremental releases and it seems to be generally accepted by the MTA members now, even the ones who didn't like the idea in the past. It is quite possible that it may happen. Its just very hard to organize a total change in operations.
  8. Ransom

    which continent?

    Hey, I'd accept Euro-Asia. Just cause its big don't mean its 2 continents!
  9. Ransom

    which continent?

    Europe and Asia are fake continents, not any seperation to them. I didnt originally set up that frapper thing btw
  10. Thanks for the heads up I fixed the links to the script. The video is acting up because your computer is setup in a way thats not good for handling MP4. Most likely due to quicktime, which is a whore. This is due to some doorknob thinking it was a good idea to put quality over the ability for everyone to play the video. In light of these complaints as I expected, I have recompressed the video into wmv format. You should have no problems viewing it now. It will be up very soon.
  11. Really, if you can't afford to fraps it live, then a few screenshots would suffice (fraps can snap multiple pics on the press of a button). As you can see from the video, we will know if you completed it in fast enough a time that its impossible that you backtracked or went really slow.
  12. Sorry, Im new. Next time I'll look. Once again, sorry... Don't be, can't bump a sticky
  13. Funny as that sounds, but yes to some extent you could. Would require really good scripting skills though.
  14. Essentially they were at one point, Kyeman just started his own team. They split apart because they have different values (in gameplay, release dates, anti cheat, public relations, etc). One uses its own core and the other still prefers the scm so they're totally different. Plus the complexity of MTA's core requires a lot of college/university level skill to code + a fundamental understanding of GTA's systems which is the main reason why the MTA team cannot recruit even the most qualified candidates. A merge just isn't logical or possible.
  15. SA is the future but VC will always have the best combat in my heart (which is what I cherish most).
  16. Yep. Matter of fact it would just be a matter of adding more missile objects and more timings (for seperate missiles/explosions to create seperate heights). It would require you to define certain explosion locations so the impact of each appears to explode. Plus, if you wouldn't want them to keep the same shape you'd use random varibles between two numbers much like I did for the explosion cloud for my nuke. It would be considerably harder to script because it would be long unless you were advanced enough to use looping really well to overwrite varibles and such. Before this?!
  17. I think this is getting out of hand again, turning into a MTA is better/SAMP is better flame war soon. I wish more people would just share the ideal that both should exist in neutrality towards each other, which will help contribute to the overall entirety of the MP community for GTA (which is small) for a number of reasons. Attempting to slander and advertise one of the mods just shows fear that you don't have the confidence that the mod you support (whether you are a developer or just a fan) will carry itself with it's quality. So for cryin out loud please stop with the so and so is better than so and so, it gets you nowhere. I know there is incredibly obnoxious fanboyism out there but you shouldn’t retaliate with the same idiocy. Just remember that the core producer of SA-MP (Kyeman) was originally an MTA member and he assisted in the development in MTA. In fact, some of SA-MP is the work he carried from MTA. The MTA team was disappointed with this but there are no hostilities between them. There is actually a conversation at gtaforums.com to prove it (I can't find it right now due to them shutting down their search engine due to GTA:IV). The only hostility you see is created by the fanboys of either mod. So don't throw gasoline on the fire, just give both devs on each side a break and be neutral. The only thing you accomplish is delaying the development and destroying the community (ESPECIALLY with the final product, including hacks, annoying players, etc.) for both sides. Think about a few months ago, everyone was pissed MTA was still in development and started to look to SA-MP, and slandering MTA left and right trying to somehow make us feel threatened enough to release the mod. Now the tables seem to have turned with all eyes focusing on SA-MP. Now I don't know about them, but MTA is not influenced by flaming. Its been around for years and theres not much left we haven't seen here (forum deletions, leaks, ddos attacks, etc.) I know this post isn't going to change anything but, maybe it planted a seed of enlightenment somewhere.
  18. Yes, that was the shape I was going for. If you read the code you'll see I did it in this way because I'm strecthing explosions to the GTA limit pretty much. You could make it more expansive but the completion time would be slower since you can only do so many explosions at once. I'll try to make a splash pool of explosions on the ground radius before I start the cloud but it may look too slow or glitchy. If I do, it should resemble your picture pretty well. The width of the middle part could be imitated more if you expand the radius of explosions as the nuke goes upward. Even if I can't make a better explosion cloud, when the flash goes off for the nuke explosion, I'll be defining an instant kill radius anyhow. Its not completed yet, but the visuals are pretty accurate already. Also note for this same reason that the two weapons can NOT be launched at the same time. Many explosions would occur sporadically between them and ruin the visuals. The exact explosion limit you ask? From my testing and timing of these weapons as I recall the max stretch was 60 explosions at once (from the explosion to the time the smoke animation clears which takes considerably longer).
  19. Yes its not a finalized version it needs some work still
  20. Well theres many different ways you can trigger something to occur with Lua. For a future version, yes I was hoping to be able to click on a map, get player details, and confirm a launch to their location. Could maybe cycle through a players list, type players name... thousands of possibilites. Its sometimes hard to have a concrete answer though. It depends on your ability to manipulate the functions MTA has provided to get what you desire. Such things like Aeron makes (A.I. sam site rockets, hay climb tower) seem impossible at first, but it can be done. Although the MTA team has provided the functions and events, they are amazed themselves sometimes by how we coordinate them with scripting and come up with impressive results such as the imitation of WMDs in this video. eai was particularly pleased with this one as well since he is also a big C&C fan. I hope to perhaps make a mode to use these weapons in a team game or something for the future. We'll see depending on my time. I'd probably produce it this summer if anything.
  21. Tutorial 8b: Nuke :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: Start defining varibles, including a players array root = getRootElement () players = {} outputChatBox ( "Nulear Bomb by Ransom" ) --nuke_rotX = 0 nuke_loops = 0 nuke_explosionTimer = 0 nuke_cloudRotationAngle = 0 nuke_explosionLimiter = false nuke_cannonActivated = false nuke_cancelActivation = false players = getElementsByType ( "player" ) Give all players on the server access to the weapons addEventHandler ( "onResourceStart", root, "ResourceStartNuke" ) function ResourceStartNuke ( name, root ) if name ~= getThisResource() then return end for k,v in players do -- for all players in the "players" array bindKey ( v, "g", "down", "placeNukeBeacon" ) -- bind the key g for triggering the nuke end end addEventHandler ( "onPlayerJoin", root, "nukePlayerJoin" ) function nukePlayerJoin () bindKey ( source, "g", "down", "placeNukeBeacon" ) --if a player joins after the resource loaded, bind their g key to trigger the nuke also end When the nuke key (g) is pressed, show the mouse cursor that will allow the triggering of the onPlayerClick function function placeNukeBeacon ( player, key, state ) if ( nuke_cannonActivated == false ) and ( nuke_cancelActivation == false ) and ( ion_cancelActivation == false ) and ( ion_cannonActivated == false ) then --These conditions prevent triggering the same weapon twice or triggering the other weapon at the same time. --Both weapons cannot be triggered because explosions are stretched to the limit, explosions would be random. defineLaunchType = key --This is used later on the onPlayerClick function to tell it what weapon to launch showCursor ( player, true ) nuke_cancelActivation = true else if nuke_cancelActivation == true then showCursor ( player, false ) end --Prevents cursor from getting messed up if cursor is show for f or g and the opposite key is hit nuke_cancelActivation = false --nuke_cancelactivation is true when the cursor is showing. This is necessary along with asking if the actual --weapon is active to prevent problems with the cursor and weapon activation between both weapons and themselves if nuke_cannonActivated == true then outputChatBox ( "Nuke has already been activated", activator ) else outputChatBox ( "Cannot activate ion cannon and nuke at the same time", activator ) end --This statement says that if the nuke is already in use, display a meassage about it being in use on g --press else, if the above conditions were not satisifed and the nuke is not active, it meant the --ioncannon was active. Therefore, display the other message that both weapons cannot be used at the --same time. end end When the player clicks the mouse cursor, decide if the nuke is supposed to be launched and if so, set up the launch addEventHandler ( "onPlayerClick", root, "playerClickNuke" ) function playerClickNuke ( button, state, clickedElement, x, y, z ) if defineLaunchType == "g" then --If the player clicked, we check if the key is equal to f or g. This will dictate which onPlayerClick function --commences between the ion cannon and nuke scripts nuke_cancelActivation = false --Since the weapon is now in use, you have no chance to abort by pressing the key again, therefore this is false defineLaunchType = nil --This must be reset to nil so it will not fire the nuke next time on click if f was pressed instead of g --(which triggers ion) nuke_beaconx = x nuke_beacony = y nuke_beaconz = z --Set the nuke beacon (detonation spot) coordinates to the spot the mouse cursor clicked on the game map local playerz, playerz, playerz = getElementPosition ( source ) --I put a z height limit on the nuke, because the visual image of the bomb dropping can be broken if it is set --to start an explosion/visually show object deletion in a mid-air point. To prevent this, I have assigned a max --nuke height that is a little bit more than the z height of the player who activated it. There is a function to --grab the actual z height at an X,Y position that I will implement later. For the above line, --getElementPosition outputs 3 varibles, but I only want z so I overwrote 1 varible called playerz as the --function went through and assigned the XYZ values to varible x, varible y, and varible z respectively. nuke_maxBeamHeight = playerz + 2 if nuke_beaconz > nuke_maxBeamHeight then nuke_beaconz = playerz + 3 end --resets the nuke beacon z height if it is more than +3 above player z height if ( button == "left" ) and ( state == "down" ) and ( nuke_cannonActivated == false ) then --When the left mouse button is pressed down (not when released), if nuke is not active then nuke_cannonActivated = true --Set this varible to true, which will be used to avoid double launches & double weapon usage showCursor ( source, false ) --Weapon beacon was chosen and the launch is initiating to that point. Hide cursor. setTimer ( "nukeExplosion", 2700, 1 ) setTimer ( "nukeShot", 500, 1 ) --Trigger these two functions that will drop and explode the nuke. Nuke drop triggers in 500ms, --1 time only. The explosion is triggered at 2700ms which is when the nuke should be hitting --the ground on the game map, it is also triggered 1 time. else activator = getPlayerFromNick ( source ) showCursor ( source, false ) --Makes sure the cursor will not show again for detonation unless the nuke is not active. Activator --is used to display output messages in the other functions that activations/launches arent possible end end end Move 3 objects according to the beacon/detonation point to give the appearance of a falling nuclear bomb to the desired point function nukeShot () nuke1 = createObject ( 16340, nuke_beaconx, nuke_beacony, nuke_beaconz + 200 ) nuke2 = createObject ( 3865, nuke_beaconx + 0.072265, nuke_beacony + 0.013731, nuke_beaconz + 196.153122 ) nuke3 = createObject ( 1243, nuke_beaconx + 0.060547, nuke_beacony - 0.017578, nuke_beaconz + 189.075554 ) --The 3 objects that make the nucelar bomb are called nuke1, nuke2, and nuke3. Math is done to piece the --bomb together correctly at any given XYZ detonation coordinates. setObjectRotation ( nuke1, math.deg(0.245437), math.deg(0), math.deg(3.150001) ) setObjectRotation ( nuke2, math.deg(1.938950), math.deg(0), math.deg(-1.575) ) setObjectRotation ( nuke3, math.deg(-1.767145), math.deg(0), math.deg(0) ) --The objects must also be rotated after they are placed in the correct XYZ positions to get the bomb shape --I created in the map editor at any given XYZ beacon/detonation point. shotpath = nuke_beaconz - 200 moveObject ( nuke1, 5000, nuke_beaconx, nuke_beacony, shotpath, 259.9 ) --, 259 moveObject ( nuke2, 5000, nuke_beaconx + 0.072265, nuke_beacony + 0.013731, shotpath - 3.846878, 259.9 ) moveObject ( nuke3, 5000, nuke_beaconx + 0.060547, nuke_beacony - 0.017578, shotpath - 10.924446, 259.9 ) --To make all 3 pieces of the bomb stay together in the exact same shape, they must descend directly down. --nuke2 and nuke3 drop paths are altered slightly to be directly below their created positions in the air. end Create the imitation of a nuclear explosion function nukeExplosion () if nuke_explosionTimer == 0 then --We set this value when the script started. I do so I can keep looping through this function without --resetting it. setTimer ( "nukeExplosion", 170, 35 ) --Trigger this function to initiate 35 times in 170ms intervals. nuke_explosionTimer = 1 --Set the explosion timer flag to 1 so it is not done again with the looping (could have been true/false) else nuke_loops = nuke_loops + 1 --tells us how many times this function as been run through, which will be 35 in total. r = randInt(1.5, 4.5) --r will serve as our explosion radius. It can be a random value between 1.5 and 4.5 from the center of --the circle. The math for this is below. angleup = randInt(0, 35999)/100 --Choose a random angle. A value between 0 and 35999 is divided by 100 because we want --to have 2 random decimal places for as well, rather than just a whole integer. Explosionxcoord = r*math.cos(angleup) + nuke_beaconx Explosionycoord = r*math.sin(angleup) + nuke_beacony --The x and y coordinates of the explosion will occur at a max radius of 4.5 away from the nuke beacon, --in a circular shape. This is a fundamental, simple circle geometry formula. if nuke_loops == 1 then nuke_nukeCloud = nuke_beaconz createExplosion ( Explosionxcoord, Explosionycoord, nuke_nukeCloud, 7 ) elseif nuke_loops == 2 then nuke_nukeCloud = nuke_beaconz + 4 createExplosion ( Explosionxcoord, Explosionycoord, nuke_nukeCloud, 7 ) --Up until 20 loops, a pillar of explosions is created with the above. 7 is the explosion type, --which is tied with a couple others as the largest. 7 is a aircraft explosion. elseif nuke_loops > 20 then nuke_cloudRotationAngle = nuke_cloudRotationAngle + 22.5 if nuke_explosionLimiter == false then nuke_cloudRadius = 7 Explosionxcoord = nuke_cloudRadius*math.cos(nuke_cloudRotationAngle) + nuke_beaconx Explosionycoord = nuke_cloudRadius*math.sin(nuke_cloudRotationAngle) + nuke_beacony createExplosion ( Explosionxcoord, Explosionycoord, nuke_nukeCloud, 7 ) nuke_explosionLimiter = true elseif nuke_explosionLimiter == true then nuke_explosionLimiter = false end nuke_cloudRadius2 = 16 Explosionxcoord2 = nuke_cloudRadius2*math.cos(nuke_cloudRotationAngle) + nuke_beaconx Explosionycoord2 = nuke_cloudRadius2*math.sin(nuke_cloudRotationAngle) + nuke_beacony createExplosion ( Explosionxcoord2, Explosionycoord2, nuke_nukeCloud, 7 ) else nuke_nukeCloud = nuke_nukeCloud + 4 createExplosion ( Explosionxcoord, Explosionycoord, nuke_nukeCloud, 7 ) end --Since explosions are pushed to the limit, I have to make sure I can use the maximum amount without --having explosions not appear. This required me to have the above explosions run every other time --to create a mushroom cloud inner part (a circular area defined above), while at the same time creating --an outter circle that also gave the look of a "full" mushroom cloud that won't have obvious visual holes. if nuke_loops == 1 then --On the first loop, the bright flare (as I call it, actually a corona marker), is created and --increases in size. nukeExplosionFlare = createMarker ( nuke_beaconx, nuke_beacony, nuke_beaconz, "corona", 0, 255, 255, 255, 255 ) --The flare has an inital size of 0, and the R, G, B colors are 255, making it white. nuke_flareSize = 0 setTimer ( "nukeFlareGrow", 1, 200 ) --On the first loop, set the nuke_flareSize varible to 0, which will dictate the flare (corona) size --in the nukeFlareGrow function below as it is looped. The timer initiates the function 200 times, --every 1ms (so it takes 1/5 of a second to loop 200 times, thus making the bright flare). elseif nuke_loops == 35 then nuke_explosionTimer = 0 setTimer ( "nukeFlareFade", 1, 200 ) nuke_loops = 0 end --When this function has looped 35 times, the nuke has finished exploding and the flare must begin --fading to look like it disappears naturally. Nuke loops is reset for the next nuke launch. end end function nukeFlareGrow () setMarkerSize ( nukeExplosionFlare, nuke_flareSize ) nuke_flareSize = nuke_flareSize + 1 if nuke_flareSize == 200 then destroyElement ( nuke1 ) destroyElement ( nuke2 ) destroyElement ( nuke3 ) end --The flare becomes +1 larger on each loop, and the nuke is destroyed when the flare reaches maximum --size. It is triggered here as this is the point where it is safest to assume the objects are out --of site. end function nukeFlareFade () nuke_flareSize = nuke_flareSize - 1 setMarkerSize ( nukeExplosionFlare, nuke_flareSize ) if nuke_flareSize == 0 then destroyElement ( nukeExplosionFlare ) nuke_cannonActivated = false end --Each time the function loops, the flare gets -1 smaller. When it has a size of 0 and becomes invisible, --it needs to be deleted for the next nuke launch. No elements should stay created as they will pile up and --eventually crash you or the server. Finally, nuke_cannonActivated is false, meaning the nuke is inactive --and another weapon use can be performed. end
  22. NOTICE: THIS SCRIPT IS OUTDATED FROM THE CURRENT SCRIPTING SYSTEM. https://community.multitheftauto.com/index.php?p= ... ails&id=71 Tutorial 8a: Ion Cannon :!: :!: :!: :!: :!: :!: :!: :!: :!: :!: Start defining varibles, including a players array root = getRootElement () players = {} outputChatBox ( "Ion cannon by Ransom" ) ion_rotx = 0 ion_loops = 0 ion_explosionTimer = 0 ion_cannonActivated = false ion_cancelActivation = false ion_beamSize = 5 ion_beamFlareSize = 5 players = getElementsByType ( "player" ) Give all players on the server access to the weapons addEventHandler ( "onResourceStart", root, "ResourceStartIonCannon" ) function ResourceStartIonCannon ( name, root ) if name ~= getThisResource() then return end for k,v in players do -- for all players in the "players" array bindKey ( v, "f", "down", "placeIonCannonBeacon" ) -- bind the key f for triggering the ion cannon end end addEventHandler ( "onPlayerJoin", root, "ionPlayerJoin" ) function ionPlayerJoin () bindKey ( source, "f", "down", "placeIonCannonBeacon" ) --if a player joins after the resource loaded, bind their f key to trigger the ion cannon also end When the ion cannon key (f) is pressed, show the mouse cursor that will allow the triggering of the onPlayerClick function function placeIonCannonBeacon ( player, key, state ) if ( ion_cannonActivated == false ) and ( ion_cancelActivation == false ) and ( nuke_cancelActivation == false ) and ( nuke_cannonActivated == false ) then --These conditions prevent triggering the same weapon twice or triggering the other weapon at the same time. --Both weapons cannot be triggered because explosions are stretched to the limit, explosions would be random defineLaunchType = key --This is used later on the onPlayerClick function to tell it what weapon to launch showCursor ( player, true ) ion_cancelActivation = true else if ion_cancelActivation == true then showCursor ( player, false ) end --Prevents cursor from getting messed up if cursor is show for f or g and the opposite key is hit ion_cancelActivation = false --ion_cancelactivation is true when the cursor is showing. This is necessary along with asking if the actual --weapon is active to prevent problems with the cursor and weapon activation between both weapons and themselves if ion_cannonActivated == true then outputChatBox ( "Ion cannon has already been activated", activator ) else outputChatBox ( "Cannot activate ion cannon and nuke at the same time", activator ) end --This statement says that if the ion cannon is already in use, display a meassage about it being in --use on f press. Else, if the above conditions were not satisifed and the nuke is not active, it meant --the ion cannon was active. Therefore, display the other message that both weapons cannot be used at --the same time. end end When the player clicks the mouse cursor, decide if the ion cannon is supposed to be launched and if so, set up the launch addEventHandler ( "onPlayerClick", root, "playerClick" ) function playerClick ( button, state, clickedElement, x, y, z ) if defineLaunchType == "f" then --If the player clicked, we check if the key is equal to f or g. This will dictate which onPlayerClick function --commences between the ion cannon and nuke scripts ion_cancelActivation = false --Since the weapon is now in use, you have no chance to abort by pressing the key again, therefore this is false defineLaunchType = nil --This must be reset to nil so it will not fire the ion cannon next time on click if g was pressed instead of f --(which triggers nuke) ion_beaconx = x ion_beacony = y ion_beaconz = z --Set the ion cannon beacon (detonation spot) coordinates to the spot the mouse cursor clicked on the game map local playerz, playerz, playerz = getElementPosition ( source ) --For the above line, getElementPosition outputs 3 varibles, but I only want z so I overwrote 1 varible called --playerz as the function went through and assigned the XYZ values to varible x, varible y, and varible z --respectively. if ( button == "left" ) and ( state == "down" ) and ( ion_cannonActivated == false ) then --When the left mouse button is pressed down (not when released), if ion cannon is not active then ion_cannonActivated = true --Set this varible to true, which will be used to avoid double launches & double weapon usage showCursor ( source, false ) --Weapon beacon was chosen and the launch is initiating to that point. Hide cursor. ionBeam = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "checkpoint", 5, 255, 255, 255, 255 ) ionBeam2 = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "checkpoint", 5, 255, 255, 255, 255 ) ionBeam3 = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "checkpoint", 5, 255, 255, 255, 255 ) ionSecondaryBeam = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "checkpoint", 5, 255, 255, 255, 255 ) ionSecondaryBeam2 = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "checkpoint", 5, 255, 255, 255, 255 ) ionSecondaryBeam3 = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "checkpoint", 5, 255, 255, 255, 255 ) ionBeamFlare = createMarker ( ion_beaconx, ion_beacony, ion_beaconz, "corona", 5, 255, 255, 255, 255 ) --create six markers at the beacon point. The marker checkpoint will extend into the sky, but will end --at the given z. 6 markers are used to ensure the beam looks full as I rapidly delete and recreate the --markers in the next functions. setTimer ( "ionExplosion", 50, 1 ) setTimer ( "ionShot", 100, 20 ) setTimer ( "ionShot2", 150, 20 ) --Trigger the functions that will create the ion cannon shot and explosion imitation. 50ms 1 time, 100ms --20 times, and 150ms 20 times respectively. else ion_activator = getPlayerFromNick ( source ) showCursor ( source, false ) --Makes sure the cursor will not show again for detonation unless the ion cannon is not active. --Activator is used to display output messages in the other functions that activations/launches --arent possible. end end end Create the illusion of a beam coming from space and gradually increasing in size (beam strike power) function ionShot () ion_beamSize = ion_beamSize + 1 setMarkerSize ( ionBeam, ion_beamSize ) setMarkerSize ( ionBeam2, ion_beamSize ) setMarkerSize ( ionBeam3, ion_beamSize ) if ( ion_beamSize == 6 ) then setTimer ( "ionShotFlare", 3, 150 ) end --The first 3 markers making the ion beam are gradually increased at +10 in 1 second. When the function has --looped 6 times (6/10 of a second), the flare (again, its a corona marker but I call it a flare) grow --function is triggered. end function ionShot2 () setMarkerSize ( ionSecondaryBeam, ion_beamSize ) setMarkerSize ( ionSecondaryBeam2, ion_beamSize ) setMarkerSize ( ionSecondaryBeam3, ion_beamSize ) --These beams increase at a different rate, since beamSize is changing more rapidly in the ionShot function. --They stay a little smaller than the main 3 markers and assist the "grow" look while keeping the beam visible --while the markers change size. end function ionShotFlare () ion_beamFlareSize = ion_beamFlareSize + 1 setMarkerSize ( ionBeamFlare, ion_beamFlareSize ) --Every 3ms for 150 loops, the flare size increases. This makes a large glow that appears to be caused by the --beam's light end function ionExplosion () if ion_explosionTimer == 0 then --We set this value when the script started. I do so I can keep looping through this function without --resetting it. setTimer ( "ionExplosion", 170, 18 ) --Trigger this function to initiate 18 times in 170ms intervals. ion_explosionTimer = 1 --Set the explosion timer flag to 1 so it is not done again with the looping (could have been true/false) else r = ion_beamSize --min/max blast radius: 1.5-28 --r will serve as our explosion radius. For the ion cannon, the explosions coming from the ion cannon --will gradually increase distance from the center point in a circular motion, since I defined r as --ion_beamSize, which is gradully increasing in size in the ionShot function at the same time. angleup = randInt(0, 35999)/100 --Choose a random angle. A value between 0 and 35999 is divided by 100 because we want --to have 2 random decimal places for as well, rather than just a whole integer. explosionxcoord = r*math.cos(angleup) + ion_beaconx explosionycoord = r*math.sin(angleup) + ion_beacony --The x and y coordinates of the explosion will occur at a max radius of r away from the nuke beacon, --in a circular shape. This is a fundamental, simple circle geometry formula. createExplosion ( explosionxcoord, explosionycoord, ion_beaconz, 7 ) --An explosion of type 7 is created, which is the tied as the largest with some others it is --an aircraft explosion. ion_loops = ion_loops + 1 if ion_loops == 16 then --on the 16th loop of this function ion_beamFlareSize = 200 --This triggers the flare to grow +50 immediately right as the beam is ending to create a little --larger flash, just for effect as the beam is done setTimer ( "ionFlareFade", 5, 200 ) --The flarefade function is set to occur 200 times at 5ms to set the flare size to 0 quickly, as --the beam has disappeared elseif ion_loops == 18 then --on the 18th loop of this function ion_explosionTimer = 0 --Set the explosion timer to 0 for the next ion cannon launch, since this is the last loop ion_loops = 0 --Set to 0 to trigger these events directly above on next ion cannon launch as well ion_beamSize = 5 --Set to 0 to trigger the functions properly on the next ion cannon launch destroyElement ( ionBeam ) destroyElement ( ionSecondaryBeam ) destroyElement ( ionBeam2 ) destroyElement ( ionSecondaryBeam2 ) destroyElement ( ionBeam3 ) destroyElement ( ionSecondaryBeam3 ) --Destroy all the created checkpoint marker elements that made the beam end end end function ionFlareFade () setMarkerSize ( ionBeamFlare, ion_beamFlareSize ) ion_beamFlareSize = ion_beamFlareSize - 1 if ion_beamFlareSize == 0 then destroyElement ( ionBeamFlare ) ion_cannonActivated = false ion_beamFlareSize = 5 end --Each time the function loops, the flare gets -1 smaller. When it has a size of 0 and becomes invisible, it needs --to be deleted for the next ion cannon launch. No elements should stay created as they will pile up and eventually --crash you or the server. Finally, ion_cannonActivated is false, meaning the ion cannon is inactive and another --weapon use can be performed. end
×
×
  • Create New...