convert from t2 to t1 please

GPC1 script programming for Titan One. Code examples, questions, requests.

convert from t2 to t1 please

Postby DemonicMods » Wed Dec 12, 2018 6:00 am

I need this converted to t1 if anyone could help me.


Code: Select all
#pragma METAINFO("Red Dead Redemption AutoFish", 1, 09, "leonardofelin")
// Fishing reel based off bonefisher's code
// viewtopic.php?f=26&t=7743&wpureload=1#p56931
// Several ideas from Sillyasskid
 
// Rotation Adjustments
#define CIRCLE_RADIUS        100.0
#define CIRCLE_STEP            .05
#define CIRCLE_SPEED_RL        15
#define CIRCLE_SPEED_RI        1
 
fix32 angle;
 
main {
 
    bool fishing;
    bool cast;
    bool reeling;
    bool hooked;
 
    // Check if the player equipped the fishing rod for fishing - START FISHING
    if(    (get_val(STICK_1_X) > 45.0) &&
        (get_val(STICK_1_Y) > 45.0) &&
        (get_val(STICK_1_X) < 95.0) &&
        (get_val(STICK_1_Y) < 95.0) &&
        (time_active(BUTTON_4) > 500) &&
        (time_active(BUTTON_4) < 3000) &&
        (time_active(BUTTON_7) > 500) &&
        (event_release(BUTTON_7))) {
//        ffb_set(FFB_1, 100.0, 800);
        fishing = TRUE;
    }
 
    // If the player taps LB/L1, fishing rod is stored back - END FISHING
    if(fishing && event_release(BUTTON_7) && time_active(BUTTON_7) < 150 ||
        // If for any reason you need to reset, double tap LB/L1
        event_active(BUTTON_7) && time_release(BUTTON_7) < 100)    {
//        ffb_set(FFB_1, 50.0, 400);
        fishing = FALSE;
        cast = FALSE;
        reeling = FALSE;
        hooked = FALSE;
        combo_stop(LureFish);
        combo_stop(PullRod);
        combo_stop(FightFish);
    }
 
 
    // If the player is fishing, check for cast
    if(fishing) {
        // Check if the player has cast the line
        if(!cast && is_active(BUTTON_8) && event_release(BUTTON_5)) {
            cast = TRUE;
        }
 
        // Now the script takes over
 
        // Slowly reel the lure until a fish bites
        if((time_release(BUTTON_5) > 4000) && cast && !hooked && (ffb_get_actual(FFB_1, 0) == 0.0)) {
            set_val(BUTTON_8, 100.0);
            set_val(STICK_1_X, CIRCLE_RADIUS * cos(angle));
            set_val(STICK_1_Y, CIRCLE_RADIUS * sin(angle));
            combo_run(AutoCircle_RL);
            combo_run(LureFish);
            reeling = TRUE;
        }
 
        // Checks for a fish bite and hooks it
        if(reeling && (ffb_get_actual(FFB_1, 0) > 25.0)) {
            combo_stop(LureFish);
            combo_run(HookFish);
            hooked = TRUE;
            reeling = FALSE;
        }
 
        // If the fish isn't fighting, reel in
        if(hooked && (ffb_get_actual(FFB_1, 0) == 0.0)) {
            set_val(BUTTON_8, 100.0);
            set_val(STICK_1_X, CIRCLE_RADIUS * cos(angle));
            set_val(STICK_1_Y, CIRCLE_RADIUS * sin(angle));
            combo_stop(FightFish);
            combo_run(AutoCircle_RI);
            combo_run(PullRod);
        }
 
        // If fish is fighting, move the rod to fight back
        if(hooked && (ffb_get_actual(FFB_1, 0) > 50.0)) {
            combo_stop(PullRod);
            combo_run(FightFish);
        }
 
        // You can still manually use the stick to fight/guide the
        // fish towards you at any time.
        if(is_active(STICK_2_X) || is_active(STICK_2_Y)) {
            combo_stop(FightFish);
            set_val(STICK_2_X, get_actual(STICK_2_X));
            set_val(STICK_2_Y, get_actual(STICK_2_Y));
        }
 
 
        // If the player resets the cast, stores the fish, or throws it back,
        // reset variables to restart fishing
        if(event_active(BUTTON_15) || event_active(BUTTON_16)) {
            cast = FALSE;
            reeling = FALSE;
            hooked = FALSE;
            combo_stop(LureFish);
            combo_stop(PullRod);
            combo_stop(FightFish);
        }
 
    }
 
}
 
combo AutoCircle_RI {
    wait(CIRCLE_SPEED_RI);
    angle = mod(angle + CIRCLE_STEP, 2.0 * PI);
}
 
combo AutoCircle_RL {
    wait(CIRCLE_SPEED_RL);
    angle = mod(angle + CIRCLE_STEP, 2.0 * PI);
}
 
combo PullRod {
    set_val(STICK_2_Y, -100.00);
    wait(1000);
    set_val(STICK_2_Y, 100.00);
    wait(1000);
}
 
combo FightFish {
    set_val(STICK_2_X, 100);
    wait(1500);
    set_val(STICK_2_X, -100);
    wait(1500);
}
 
combo HookFish {
    set_val(BUTTON_5, 100.0);
    wait(300);
    set_val(BUTTON_5, 0.0);
}
 
combo LureFish {
    wait(10000);
    set_val(BUTTON_5, 100.0);
    wait(100);
    set_val(BUTTON_5, 0.0);
}
User avatar
DemonicMods
Staff Sergeant
Staff Sergeant
 
Posts: 10
Joined: Wed Oct 11, 2017 2:22 am

Re: convert from t2 to t1 please

Postby J2Kbr » Wed Dec 12, 2018 7:50 am

This script makes use of trigonometric functions (sin, cos) and number with decimal that are not available on the Titan One. Unfortunately it can't be converted.
ConsoleTuner Support Team
User avatar
J2Kbr
General of the Army
General of the Army
 
Posts: 20323
Joined: Tue Mar 18, 2014 1:39 pm


Return to GPC1 Script Programming

Who is online

Users browsing this forum: No registered users and 91 guests

cron