[Include] Meteor system - A source based on scripting "meteors"! - (Recommended mostly for RP, and TDM servers)
#1

Meteor system
-
Script "meteors" easily!

0.2Beta
Introduction
I was really bored, so I asked my friend (Naruto Emillo) what should I script, then he gave me a challenging idea about making meteor system which no one has released yet (So I think I am the first one). So this is a source which is based on creating a meteor. Instead of writing a bunch of code, the user/programmer can easily use two functions to control the thing.

Functions
CreateMeteor(id, Float:X, Float:Y, Float:Z); - Used to create a meteor. Note that if you set the meteor's Z position near to the ground,it will appear near the land and will look un unrealistic - to deal with this, set the Z position to such a extent at which a client wont be able to see it from the ground. This function is also volatile, which means that if you use this functions multiple times with the same ID, you will face some bugs.

MeteorFall(id, Float:toX, Float:toY, Float:toZ, Float:Speed, ExplosionSwitch = -1); - If used, it will move the meteor to the specified position with the specified speed. It's recommended that you set the speed to 10, because that looks realistic. ExplosionSwitch is optional - You can set it to 1, 6 or anything else (See the Explosions List).

ScreenShots/Videos
Photos taken during testing the source (Pre-Alpha) & on release(Alpha)



-----------------------------

Photos taken in the Beta version of the source v0.2







The one who PMs me with a video regarding this will be given the position of a "Beta Tester"

A short tutorial
The one who PMs me with a nice example regarding this will be given the position of a "Beta Tester". (or might be made a developer)

pawn Код:
CMD:tp(playerid)
{
    // TP to the pos where the meteor will be.
    SetPlayerPos(playerid, -1861.5780,-2093.6182,58.4021);
    return 1;
}

CMD:cm(playerid)
{
    // Make a meteor, but wait for being called for landing
    // "+ 200" because it will be high from the ground
    CreateMeteor(1, -1861.5780,-2093.6182,58.4021 + 200);
    SC(playerid, -1, "Meteor created.");
    return 1;
}

CMD:stm(playerid)
{
    // Make the meteor to land at the pos given
    MeteorFall(1, -1740.8384,-2089.8804,39.7232 - 0.45, 30, 2);
    SC(playerid, -1, "WARNING: A METEOR IS ABOUT TO FALL!");
    return 1;
}
- WILL BE ADDED - PLEASE WAIT -

Bugs
* If you use CreateMeteor(...) multiple times but with same IDs, you will face some bugs. Same goes for MeteorFall(...)

- INVESTIGATIONS ARE CONTINUED -

Developers


ACI - Contact


You can join the project's development if you are suitable for it - for that, you will have to contact the initial developer ACI

Alpha testers & Beta testers

Alpha testers:

ACI - Contact - Alpha testing of version 0.1
- Positions of Alpha testers have been closed since the release of v0.2 [Beta]

Beta testers:

ACI - Contact - Beta testing of version 0.2

Source
NOTE: By using the source, you agree with the following:
* You wont complain if this harms your server or client or any other mode or any other code by anyway (This is provided "AS IS")
* You wont claim this as your own written source.
* You wont re-release this here, nor on other forums, nor on other languages board.

----------------------

You can add it directly to your mode, OR, make a separate include file (".inc") for this. Note that hooking the callback "OnObjectMoved" must be done manually if using in a include file.
pawn Код:
/*
native CreateMeteor(id, Float:X, Float:Y, Float:Z);
native MeteorFall(id, Float:toX, Float:toY, Float:toZ, Float:Speed, ExplosionSwitch = -1);
*/


enum E_MD
{
    Float:x,
    Float:y,
    Float:z,
    ID,
    Created,
    Check
}

new MDat_@d_@a[101][E_MD],
    midr,
    exi,
    Float:p[3],
    idc,
    void[2];

stock CreateMeteor(id,Float:X,Float:Y,Float:Z)
{
    midr++;
    MDat_@d_@a[midr][ID] = id;
    MDat_@d_@a[midr][x]  = X;
    MDat_@d_@a[midr][y]  = Y;
    MDat_@d_@a[midr][z]  = Z;
    MDat_@d_@a[midr][Created] = 1;
    MDat_@d_@a[midr][Check] = CreateObject(1303, X, Y, Z, 0,0,0);
    void[0] = CreateObject(18690, 0,0,-100,0,0,0);
    void[1] = CreateObject(2780, 0,0,-100,0,0,0,500.0);
    AttachObjectToObject(void[0], MDat_@d_@a[midr][Check],0,0,0,0,0,0);
    AttachObjectToObject(void[1], MDat_@d_@a[midr][Check],0,0,0,0,0,0);
    printf("METEOR CREATED - ID: %d", id);
    return MDat_@d_@a[midr][Created];
}

stock MeteorFall(id, Float:toX, Float:toY, Float:toZ, Float:Speed, ExplosionSwitch = -1)
{
    idc = id;
    MoveObject(MDat_@d_@a[id][Check], toX, toY, toZ, Speed);
    switch(ExplosionSwitch)
    {
        case 0..13:
        {
            GetObjectPos(MDat_@d_@a[id][Check], p[0], p[1], p[2]);
            exi = ExplosionSwitch;
        }
    }
    return 0;
}

forward @KillFireCat();
@KillFireCat()
{
    DestroyObject(void[0]);
    return 1;
}

public OnObjectMoved(objectid)
{
    if(objectid == MDat_@d_@a[idc][Check])
    {
        CreateExplosion(p[0], p[1], p[2], exi, 10.0);
        DestroyObject(void[1]);
        SetTimerEx("@KillFireCat", 6000, false, "");
    }
    return 1;
}
No links needed.

Development Log
Код:
[04/02/2014] - 12:00 PM - Updated the release to the beta version 0.2:
* Changed the object to bigger so that it looks like a real "huba meteor".
* Added a effect which leaves a white trail behind the meteor when it is moving (for realism). Note that the trail cannot be seen from a far place if the player has his objects render distance low (this is not a bug related to this release). It can be fixed by changing the display settings.
* Added a fire effect which ends up after 6 seconds when the meteor has landed on its coordinates

[03/02/2014] - 00:00 AM - Released the first alpha version 0.1
Reply
#2

Nice!!!!!!!
Reply
#3

Not bad!
Reply
#4

Thanks for saying my name, good job, you did it! +rep
Reply
#5

This is released as an include, so why don't you make it auto compatible? It would be better if you hook OnObjectMoved within the include.

Secondly, the MeteorFall could be improved further more if you're using MapAndreas as an optional system. So it determines the Z point and can conclude whether it's hitting a ground or not.

The include looks good. However, you can improve it more.
Reply
#6

PRE-ALPHA means the software is still in a planning and heavy development phase.

By releasing this it becomes automatically an ALPHA at least.
Reply
#7

Quote:

This is released as an include, so why don't you make it auto compatible? It would be better if you hook OnObjectMoved within the include.

Quote:

You can add it directly to your mode, OR, make a separate include file (".inc") for this. Note that hooking the callback "OnObjectMoved" must be done manually if using in a include file.

Quote:

Secondly, the MeteorFall could be improved further more if you're using MapAndreas as an optional system. So it determines the Z point and can conclude whether it's hitting a ground or not.

I am still looking on that. What if the user has a map/objects in the air? If it gets the Z point equal to what the user wants, then what will it do? Using this custom coordinates of the user will make it more easy and using this has no point.

Quote:

The include looks good. However, you can improve it more.

Thanks, will look onto future versions

Quote:

PRE-ALPHA means the software is still in a planning and heavy development phase.
By releasing this it becomes automatically an ALPHA at least.

This is the "Testing and developing period", it will soon become a stable version.
Reply
#8

Quote:
Originally Posted by ACI
Посмотреть сообщение
This is the "Testing and developing period", it will soon become a stable version.
You did not understand.

Quote:
Originally Posted by PRE-ALPHA
A development status given to a program or application that is usually not feature complete, and is not usually released to the public. Developers are usually still deciding on what features the program should have at this status. This status comes before the alpha version, and is the first status given to a program.
Reply
#9

So what should I do? I changed it already... Happy?
Reply
#10

You have any, any or any idea how huge meteorites are in real-life? And since when do meteorites cause explosions when they land on the earth?
Reply
#11

Quote:

You have any, any or any idea how huge meteorites are in real-life? And since when do meteorites cause explosions when they land on the earth?

What the heck? Those are asteroids! Why are you obsessive about real-life and the game? The player CAN edit the source to meet his personal needs! If no one wants explosions to be set, he can only use:

pawn Код:
MeteorFall(id, Float:toX, Float:toY, Float:toZ, Float:Speed); //Leaving the ExplosionSwitch
Edit: Using the default object can be considered as a "Hoba meteor" or smaller. There are many small meteorites in real life too.
Reply
#12

You wanted something challenging? Try making them fall in a curved path, such as a parabola, because currently it doesn't look realistic.
Nice work, anyway.
Reply
#13

Quote:
Originally Posted by wups
Посмотреть сообщение
You wanted something challenging? Try making them fall in a curved path, such as a parabola, because currently it doesn't look realistic.
Nice work, anyway.
If you're going to try to make it realistic, why not add atmospheric entry effects and atmospheric drag as well?
Reply
#14

I like this idea good work man, rep +
Reply
#15

@ wups - Thanks for advising but this was meant to look like this:

https://www.youtube.com/watch?v=dpmXyJrs7iU

@ Hiddos - Thanks for advising, will look onto future versions.

@ Don_Cage - Thank you

Updated the release to v0.2 - added more features.
Reply
#16

Fucking incredible, Great job man - +1 Rep
Reply
#17

The alpha object is better.
Reply
#18

nice :3
Reply
#19

i dont think a real meteor will bounce once it hits the ground.
ot: nice script. but the meteor is too small
Reply
#20

@ Kar - Depends on what the user/programmer wants, he can change it to whatever he wants.
@ Tamao - Thanks
@ noob - Thanks - I actually changed the object because the object in the alpha was a small object than the object I added in the beta version - the object added in the beta version could be considered as a "huba meteor". There are also small meteors discovered in real world too. The user/programmer can also change what he want to suit his needs.
Reply


Forum Jump:


Users browsing this thread: 6 Guest(s)