Skip to content
View in the app

A better way to browse. Learn more.

LCPDFR.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Certain objects becoming invalid despite existing

Featured Replies

Heya!

 

I'm currently working on spawning certain props inside an MLO interior. Most of the time it works great, however sometimes they simply refuse to spawn. RPH even throwing an error stating that "hash ... does not exists"

 

The issue is: Those objects definitely exists since sometimes they do spawn in from the same code without changing anything, and if I spawn them via Menyoo, they work 100% of the time.

 

 

This is one of the objects that occasionally refuse to spawn: v_corp_cd_recseat

 

This is my current code to check if the object does in fact exist before I even try loading the model:

if (NativeFunction.Natives.IS_MODEL_IN_CDIMAGE<bool>(Utils.GetHash(modelname)) && NativeFunction.Natives.IS_MODEL_VALID<bool>(Utils.GetHash(modelname)))

If this check is passed, the object will spawn in normally as expected. If it fails the above test and I try to spawn it in, RPH will throw the "doesn't exist" error message.

 

But why would the same model, in the same playthrough exist in menyoo but not in my code?

Edited by RicyVasco

  • Management Team

I wonder if a specific IPL or other data needs to be requested in order for the model to be actually loaded by the game. I assume after you spawn it once via Menyoo it will return true for your check?

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

  • Author
5 hours ago, LMS said:

I wonder if a specific IPL or other data needs to be requested in order for the model to be actually loaded by the game. I assume after you spawn it once via Menyoo it will return true for your check?

Haven't tested that yet, but it sometimes spawns without using Menyoo first. Just launching the game and then triggering the code. Ans it's not like I'm accidently loading some interior sets first. It's always the same:

 

Start the game, fade screen to black, teleport the player and try go spawn all objects

 

I'll test your theory once I get home and reply back with more info

  • Author
On 7/17/2024 at 11:23 PM, LMS said:

I wonder if a specific IPL or other data needs to be requested in order for the model to be actually loaded by the game. I assume after you spawn it once via Menyoo it will return true for your check?

Coming back to your question.

 

I was able to test it and after spawning the prop with menyoo it also spawned from my script.

 

Some further info: Before spawning it with Menyoo, both IsModelValid and IsModelInCDImage returned false. I found a thread on FiveM forum https://forum.cfx.re/t/ismodelvalid-returns-false-at-high-altitudes-around-z-610-for-some-props/5116232 where a guy explained that not all models are loaded at runtime and are only loaded in specific locations which might explain why some spawnpoints work well and others do not.

 

That still leaves the question how Menyoo is able to spawn those objects in all locations

  • Management Team

To narrow it down, you could try spawning the prop named in the thread you linked. If Menyoo can also spawn that, it might have a clean general workaround. If it cannot, then perhaps there is a subset that can be requested through IPLs.

Please do not PM me unless really necessary (knowing you helps). If you think you need my attention in a topic, tag me.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.