Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

engineImageLinkTXD function incompatitible with engineRequestModel #3187

Closed
1 task done
JeViCo opened this issue Sep 18, 2023 · 5 comments
Closed
1 task done

engineImageLinkTXD function incompatitible with engineRequestModel #3187

JeViCo opened this issue Sep 18, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@JeViCo
Copy link

JeViCo commented Sep 18, 2023

Describe the bug

I tried using both IMG functions & engineRequestModel and failed. I tried using engineImageLink* functions like engineImportTXD and engineReplaceModel:

local imgElement = engineLoadIMG("img/admiral.img")
engineAddImage(imgElement)

local saModelId = getVehicleModelFromName("admiral")
local reqModelId = engineRequestModel("vehicle", saModelId)

engineImageLinkTXD(imgElement, "admiral1.txd", reqModelId)
engineImageLinkDFF(imgElement, "admiral1.dff", reqModelId)

Textures didn't load so i followed the wiki and changed code to

local imgElement = engineLoadIMG("img/admiral.img")
engineAddImage(imgElement)

local saModelId = getVehicleModelFromName("admiral")
local reqModelId = engineRequestModel("vehicle", saModelId)

local txdId = engineGetModelTXDID(reqModelId)
local dffId = reqModelId
engineImageLinkTXD(imgElement, "admiral1.txd", txdId)
engineImageLinkDFF(imgElement, "admiral1.dff", dffId)

I don't know why does it require additional API calls instead of direct id pass but it works.

TL;DR; after doing some researches i've managed to freeze client. I requested id for two vehicles with same parentId. I noticed that engineGetModelTXDID returned same value for both ids. I attempted to change vehicles's model with one of requested ids and my client froze.

Steps to reproduce

  1. Create two or more ids with engineRequestModel function with same parentId
  2. Link all ids to IMG
  3. Try passing any requested id to setElementModel function

OR

  1. Use sample resource
    img_test.zip

Version

Client: v1.6-release-22204 (Windows 10, 64 bit)

Additional context

No response

Relevant log output

No response

Security Policy

  • I have read and understood the Security Policy and this issue is not security related.
@JeViCo JeViCo added the bug Something isn't working label Sep 18, 2023
@JeViCo
Copy link
Author

JeViCo commented Sep 18, 2023

I also discovered engineRequestTXD function but the syntax is completely different from engineRequestModel. It also might have conflicts within 2 IMG archives when using same name. In short, it doesn't seem to fit the current case.

@Fernando-A-Rocha
Copy link
Contributor

@TheNormalnij 🫡

@Xenius97
Copy link
Contributor

Use
https://wiki.multitheftauto.com/wiki/EngineRequestTXD and textures will work.

@JeViCo
Copy link
Author

JeViCo commented Sep 24, 2023

Use https://wiki.multitheftauto.com/wiki/EngineRequestTXD and textures will work.

Isn't it for existing TXDs?

@JeViCo
Copy link
Author

JeViCo commented Oct 1, 2023

I've made some tests around EngineRequestTXD and it actually works. Just use different string every time you need a fresh TXD id.

Personally, I'm not a big fan of those additional ID changes as this adds additional complexity and general confusion of how things work

@JeViCo JeViCo closed this as not planned Won't fix, can't repro, duplicate, stale Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants