Coder Social home page Coder Social logo

Comments (7)

x87 avatar x87 commented on August 20, 2024 1

Delete ZMenuVC or make it so its ASI file loads BEFORE cleo_redux.asi. ZMenu overwrites hooks in CText::Get and does not call them back

from cleo-redux.

strejda603 avatar strejda603 commented on August 20, 2024 1

Thank you for your help! I renamed "ZMenuVC.asi" to "1ZMenuVC.asi" to load before CLEO Redux, and it works great.

from cleo-redux.

x87 avatar x87 commented on August 20, 2024

Can you provide more details? What game? Show code and cleo_redux.log

from cleo-redux.

strejda603 avatar strejda603 commented on August 20, 2024

Can you provide more details? What game? Show code and cleo_redux.log

Sure, sorry, my bad... It's GTA Vice City (Classic) and I use CLEO Redux (v1.2.1) coexisting with Standard CLEO (v2.0.0.6).. My cleo_redux.log shows nothing wrong...

Here is my code:

/// <reference path=".config/vc.d.ts" />
/**
 *  AUTHOR: strejda603
 *  DATE: 19.07.2023
 */

import { KeyCode } from "./.config/enums";
import { atFeet } from "./includes/functions";

if (HOST !== "vc" && HOST !== "reVC") {
  exit("Sorry, this script is for GTA VC only");
}

let player = new Player(0);

/* Locations */
const oceanHotel = { x: 230.93, y: -1302.19, z: 10.0, r: 1.0 };
const malibu = { x: 498.33, y: -112.99, z: 10.0419, r: 1.0 };
const marina = { x: -173.788, y: -1431.45, z: 10.0419, r: 1.0 };
const washPetrolNext = { x: 73.7581, y: -1120.41, z: 10.0419, r: 1.0 };
const nbTools = { x: 209.124, y: -459.234, z: 11.2419, r: 1.0 };
const cherryPoppers = { x: -857.876, y: -526.834, z: 10.5419, r: 1.0 };
const haitiPnS = { x: -813.366, y: -23.8005, z: 10.2671, r: 1.0 };
const bikersBar = { x: -547.466, y: 679.4, z: 10.2671, r: 1.0 };
const crocsBar = { x: -1086.782, y: 127.561, z: 11.2731, r: 1.0 };
const washShop = { x: 139.7062, y: -904.8914, z: 10.556, r: 1.0 };
const washPetrolShop = {
  x: 48.523,
  y: -1078.4673,
  z: 10.4633,
  r: { x: 2.0, y: 2.0, z: 1.0 },
};

main: while (true) {
  wait(100);

  let currentMoney = player.storeScore();
  let deposit = 0;

  /* I was testing to "inject" strings directly, but it doesn't work either */
  // FxtStore.insert(
  //   "atm1",
  //   "~h~Press the ~k~~PED_ANSWER_PHONE~ to deposit money in the bank."
  // );
  // FxtStore.insert("atm2", "Money is transfering. Please wait.");
  // FxtStore.insert(
  //   "atm3",
  //   "You have taken all the money from the bank, transaction costs have been decreased and interest is received."
  // );
  // FxtStore.insert(
  //   "atm4",
  //   "Money is in the bank. You can come and take it whenever you want."
  // );

  if (player.isPlaying() && !ONMISSION) {
    wait(50);

    if (
      (atFeet(player, oceanHotel) ||
        atFeet(player, malibu) ||
        atFeet(player, marina) ||
        atFeet(player, washPetrolNext) ||
        atFeet(player, nbTools) ||
        atFeet(player, cherryPoppers) ||
        atFeet(player, haitiPnS) ||
        atFeet(player, bikersBar) ||
        atFeet(player, crocsBar) ||
        atFeet(player, washShop) ||
        atFeet(player, washPetrolShop)) &&
      currentMoney > 19
    ) {
/*******************************************************************************/
      Text.PrintNow("bnkng1", 5000, 1); // doesn't show (used to work in 1.2.0) - depends on "banking.fxt", which loads fine according to logs
      // Text.PrintNow("atm1", 5000, 1); // doesn't show either
      // Text.PrintNow("ROCK_4", 5000, 1); // works
/*******************************************************************************/

      while (true) {
        wait(0);

        if (Pad.IsButtonPressed(0, 4)) {
          player.setControl(false);
          getHelp();

          while (true) {
            wait(50);

            // increase
            if (
              Pad.IsButtonPressed(0, 15) &&
              currentMoney > 19
              // && deposit < 99999
            ) {
              if (Pad.IsButtonPressed(0, 4)) {
                deposit += 1000;
                player.addScore(-1000);
              } else {
                deposit += 10;
                player.addScore(-10);
              }
            }

            // decrease
            if (Pad.IsButtonPressed(0, 16) && deposit > 19) {
              if (Pad.IsButtonPressed(0, 4)) {
                deposit -= 1000;
                player.addScore(1000);
              } else {
                deposit -= 10;
                player.addScore(-10);
              }
            }

            // help
            if (Pad.IsKeyPressed(KeyCode.H)) {
              getHelp();
            }

            // withdraw
            if (Pad.IsButtonPressed(0, 17) && deposit > 19) {
              player.addScore(deposit);
              Text.ClearHelp();
              Text.PrintNow("bnkng5", 10000, 1);
              // Text.PrintNow("atm2", 10000, 1);

              let account = IniFile.ReadInt("cleo/atm.ini", "INVEST", "Money"); // 2@
              IniFile.WriteInt(0, "cleo/atm.ini", "INVEST", "Money");
              player.addScore(account);

              wait(100);
              player.setControl(true);

              Text.PrintNow("bnkng4", 5000, 1);
              // Text.PrintNow("atm3", 5000, 1);
              showTextBox(
                `~w~Now you have ~b~$${money(
                  IniFile.ReadInt("cleo/atm.ini", "INVEST", "Money")
                )}~w~ on your account.`
              );

              deposit = 0;
              wait(5000);

              continue main;
            }

            // exit
            if (Pad.IsButtonPressed(0, 14)) {
              if (deposit > 19) {
                let account = IniFile.ReadInt(
                  "cleo/atm.ini",
                  "INVEST",
                  "Money"
                ); // 2@
                account += deposit;
                IniFile.WriteInt(account, "cleo/atm.ini", "INVEST", "Money");
              }
              wait(100);
              player.setControl(true);

              Text.ClearHelp();
              Text.PrintNow("bnkng3", 5000, 1);
              // Text.PrintNow("atm4", 5000, 1);
              showTextBox(
                `~w~Now you have ~b~$${money(
                  IniFile.ReadInt("cleo/atm.ini", "INVEST", "Money")
                )}~w~ on your account.`
              );

              deposit = 0;
              FxtStore.delete("atm1");
              FxtStore.delete("atm2");
              FxtStore.delete("atm3");
              FxtStore.delete("atm4");
              // wait(3000);

              continue main;
            }
          }
        }

        if (
          !atFeet(player, oceanHotel) ||
          !atFeet(player, malibu) ||
          !atFeet(player, marina) ||
          !atFeet(player, washPetrolNext) ||
          !atFeet(player, nbTools) ||
          !atFeet(player, cherryPoppers) ||
          !atFeet(player, haitiPnS) ||
          !atFeet(player, bikersBar) ||
          !atFeet(player, crocsBar) ||
          !atFeet(player, washShop) ||
          !atFeet(player, washPetrolShop)
        ) {
          // Text.ClearHelp();
          // Text.ClearPrints();
          // FxtStore.delete("atm1");
          // FxtStore.delete("atm2");
          // FxtStore.delete("atm3");
          // FxtStore.delete("atm4");

          continue main;
        }
      }
    }
  }
}

// Functions
/**
 * @param {number} x
 * @returns {string}
 */
function money(x) {
  return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}

/** Show text box with help */
function getHelp() {
  return showTextBox(
    `~h~Press ~k~~VEHICLE_ENTER_EXIT~ to ~t~increase~h~, ~k~~PED_SPRINT~ to ~y~decrease~h~, ~k~~PED_FIREWEAPON~ to ~b~get all~h~ your money from the bank, ~k~~PED_JUMPING~ to ~o~exit~h~. To show this message press ~p~H~h~.`
  );
}

from cleo-redux.

x87 avatar x87 commented on August 20, 2024

I cannot reproduce this issue. I took fresh GTA VC from steam, downgraded to 1.0, installed VC.CLEO 2.0.0.6, CLEO Redux 1.2.1 and SilentPatch.

This is my test script:

Text.PrintNow("TEST", 5000, 1);

this is my FXT (CLEO_TEXT\1.fxt)

TEST This is a test message

I can see "This is a test message" when I run the game.

Try disabling ALL scripts and FXT files, and test with a single JS script & single FXT file. Would it work?

from cleo-redux.

x87 avatar x87 commented on August 20, 2024

Also question: does it work with this build #98 (comment) ?

from cleo-redux.

strejda603 avatar strejda603 commented on August 20, 2024

Honestly, I have no clue, what is wrong... It used to work, I did nothing (just played the game, and updated CLEO Redux from 1.2.0 to 1.2.1), and it just stopped working.. I tried to disable all scripts, modloader, etc. and left just VC.CLEO 2.0.0.6, CLEO Redux 1.2.1 and SilentPatch on, even start new game: no luck...

Also question: does it work with this build #98 (comment) ?

No, it doesn't. And now, even v1.2.0 doesn't work..

It's strange, everything other work just fine, and only displaying text from FXT files doesn't...

I'm trying to combine Ultra Mod with Extended Features Mod. Here is my whole Vice City folder (and a save file). If you have some time, could you please try to look at it? Maybe you'll notice something I won't..

Thank you very much!

from cleo-redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.