YimMenu-Lua / Samurais-Scripts

A base for a Lua script centered around roleplaying and having fun in a game full of ad bots and toxic cheaters.
13 stars 6 forks source link

[BUG]: Attempt to concatenate a nil value (global 'GPAD_TRIGGERBOT_BUTTON') - Samurais-Scripts 1.3.0 #24

Closed RKDeviancy closed 4 weeks ago

RKDeviancy commented 1 month ago

Describe The Bug

When injecting, almost everything works as expected, but YimMenu's console gives me the following text while the lua's load. [01:55:05.7796985][FATAL/lua_module.cpp:82] ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: attempt to concatenate a nil value (global 'GPAD_TRIGGERBOT_BUTTON') stack traceback: ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: in main chunk [01:55:05.7800228][FATAL/lua_module.cpp:330] Translations.lua failed to load: ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: attempt to concatenate a nil value (global 'GPAD_TRIGGERBOT_BUTTON') stack traceback: ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: in main chunk

Steps To Reproduce

  1. Inject YimMenu with Samurais-Scripts 1.3.0 in your scripts folder
  2. Watch YimMenu console

YimMenu Log

[01:55:05.0381304][INFO/main.cpp:153] Settings Loaded and logger initialized. [01:55:05.0388158][INFO/main.cpp:155] Yim's Menu Initializing [01:55:05.0388191][INFO/main.cpp:156] Git Info Branch: master Hash: 899c116eca6d1456d3a3a67564e0688754b16950 Date: Sat Sep 21 10:18:40 2024 [01:55:05.0388983][INFO/main.cpp:168] Windows 11 Home Version 23H2 (OS Build 22631.4169) [01:55:05.0435257][DEBUG/thread_pool.cpp:22] Resizing thread pool from 0 to 4 [01:55:05.0439615][INFO/main.cpp:176] Thread pool initialized. [01:55:05.0524935][INFO/pointers.hpp:94] GTA5 pointers cache is up to date, using it. [01:55:05.0525123][INFO/pointers.cpp:2052] Loading pointers instance from cache [01:55:05.0525141][INFO/pointers.cpp:2061] Pointers cache: Loading 245 fields from the cache [01:55:05.0525379][DEBUG/module.cpp:55] Waiting for socialclub.dll... [01:55:05.0589460][INFO/pointers.hpp:94] Social Club pointers cache is up to date, using it. [01:55:05.0589608][INFO/pointers.cpp:2052] Loading pointers instance from cache [01:55:05.0589630][INFO/pointers.cpp:2061] Pointers cache: Loading 5 fields from the cache [01:55:05.0590337][INFO/main.cpp:179] Pointers initialized. [01:55:05.0590466][INFO/main.cpp:186] Disabled anticheat gameskeleton. [01:55:05.0650782][INFO/main.cpp:189] Byte Patch Manager initialized. [01:55:05.0692264][INFO/main.cpp:192] Renderer initialized. [01:55:05.0819964][INFO/main.cpp:196] Fiber pool initialized. [01:55:05.0901828][INFO/main.cpp:199] HTTP Client initialized. [01:55:05.2818396][DEBUG/thread_pool.cpp:96] Thread 24196 executing font_mgr.cpp:37 [01:55:05.2824486][INFO/main.cpp:202] Translation Service initialized. [01:55:05.3062065][INFO/main.cpp:205] Hooking initialized. [01:55:05.3297550][DEBUG/gta_data_service.cpp:160] Loading data from cache. [01:55:05.3297648][INFO/gta_data_service.cpp:172] Loading 1066 peds from cache. [01:55:05.3303185][INFO/gta_data_service.cpp:194] Loading 864 vehicles from cache. [01:55:05.3305719][INFO/gta_data_service.cpp:215] Loading 114 weapons from cache. [01:55:05.3305760][INFO/gta_data_service.cpp:216] Loading 449 weapon components from cache. [01:55:05.3305774][DEBUG/gta_data_service.cpp:166] Loaded all data from cache. [01:55:05.4405205][DEBUG/thread_pool.cpp:96] Thread 24196 executing player_database_service.cpp:315 [01:55:05.4406808][INFO/main.cpp:226] Registered service instances... [01:55:05.4409741][INFO/main.cpp:229] Finished initialising services. [01:55:05.4410726][INFO/main.cpp:249] Scripts registered. [01:55:05.5205592][INFO/main.cpp:252] Hooking enabled. [01:55:05.5206000][INFO/main.cpp:255] Dynamic native hooker initialized. [01:55:05.5609960][INFO/lua_module.cpp:335] Loaded actions.lua [01:55:05.5890821][INFO/lua_module.cpp:335] Loaded objects.lua [01:55:05.6076919][INFO/lua_module.cpp:335] Loaded refs.lua [01:55:05.7005958][INFO/lua_module.cpp:335] Loaded Extras-Addon.lua [01:55:05.7285422][INFO/lua_module.cpp:335] Loaded Extras-data.lua [01:55:05.7345161][INFO/lua_module.cpp:335] Loaded json.lua [01:55:05.7578060][INFO/lua_module.cpp:335] Loaded samurais_utils.lua [01:55:05.7796985][FATAL/lua_module.cpp:82] ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: attempt to concatenate a nil value (global 'GPAD_TRIGGERBOT_BUTTON') stack traceback: ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: in main chunk [01:55:05.7800228][FATAL/lua_module.cpp:330] Translations.lua failed to load: ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: attempt to concatenate a nil value (global 'GPAD_TRIGGERBOT_BUTTON') stack traceback: ...dev\AppData\Roaming\YimMenu\scripts\lib\Translations.lua:302: in main chunk [01:55:05.8005081][INFO/log.cpp:16] samurais_scripts.lua: version 1.3.0 [01:55:07.5246606][INFO/lua_module.cpp:335] Loaded samurais_scripts.lua [01:55:07.5247253][INFO/main.cpp:259] Lua manager initialized.

Screenshot / Video

Additional context

No response

YimMenu Build

Script Version

RKDeviancy commented 1 month ago

I don't know if I should make a second issue or not, so for now I'll just leave this here. After attempting to use drift mode on 1.3.0 i noticed it wasnt working, and checked the yimmenu console, where I saw this:

[02:09:54.3920674][FATAL/lua_manager.cpp:414] samurais_scripts.lua: ...dev\AppData\Roaming\YimMenu\scripts\samurais_scripts.lua:7826: attempt to index a nil value (local 'info') stack traceback: ...dev\AppData\Roaming\YimMenu\scripts\samurais_scripts.lua:7826: in function <...dev\AppData\Roaming\YimMenu\scripts\samurais_scripts.lua:7814> [02:09:54.3920470][FATAL/lua_module.cpp:82] ...dev\AppData\Roaming\YimMenu\scripts\samurais_scripts.lua:7826: attempt to index a nil value (local 'info') stack traceback: ...dev\AppData\Roaming\YimMenu\scripts\samurais_scripts.lua:7826: in function <...dev\AppData\Roaming\YimMenu\scripts\samurais_scripts.lua:7814>

I hope it helps you identify the issue!

xesdoog commented 1 month ago

Hello there!

The first issue seems to be caused by your config file.

  1. Go to %AppData%\YimMenu\scripts_config
  2. Find samurais_scripts.json
  3. Copy it somewhere else and rename it to samurais_scripts.txt
  4. Upload it in a new comment.

The second issue is related to animations. Do you happen to have button conflicts? Like the same button to drift also plays an animation? I tried that but couldn't reproduce the issue so further information would be great.

RKDeviancy commented 1 month ago

Hello! here is the config file:

samurais_scripts.txt

The second issue is related to animations. Do you happen to have button conflicts? Like the same button to drift also plays an animation? I tried that but couldn't reproduce the issue so further information would be great.

I don't believe so. I didn't add any hotkeys through Samurais-Scripts and all hotkeys I have set through YimMenu's settings use the numpad. Are there any hotkeys in the Samurais-Scripts that are on by default that I should look at?

Thank you for your time and effort!

xesdoog commented 1 month ago

The first issue is caused by the translations file not reading a button name. GPAD_TRIGGERBOT_BUTTON takes the name string from your config file but your config is totally fine: "gpad_keybinds":{"triggerbotBtn":{"name":"[Unbound]" so I'm kinda lost here 😕

As a last ditch effort, I've noticed that you don't have any saved outfits or custom vehicles in your config so are you okay with completely resetting your config by deleting samurais_scripts.json ? The only thing you'd have to redo in this case is reactivating checkboxes.

Are there any hotkeys in the Samurais-Scripts that are on by default that I should look at?

All controller keybinds are set to nothing (Unbound) by default but you can customize them. As for keyboard & mouse keybinds, a few of them are pre-set and you can change them in Settings -> Hotkeys

RKDeviancy commented 1 month ago

The first issue is caused by the translations file not reading a button name. GPAD_TRIGGERBOT_BUTTON takes the name string from your config file but your config is totally fine: "gpad_keybinds":{"triggerbotBtn":{"name":"[Unbound]" so I'm kinda lost here 😕

That's alright!

As a last ditch effort, I've noticed that you don't have any saved outfits or custom vehicles in your config so are you okay with completely resetting your config by deleting samurais_scripts.json ?

Yeah I can do that in a few minutes and get back to you!

RKDeviancy commented 4 weeks ago

Hello! I have done that, and I also currently only have Samurais-Scripts in my scripts folder right now to make sure there's no conflicts elsewhere. The translations error is still occuring, but the animations error has not popped up in the yimmenu console yet. However, drift mode still isn't working- so I am guessing the animation error just coincidentally happened when I first noticed drift mode wasn't working and was unrelated.

edit: Hold on let me test something

RKDeviancy commented 4 weeks ago

I figured it out!

The last samurais-scripts file I was on was 1.2.5, which automatically had the controller button for drift mode set to A/X. With the new hotkey system that was added since then drift mode's hotkey was added to that list of hotkeys you can change and I had to set it myself this whole time and just didn't know- that's my bad.

I don't know if I should close this issue though, since the original translation error is still happening for me.

xesdoog commented 4 weeks ago

I figured it out!

The last samurais-scripts file I was on was 1.2.5, which automatically had the controller button for drift mode set to A/X. With the new hotkey system that was added since then drift mode's hotkey was added to that list of hotkeys you can change and I had to set it myself this whole time and just didn't know- that's my bad.

I don't know if I should close this issue though, since the original translation error is still happening for me.

You should do a clean reset then we'll see if the issue is still there because I couldn't reproduce it.

  1. Remove everything related to this script (your settings file and all 6 script files).
  2. If you are currently playing with YimMenu injected, go to YimMenu's Settings -> Lua Scripts and press the Reload All button.
  3. Create a folder in your scripts folder and name it Samurai's Scripts.
  4. Download the latest zip release and extract its contents to the new folder you've created.
  5. If you're currently playing with the menu injected, reload all scripts again.
RKDeviancy commented 4 weeks ago

I have done the clean reset and so far everything is working well. Updating the files like normal usually works fine but I guess something bugged out this time, thank you. I'll let you know if it throws any errors again!

xesdoog commented 4 weeks ago

I have done the clean reset and so far everything is working well. Updating the files like normal usually works fine but I guess something bugged out this time, thank you. I'll let you know if it throws any errors again!

Glad to hear that!

The second issue is possible to reproduce under certain circumstances (when messing with favorite and recently played anims). I've fixed it but it's too small of an update to create a whole new release for it. I'll probably add some new animations or a new feature and slip the fix with everything else.

RKDeviancy commented 4 weeks ago

Okay, thank you! That sounds good!