I already posted this on RPG maker forums but might as well post it here, while its waiting for approval.
I have this part in my game, where the positioning of characters switches around after a cutscene. I do this using the "Save Event Position" plugin by Shaz. Since today after the cutscene, this error message started popping up.
Disabeling the plugin fixes it, it's essential to the gameplay though. I've compared it with a backed up version from 4 days ago (my backed up version from yestarday has the same issue) where the problem doesn't occur. I compared the event, that triggers the plugin with the old version and haven't found any differences. As I have no knowledge of JS I'm pretty stumped.
Does anyone have any ideas? Many thanks in advance!
Changing this if condition from this:
if (props.items.length === 0) {
To
if (!props.items?.length) {
Should work.
Similarly if using for places,you can check using ternary operator if length exists in array of places.
How? Because items could possibly be null or undefined from apis, so the length property on array might be missing.
Moreover, using ! Not operator would make this condition true if length of items is 0 or is null or undefined or any falsy value
The other answers are focusing on prop.items list but in your question you mention that you get the exception when trying to access the length of the places inside users.
You are getting the error message because some users may not have any places listed inside them, hence, no places list -> no length property.
To fix this, you need to check if the places list exists and then access its length:
placeCount={ user.places ? user.places.length : 0 }
Here, we use a ternary operator to check if user.places exists, then we use the length, else use zero.
Edit: As pointed out by Phil in the comments below, you can also use coalescing operator, which is much cleaner, like this:
placeCount={ user.places?.length ?? 0 }
The syntax simply translates as if user.places has a value for length, then use that value, else use zero as a default value.
use !post || !post.length or !posts?.length
The error says the type of posts is Undefined. As you are getting that value from Posts in state object, that means that Posts is not initialized in your state.
Try initializing "Posts" with empty Array([]) in your initial state object.
I am getting this error everytime I install decky loader. I thought it was because I installed HDD decky because my ally is showing ps glyphs instead of Xbox.
I have reset multiple times and once I select refresh it works.
Also side note, returning to game mode doesn't always work, I have to hard reset it each time it hangs
Just wondering if anyone is having the same issue?
EDIT: It looks like joiplay updated and broke F&H so please make sure you have version
Hello all, I'm here to guide you to misery in the name of our lord Gro-goroth.
You may have tried to run this already through Gamehub lite or Gamenative already and noticed that the games are laggy and no matter what settings you change, it doesn't seem to help.
Well I did find a decent workaround and I'm here to assist. If you've got the time, I've got the solution.
Since both Fear & Hunger games are made in RPGMaker, we can actually use Joiplay, an RPGMaker/Web based games engine for Android.
JoiPlay | Website - Older versions
JoiPlay | Patreon (free) - Current versions
I would highly suggest trying to get the newest version from the Patreon as the older versions are a little buggy and missing the "Remap controller buttons" options menu.
It appears newer versions may break some functionality of the game. Make sure you have version 1.20.611 (this is what I was using when I made the guide)
JoiPlay | 1.20.611 direct link
Alright, here we go.
-
Download and install the main JoiPlay apk and then the RPGMaker plugin and install them like normal.
-
Install Fear & Hunger/2 through Gamehub or GameNative. (Important disclaimer: Unless you are rooted or have GameNative set to save files on the SD card, you won't be able to access the game data, so ensure you meet one of these criteria first before proceeding with GameNative)
-
Boot up JoiPlay and go through the quick setup process, ensure you add permissions it asks for and agreeing to the terms. Once this is complete, click the Plus sign aka Add Game. At this stage, it will ask you to locate the game's .exe file. This is where things differ depending on GameNative or Gamehub.
-
If using Gamehub, you will need to go back to your home screen, open the Thor's preinstalled "Files" app, and on the hamburger menu/left side and scroll down until you see "GameHub Lite" (may be named differently for the normal GameHub). From here you will just tap on it, and follow this path:
data -> files -> Steam -> steamapps -> common. From here you will want to copy or move your Fear & Hunger/2 folder out of this directory and place it somewhere on your SD Card or Internal storage that can be accessed by other applications. For simplicity's sake, the example I will use is placing it the root of the internal storage. Then, once back in JoiPlay, you can tap the Plus/Add Game icon once again, and navigate to your Fear & Hunger/2 directory, wherever you placed it, and scroll down (if needed) and select "Game.exe" -
If using GameNative, you will not need to move anything around if you installed the game on SD Card as mentioned above. In JoiPlay when you tap the Plus to add a game, you will just need to back out to the top level in its file picker, select "External Storage" and navigate to this path:
Android -> Data -> app.gamenative -> files -> Steam -> steamapps -> common -> Fear & Hunger/2-> scroll down until you find Game.exe and tap on it. -
Once Game.exe is selected, it should automatically pick up the game's name, so you want to tap "Next" and it will ask for the game version. You can leave this blank, I don't believe it matters. Tap "Next" once again and it'll pick an icon for the game. You can tap next/finish and it should now be in your JoiPlay game list.
We're in the endgame now, if you've made it this far, you're almost done. Next up comes control mapping.
-
Tap and hold Fear & Hunger/2 in the JoiPlay game list, and a submenu will pop out. Scroll down until you find "Remap Controller Buttons" If you don't see this, you need to get a newer version of JoiPlay!
-
A menu should pop up allowing you to modify the button mappings now. Fear & Hunger/2 both don't use many keys, so mapping isn't super complicated, and feel free to change them as you see fit. This is what I use:
Button_A : ENTER
Button_B : ESCAPE
Button_Y : SHIFT_LEFT (This is for Fear & Hunger 2, and will serve as your Run/Dash button)
Button_L1 : SHIFT_LEFT (This is for both Fear & Hunger 1 and 2, for using a Lucky coin doing a coin flip. L1 is a bit more ergonomic to hold during selection than Y is)
Since Fear & Hunger 1 has a dedicated Torch button, you can set
Button_X : T
I left the rest at default, as the joystick and dpad already had directional movement set correctly.
That's it, you're done! After you get the controls set, don't forget to hit "Save" at the bottom of the button map page, and boot up the game.
It will take a little while (a few minutes) to start the game, but after which it should be working at full framerate, no tinkering or extra setup required.
Afternote: I did try to install the Fear & Hunger 2 Widescreen mod and it ends up breaking the game, while also making text a bit too tiny, so your mileage may vary with mods, just know there is a risk they will introduce extra problems playing the games this way.
Also for those wondering: You can disable the arrows/overlay in JoiPlay's settings on the main page. Tap the 3-dot menu in the top right, and find settings. Under "Gamepad settings" there is a toggle to hide the virtual gamepad, which should also make the overlay arrows disappear. Note: If you do this you will have no way to exit the game naturally so you will have to close the app and reopen it to change games.
Also, theoretically this same guide should work for any RPGMaker game, but it really depends on the game and if you get stuck, I would look for game specific guides for those.
Thanks for reading and I hope this helps!