Jump to content

Object Scale


Recommended Posts

  • 6 months later...

It's really easy to scale objects already - the only problem is that the collision-data for the object stays the same size... so, you could put a massively huge wheelchair on top of a building, but if someone flew into it with a helicopter they wouldn't hit anythign until they reached the very tiny center of the object.... Or, you could shrink a massively tall building down to a size that would fit into your pocket, but if you tried to walk up to it you'd hit the building walls long before you got close enough. (unless you turned its collisions off completely, which is also possible.)

Anyhow, it can all be done, but has to be done clientside... easiest would be to do the following:

in your map file, specify something like scale="2.0"

when you load objects from a map file, use setElementData() to set a property "scale" on the object to 2 (the value that was in your map file)

use clientside onElementStreamIn event, check if what's being streamed in is an "object" and if getElementData "scale" isn't false, setObjectScale() to that numeric value...

optionally, setElementCollisionsEnabled to false for the object if "scale" does not equal 1.0

But, like i said, you run into the collision-data problem mentioned above. Also, it wouldn't be hard to edit any of the scripted map editors to give the option to setObjectScale of whatever item you're playing with...

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...