quindo Posted November 30, 2014 Share Posted November 30, 2014 Hey, I'm new to scripting, I need to know how to scale multiple objects at once, could somebody help me? Something like this: obj = { CreateOject(...), CreateOject(...), CreateOject(...) } SetObjectScale(obj,1.5) How can i do this? Link to comment
Saml1er Posted November 30, 2014 Share Posted November 30, 2014 obj = { createObject(...), createObject(...), createObject(...) } for i=1, #obj do setObjectScale(obj[i],1.5) end Link to comment
quindo Posted November 30, 2014 Author Share Posted November 30, 2014 It doesn't work, that's my current testing script: function mapLoad ( ) objekt = { createObject ( 3458, 2500, -1645, 50, 0, 0, 0 ), createObject ( 3458, 2500, -1675, 50, 0, 0, 0 ), createObject ( 3458, 2480, -1660, 50, 0, 0, 90 ), createObject ( 3458, 2520, -1660, 50, 0, 0, 90 ) } for i=1, #objekt do SetObjectScale(objekt[i],1.5) end end addEventHandler ( "onResourceStart", getRootElement(), mapLoad ) it spawn normal sized objects, what am i doing wrong? Link to comment
Saml1er Posted November 30, 2014 Share Posted November 30, 2014 Oh sorry. I'm on mobile so..... obj ={ createObject(...), createObject(...), createObject(...) } for i=1, #obj do setObjectScale(obj[i],1.5) end And fix SetObjectScale to setObjectScale. Link to comment
quindo Posted November 30, 2014 Author Share Posted November 30, 2014 Thank you, it's working, i'm wondering if there is a possibility to have scaled collisions too, or is that impossible? Link to comment
Dealman Posted November 30, 2014 Share Posted November 30, 2014 As far as I am aware, it is currently not possible as it would likely require changes to the .dff file. Link to comment
quindo Posted November 30, 2014 Author Share Posted November 30, 2014 Well, is there a way to change models on the fly? or make animated model with changing collision? thanks for help =) 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