question about features

question about features

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
User avatar
KaiserJ
Community Representative
Posts: 3113
Joined: 08 Sep 2008, 22:59

question about features

Post 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)
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: question about features

Post 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
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Re: question about features

Post 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
Post Reply

Return to “Game Development”