02.02.2014, 20:09
(
Последний раз редактировалось ACI; 01.03.2014 в 19:21.
Причина: Updated to v0.3
)
Meteor system
-
Script "meteors" easily!
0.2 → Beta
Introduction-
Script "meteors" easily!
0.2 → Beta
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;
}
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;
}
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