Skip to content

Instantly share code, notes, and snippets.

@JuniorDjjr
Created March 24, 2022 22:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JuniorDjjr/ecb69a11ce8777c8b31458d8663c8be1 to your computer and use it in GitHub Desktop.
Save JuniorDjjr/ecb69a11ce8777c8b31458d8663c8be1 to your computer and use it in GitHub Desktop.
// by Junior_Djjr - MixMods.com.br
// You need: https://forum.mixmods.com.br/f141-gta3script-cleo/t5206-como-criar-scripts-com-cleoplus
SCRIPT_START
{
LVAR_INT hBlimp hBlimpLod i iDest bBlimpEnabled iModelId iModelIdLod
LVAR_FLOAT x y z a oldX oldY oldZ oldA destX destY destZ destA fProgress fSpeed f
WAIT 550
GET_MODEL_BY_NAME "animatedblimp" iModelId
GET_MODEL_BY_NAME "lodanimatedblimp" iModelIdLod
IF iModelId <= 0
OR iModelIdLod <= 0
PRINT_STRING_NOW "~r~Error: animatedblimp or lodanimatedblimp isn't installed." 6000
TERMINATE_THIS_CUSTOM_SCRIPT
ENDIF
GET_CURRENT_DAY_OF_WEEK iDest
GOSUB GetNewDest
++iDest
GOSUB GetNewDest
WHILE TRUE
WAIT 0
IF LOCATE_CAMERA_DISTANCE_TO_COORDINATES 1612.2498 -1420.1288 183.0222 1500.0
REQUEST_MODEL iModelIdLod
WHILE NOT HAS_MODEL_LOADED iModelIdLod
WAIT 0
ENDWHILE
CREATE_OBJECT_NO_SAVE iModelId destX destY destZ FALSE FALSE (hBlimp)
CREATE_OBJECT_NO_SAVE iModelIdLod destX destY destZ FALSE FALSE (hBlimpLod)
CONNECT_LODS hBlimp hBlimpLod
bBlimpEnabled = TRUE
WHILE LOCATE_CAMERA_DISTANCE_TO_COORDINATES 1612.2498 -1420.1288 183.0222 1500.0
WAIT 0
GOSUB ProcessMove
ENDWHILE
DELETE_OBJECT hBlimp
DELETE_OBJECT hBlimpLod
MARK_MODEL_AS_NO_LONGER_NEEDED iModelIdLod
ENDIF
ENDWHILE
ProcessMove:
LERP oldX destX fProgress (x)
LERP oldY destY fProgress (y)
LERP oldZ destZ fProgress (z)
LERP oldA destA fProgress (a)
//PRINT_FORMATTED_NOW "%i %.3f" 100 iDest fSpeed
SET_OBJECT_COORDINATES hBlimp x y z
SET_OBJECT_COORDINATES hBlimpLod x y z
a += 180.0
SET_OBJECT_HEADING hBlimp a
SET_OBJECT_HEADING hBlimpLod a
fProgress +=@ fSpeed
IF fProgress >= 1.0
++iDest
fProgress = 0.0
GOSUB GetNewDest
ENDIF
RETURN
GetNewDest:
IF iDest < 0
iDest = 6
ENDIF
IF iDest > 6
iDest = 0
ENDIF
oldX = destX
oldY = destY
oldZ = destZ
oldA = destA
SWITCH iDest
CASE 0
destX = 1612.2498
destY = -1420.1288
destZ = 183.0222
oldA = -90.0 // fix transition from old 270.0
destA = 0.0
BREAK
CASE 1
destX = 1626.36
destY = -1200.7993
destZ = 185.8647
destA = 0.0
BREAK
CASE 2
destX = 1588.8685
destY = -1160.5996
destZ = 180.8885
destA = 90.0
BREAK
CASE 3
destX = 1525.7007
destY = -1150.9188
destZ = 185.6894
destA = 120.0
BREAK
CASE 4
destX = 1500.0204
destY = -1240.9677
destZ = 195.7565
destA = 170.0
BREAK
CASE 5
destX = 1490.7552
destY = -1355.7512
destZ = 195.7565
destA = 180.0
BREAK
CASE 6
destX = 1527.6982
destY = -1430.453
destZ = 185.7739
destA = 270.0
BREAK
ENDSWITCH
GET_DISTANCE_BETWEEN_COORDS_3D oldX oldY oldZ destX destY destZ (f)
f /= 500.0
fSpeed = 1.0 - f
fSpeed *= 0.001
RETURN
}
SCRIPT_END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment