Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
12 stars 6 forks source link

[Feature] Get entity properties #177

Closed MyCresta closed 5 months ago

MyCresta commented 2 years ago

Is your feature request related to a problem (if not, explain why you think this feature should be added)? Please describe.

This should be added because it would make it easier for modders to spawn new entities with the same properties as entities that already exist on the map.

Describe the solution you'd like

In a similar way that you can now get properties from current enviroment with GetEnvironmentProperty(name) It should be possible to get certain properties from an entity with something like GetEntityProperty(entity, propertyName)

For my case with the flood mod i made i would like the color properties of a water entity so that i can spawn new water with the same color. Also getting other properties of a water entity could be useful for the same reason.

I also see other potential cases where this could be pretty useful. For example getting properties from a voxbox like: color, material, size, texture or getting corresponding properties from a light to spawn new identical entities.

Describe alternatives you've considered

An alternative could be to add specific functions similar to how some properties are accessible like GetJointLimits() or GetShapeSize() however, it would be easier to just get desired property with one function GetEntityProperty(entity, propertyName) no matter the type.

Most entity properties are currently not possible to read at all like the water entity and there is no alternative to spawn new entities with identical properties.

Additional context

No response

Please-Pick-a-Name commented 2 years ago

i would really want this for vehicles aswell, getting top speed, accleration, etc, and crazier, setting it, man imagine having realistic gear switching and for wheels, toggleable all wheel drive, air suspension or even hydraulics suspensions

FlorentP42 commented 1 year ago

Yes please, I would also add a GetEntityPropertyNames(entity) to return the list of all existing property names for this entity for fully generic entity scanning capabilities :)

Please-Pick-a-Name commented 8 months ago

This is getting attention now: https://discord.com/channels/760105076755922996/1176905132068327494/1176905200754233374

Please-Pick-a-Name commented 5 months ago

This now exists in https://[teardowngame.com/modding/api.html#GetProperty](https://teardowngame.com/modding/api.html#GetProperty) and https://[teardowngame.com/modding/api.html#SetProperty](https://teardowngame.com/modding/api.html#SetProperty) it doesnt make sense for voxbox to return color and material since its not how it works under the hood

FlorentP42 commented 5 months ago

Well it does exist but it is still incomplete as in: you still cannot get the damn texture id out of anything to be able to perfectly clone shapes :/

YuLun-bili commented 5 months ago

@FlorentP42 #470

FlorentP42 commented 5 months ago

@FlorentP42 #470

Well this request is about a dedicated function to get/set textures, not about it's "property" counterpart, but I agree that would solve the issue :)