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

Dynamic ped ID allocating #65

Closed
wants to merge 2 commits into from
Closed

Conversation

lopezloo
Copy link
Member

@lopezloo lopezloo commented Sep 7, 2016

I got a bit scared about possibility of merging patch #7935 (https://bugs.mtasa.com/view.php?id=7935) into 1.5.3, so this is my proposal of dynamic loading new ped IDs. However, needs testing.

Functions:

model engineAllocateModel ( string modelName, string type )
model engineDeallocateModel ( string modelName )
model engineGetModelFromID ( string modelName )

Simple test:

crun model = engineAllocateModel(666, "ped")
crun localPlayer.model = 666
crun engineDeallocateModel(666) -- or model:destroy()

Test resource:

modellos.zip.gz (can't attach .zip here for some reason)
Resource which replace 12 new ID's with unique DFF&TXD's.

Commands:
/pos - teleport to test place
/allocate - allocates ID's, creates peds and do replacement
/deallocate - destroys TXD&DFF's and frees ID's

@sbx320
Copy link
Member

sbx320 commented Sep 7, 2016

Yeah I'm sharing your concerns right now. My plan has been to revert the patch once we change master to 1.5.3 and implement proper dynamic model allocation in 1.6.

My concept is similar to what you planned, however I'd want to avoid making models a new element type, since they have very little in common with actual elements (e.g. setPosition isn't really helpful).

The API approach I have was:

int engineRequestModel(string type)
void engineFreeModel(int modelid)

This would prevent conflicts between scripts attempting to hardcode model ids, by forcing them to use the models dynamically. Also adding objects to the supported model types should be simple. (Vehicles are a bit harder due to some additional requirements like handling entries).

@qaisjp qaisjp added the enhancement New feature or request label Sep 14, 2016
@qaisjp
Copy link
Contributor

qaisjp commented Dec 22, 2016

Closing this in favour of the planned approach mentioned above. This PR may be reopened if modified to fit the aforementioned approach (ideally rebased over master).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants