[Include] EngineX (Aircrafts manipulation)
#1

Hello, I would like to present EngineX.
This mechanism was created to manipulate objects automatically planes.

Video:
EngineX v6.0 (ColAndreas Precision)
EngineX v5.0 (Full Presentation) Presentation starts at 03:10

Mechanism contains the following instructions manipulate objects:
Код:
ENGINE_NORMAL 		//[Object: 1681, 18846 OR ANY] 		|| 6.0 X
ENGINE_FIGHTER		//[Object: 10757]			|| 6.0 X
ENGINE_SUPPLY		//[Object: 1683, 3528]			|| 6.0 X
ENGINE_NGCMS		//[N/A] (Only NGCM)			|| 4.0 X
ENGINE_ARCMS		//[N/A] (Only NGCM)			|| 4.0 X
ENGINE_COMMANDER	//[N/A] (Only NGCM)			|| 4.0 X
ENGINE_ELITE		//[Object: 14553] 			|| 6.0 X
ENGINE_UBOOT		//[Object: 9958]			|| 6.0 X
ENGINE_SHIP		//[Object: 8493]			|| 6.0 CA
ENGINE_MINI		//[Object: 2510, 2512]			|| 6.0 X
ENGINE_EXCAVATOR	//[Object: 18248]			|| 4.1 G (Ground)
ENGINE_UNDERDUDE	//[Object: 1379]			|| 6.0 U (Underwater)
Delta/Epsilon Engine Rotation Speed:
Код:
DELTA_ENGINE_SPEED_NORMAL 		(0.050)
DELTA_ENGINE_SPEED_FIGHTER		(0.050)
DELTA_ENGINE_SPEED_SUPPLY		(0.020)
DELTA_ENGINE_SPEED_NGCMS		(0.050)
DELTA_ENGINE_SPEED_ARCMS		(0.050)
DELTA_ENGINE_SPEED_COMMANDER		(0.050)
DELTA_ENGINE_SPEED_ELITE		(0.010)
DELTA_ENGINE_SPEED_UBOOT		(0.005)
DELTA_ENGINE_SPEED_SHIP			(0.050)
DELTA_ENGINE_SPEED_MINI			(0.050)
DELTA_ENGINE_SPEED_EXCAVATOR		(0.001)
DELTA_ENGINE_SPEED_UNDERDUDE		(0.050)
Functions v4.0 and v5.0:
PHP код:
//Function execution for Engine 4.0 during 0.5 seconds
EngineX(objectid,areaid,engineid,minradius,maxradius,Float:minz,Float:speed);
//Function execution for Engine 5.0 X during 0.5 seconds
//Performing for the change when the object does not move
//step 1
DeltaEngineRotation(objectid,engineid,Float:speed 0.05);
//step 2
DeltaEngineX(objectid,areaid,engineid,minradius,maxradius,Float:minz,Float:speed); 
Example:
PHP код:
//every 0.5 seconds
public DefenseHulkUpdate(mobid){
    if(
DefenseHulkStatus[mobid] == (1)){
        
EngineX(DefenseHulk[mobid][22],DefenseHulk[mobid][0],ENGINE_NORMAL,50,200,25,MOB_SPEED_SLOW);
    }
    return 
1;
}
//every 0.5 seconds
public FighterUpdate(mobid){
    if(
NGCFighter[mobid][2] == 1){
        if(!
IsDynamicObjectMoving(NGCFighter[mobid][0])){
            if(
NGCFighter[mobid][3] == 0){
                
DeltaEngineRotation(NGCFighter[mobid][0],ENGINE_FIGHTER);
                
NGCFighter[mobid][3] = 1;
            } else {
                
DeltaEngineX(NGCFighter[mobid][0],NGCFighter[mobid][1],ENGINE_FIGHTER,50,100,5,MOB_SPEED_NORMAL);
                
NGCFighter[mobid][3] = 0;
            }
        }
    }
    return 
1;
}
//every 0.5 seconds
public ExcavatorUpdate(mobid){
    if(
NGCExcavator[mobid][2] == 1){
        
EngineX(NGCExcavator[mobid][0],NGCExcavator[mobid][1],ENGINE_EXCAVATOR,50,100,1.0,MOB_SPEED_SLOW);
        
EngineExcavatorUpdate(NGCExcavator[mobid][0],NGCExcavator[mobid][1],ENGINE_EXCAVATOR,MOB_SPEED_SLOW);        
    }
    return 
1;

Functions v6.0:
PHP код:
//Function execution for Engine 6.0 CA during 0.5 seconds
EngineXCA(objectid,areaid,EngineX:engineid,minradius,maxradius,Float:minz,Float:speed,Float:cut_size=5.0);
//Function execution for Engine 6.0 X during 0.5 seconds
//Performing for the change when the object does not move
//step 1
EpsilonEngineRotation(objectid,engineid,Float:speed 0.05);
//step 2
EpsilonEngineX(objectid,areaid,engineid,minradius,maxradius,Float:minz,Float:speed,Float:cut_size=5.0); 
Example:
PHP код:
//every 0.5 seconds
public DefenseHulkUpdate(mobid){
    if(
DefenseHulkStatus[mobid] == (1)){
        
EngineXCA(DefenseHulk[mobid][22],DefenseHulk[mobid][0],ENGINE_NORMAL,50,200,25,MOB_SPEED_SLOW);
    }
    return 
1;
}
//every 0.5 seconds
public FighterUpdate(mobid){
    if(
NGCFighter[mobid][2] == 1){
        if(!
IsDynamicObjectMoving(NGCFighter[mobid][0])){
            if(
NGCFighter[mobid][3] == 0){
                
EpsilonEngineRotation(NGCFighter[mobid][0],ENGINE_FIGHTER);
                
NGCFighter[mobid][3] = 1;
            } else {
                
EpsilonEngineX(NGCFighter[mobid][0],NGCFighter[mobid][1],ENGINE_FIGHTER,50,100,5,MOB_SPEED_NORMAL);
                
NGCFighter[mobid][3] = 0;
            }
        }
    }
    return 
1;
}
//every 0.5 seconds
public ExcavatorUpdate(mobid){
    if(
NGCExcavator[mobid][2] == 1){
        
EngineXCA(NGCExcavator[mobid][0],NGCExcavator[mobid][1],ENGINE_EXCAVATOR,50,100,1.0,MOB_SPEED_SLOW);
        
EngineExcavatorUpdate(NGCExcavator[mobid][0],NGCExcavator[mobid][1],ENGINE_EXCAVATOR,MOB_SPEED_SLOW);        
    }
    return 
1;

Here a sample script for Reaver Defense Hulk and 2 types of aircraft:
DefenseHulk.pwn
DefenseHulkV6.pwn

Download Include:
3DTryg.inc Thread
EngineV6.inc
EngineX.inc
ColAndreas (EngineV6)

YSF - kurta999's version:
https://sampforum.blast.hk/showthread.php?tid=513499

Notice:
Posts can be made available in a other language forums, please remember to keep the author and permanent link to file on github and a link to post in forum samp.
Reply
#2

Great release
Reply
#3

Good job 0.0
Reply
#4

Press F5 what is your upload/download rate using this? I also would think there is going to be a shit load of de-sync issues with this because the position of objects is going to be slightly different for every player. From my experience this is taken directly from the balloon script used on the DayZ server. I quickly discovered that the streamer updates way too slowly to stop and move the best way was to use regular objects. I also quickly discovered that you absolutely have to set the position to sync the position for players. You have a great idea but unfortunately I believe your expectations are WAY too high and you are sacrificing quality over quantity with likely shoddy results.

Код:
	switch(Balloons[balloonid][BALLOON_STATE])
			{
				case BALLOON_STATE_DOWN:
				{
					new Float:cz;
					CA_RayCastLine(x, y, z, x, y, z-1000.0, x, y, cz);

					if(z - cz < 3.5)
					{
						StopObject(Balloons[balloonid][BalloonObjectID]);
						GetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
						SetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
						Balloons[balloonid][BALLOON_STATE] = BALLOON_STATE_NONE;
	       				UpdateThrust(balloonid, "Landed");
					}
				}

				case BALLOON_STATE_FORWARD:
				{
					new Float:cx, Float:cy, Float:cz;
					GetPosInFrontOfObject(Balloons[balloonid][BalloonObjectID], 13.0, cx, cy, cz);
					GetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
					
					if(CA_RayCastLine(x, y, z, cx, cy, cz, cx, cy, cz))
					{
						StopObject(Balloons[balloonid][BalloonObjectID]);
						SetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
						Balloons[balloonid][BALLOON_STATE] = BALLOON_STATE_NONE;
						UpdateThrust(balloonid, "Blocked");
					}
				}

				case BALLOON_STATE_UPDATE_FORWARD:
				{

					new Float:cx, Float:cy, Float:cz;
					GetPosInFrontOfObject(Balloons[balloonid][BalloonObjectID], 13.0, cx, cy, cz);
					GetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
					
					if(!CA_RayCastLine(x, y, z, cx, cy, cz, cx, cy, cz))
					{
						StopObject(Balloons[balloonid][BalloonObjectID]);
						GetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
						SetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
	  					GetPosInFrontOfObject(Balloons[balloonid][BalloonObjectID], 6000.0, x, y, z);
						MoveObject(Balloons[balloonid][BalloonObjectID], x, y, z, BALLOON_FORWARD_SPEED);
						Balloons[balloonid][BALLOON_STATE] = BALLOON_STATE_FORWARD;
						UpdateThrust(balloonid, "Forward");
					}
					else
					{
						StopObject(Balloons[balloonid][BalloonObjectID]);
						GetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
						SetObjectPos(Balloons[balloonid][BalloonObjectID], x, y, z);
						Balloons[balloonid][BALLOON_STATE] = BALLOON_STATE_NONE;
						UpdateThrust(balloonid, "Blocked");
					}
				}
			}
		}
	}
}
Reply
#5

Navigation is written by me and not taken out of nowhere the idea LOL.
On this system i have 3000+ "NPC" and there is no synchronization problems.
Reply
#6

What the heck is that thing? Some alien defense or something?
Reply
#7

Quote:
Originally Posted by Kar
Посмотреть сообщение
What the heck is that thing? Some alien defense or something?
so alien
Reply
#8

Thanks ,
For Respond My PM Yesterday and Make This Include
Reply
#9

Quote:
Originally Posted by AbyssMorgan
Посмотреть сообщение
Navigation is written by me and not taken out of nowhere the idea LOL.
On this system i have 3000+ "NPC" and there is no synchronization problems.
he said HIS code was taken from the balloon script... Cool idea though
Reply
#10

This would we good for server events...
Reply
#11

added support for objectid 18248 ENGINE_EXCAVATOR, and define the default speed for the DeltaEngineRotation
Reply
#12

Update v5.1.24:
- Fix Init Hook
Reply
#13

Update EngineV6:

- Added functions
PHP код:
//Epsilon Engine X Functions:
EpsilonEngineRotation(objectid,EngineX:engineid,Float:speed 0.05); //the same as DeltaEngineRotation
EpsilonEngineX(objectid,areaid,EngineX:engineid,minradius,maxradius,Float:minz,Float:speed,Float:cut_size=5.0);
EngineXCA(objectid,areaid,EngineX:engineid,minradius,maxradius,Float:minz,Float:speed,Float:cut_size=5.0); 
- Used ColAndreas precision
- Introduced detection underwater area for ENGINE_UNDERDUDE
Reply
#14

pretty good effort 5 star from me
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)