orel56000 Posted February 8, 2018 Share Posted February 8, 2018 How can I check if a object modelid is exist? There is a command like: isModelIdExist(100000) or something? Link to comment
NeXuS™ Posted February 8, 2018 Share Posted February 8, 2018 (edited) You can try to create the object and if it runs succesful, you know it is a valid id. Edited February 8, 2018 by NeXuS™ Link to comment
orel56000 Posted February 8, 2018 Author Share Posted February 8, 2018 (edited) 3 minutes ago, NeXuS™ said: You can try to create the object and if it runs succesful, you know it is a valid id. That how I've done that, but it is printing me warnings and I thought to myself if there is an other way, why not to ask? Edited February 8, 2018 by orel56000 Link to comment
NeXuS™ Posted February 8, 2018 Share Posted February 8, 2018 (edited) You could use this info. Edited February 8, 2018 by NeXuS™ 1 Link to comment
orel56000 Posted February 8, 2018 Author Share Posted February 8, 2018 2 minutes ago, NeXuS™ said: You could use this info. You have not linked it Link to comment
orel56000 Posted February 8, 2018 Author Share Posted February 8, 2018 15 minutes ago, NeXuS™ said: You could use this info. Thank you Link to comment
ÆBKV Posted February 8, 2018 Share Posted February 8, 2018 function getObjectID() local objects = getElementsByType("object") for i,object in ipairs(objects) do if getElementModel(object) then return object end end return false end try this Link to comment
NeXuS™ Posted February 8, 2018 Share Posted February 8, 2018 34 minutes ago, ÆBKV said: function getObjectID() local objects = getElementsByType("object") for i,object in ipairs(objects) do if getElementModel(object) then return object end end return false end try this Useless code. Would stop after the first object found. Link to comment
ÆBKV Posted February 8, 2018 Share Posted February 8, 2018 8 minutes ago, NeXuS™ said: Useless code. Would stop after the first object found. yes, that's true. Link to comment
DNL291 Posted February 9, 2018 Share Posted February 9, 2018 (edited) There's a Map Editor file called 'objects.xml' that has all objects IDs. You'll need to convert it to Lua, though, to avoid loops through the whole file. Edited February 9, 2018 by DNL291 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now