1 июля 2017 г.

Speed effects

Скрипт добавляет парочку эффектов скорости: небольшое шатание камеры и изменение яркости.


/* Made by Vital */
//$PLAYER_ACTOR $PLAYER_GROUP $ONMISSION
//Byte, Char – 1; Short, Word – 2; Long, DWord, Float – 4
{$CLEO}
0000:      
while true
wait 0
    if
    player.Defined(0)
    then
        if and
        actor.Driving($PLAYER_ACTOR)       
        89AE: not  actor $PLAYER_ACTOR driving_train
        then
        0@ = actor.CurrentCar($PLAYER_ACTOR)
        02E3: 1@ = car 0@ speed               
            if
            1@ > 0.0
            then           
            03F0: enable_text_draw 1
            0087: 2@ = 1@ // (float)
            0087: 3@ = 1@ // (float)
            0087: 4@ = 1@ // (float)
            1@ *= 2.0 //colour
            2@ *= 4.0 //alpha
            3@ /= 24.0 //shaking #1 (for cars, bikes...)
            0AEE: 3@ = 3@ exp 2.5 //thanks for help to Emissary
            4@ /= 33.3 //shaking #2 (for aircraft)
            0092: 1@ = float 1@ to_integer
            0092: 2@ = float 2@ to_integer
                if //max colour
                1@ > 128
                then
                1@ = 128
                end
                if //max alpha
                2@ > 50
                then
                2@ = 50
                end
                if //max jiggle (cars)
                3@ > 2.7
                then
                3@ = 2.7
                end
                if //max jiggle (planes/helicopters)
                4@ > 1.5
                then
                4@ = 1.5
                end

                if
                84C8: not  actor $PLAYER_ACTOR driving_flying_vehicle
                then
                038E: draw_box_position 320.0 224.0 size 641.0 449.0 RGBA 1@ 1@ 1@ 2@
                099C: jiggle_camera type 1 timelimit 100.0 intensity 3@
                else
                099C: jiggle_camera type 1 timelimit 100.0 intensity 4@
                end
            end       
        end
    end
end


Комментариев нет: