Page 1 of 1

question about features

Posted: 14 Jun 2010, 23:24
by KaiserJ
is there a way to place them so that their vertical location is completely independent of the heightmap?

i want monorails (and other things of this nature)

Image

so i'm trying to make a lego set, some curved / straight rails, little stations etc... running into a problem though, is it going to be possible to have something like this...

Image

because it seems to me that wherever i place the parts, they're going to be dependant of the height of the map underneath... impossible to line up tile-based rail parts when the ground is uneven :/

i assume i'm either missing something obvious, or trying to do something incredibly complicated and not worth doing (and yeah.. i could do the whole thing as one big feature... but bleah thats not as much fun)

Re: question about features

Posted: 14 Jun 2010, 23:49
by knorke
lua is able to move units (see the falling meteors thread) so when a rail/bridge/track unit is created just set its height with a gadget?

Code: Select all

UnitCreated(blabla, unitid)
if (unit is not a rail or bridge etc) return
x,y,z = get_unit_location_dont_know_the_real_funcition_name (unitid)
z = a fixed height
Spring.MoveCtrl.SetPosition (unitid, x, y, z)
end
something like this?

actually i think in spring y is the height and not z.

problem will be finding out what height all pieces should be at.
i think 0 = water level but some maps might be higher or lower so if the track is fine this map it might be in the hills of that map.

for the pillars of bridges / high tracks you could just model really long pillars on the unit. most of the time the pillars will be in the ground but if the unit is raised or the track goes through a will, more of the pillar will be visible. pillar is a cool word pillar pillar pillar pillar

Re: question about features

Posted: 15 Jun 2010, 00:29
by zwzsg
http://springrts.com/phpbb/viewtopic.php?f=21&t=20052
http://springrts.com/phpbb/viewtopic.php?f=14&t=21268
imbaczek wrote:iirc setfeatureposition grew an additional boolean parameter, check it out.
So:
Spring.SetFeaturePosition(featureID,x,y,z,false)


Oh and don't forget upright=1