Walking over and under models...

A forum for discussing map making ideas and problems for the Myth series.
Post Reply
User avatar
Point
Posts: 1804
Joined: Mon Mar 22, 2004 12:58 pm

Walking over and under models...

Post by Point »

is it possible maybe by animating from up and down fast to allow units to walk over and under a bridge....

this is the bridge from the forge that units at one time walk under then at another time walk over... if it continually animated from the up to the down version would it be possible to pass ?

Image
if one does not learn from the failings of the past they are likely to suffer its return.
User avatar
Pyro
Bug Finder Extraordinaire
Posts: 4751
Joined: Sun Mar 21, 2004 2:14 pm
Location: Texas

Re: Walking over and under models...

Post by Pyro »

I don't know if the Forge bridge can be reversed, but going back and forth can cause issues. If you have units under the bridge when you "collapse" it, those units will now be on the bridge instead of under. Same thing if done the other way. You would not be able to cycle through the animation constantly or else units wouldnt be able to cross before the bridge went down or back up. It is quite problematic and likely not worth the trouble. Even if done in the best manner, you will still have issues.
User avatar
haravikk
Site Admin
Posts: 987
Joined: Mon Mar 22, 2004 12:56 pm
Location: Scotland

Re: Walking over and under models...

Post by haravikk »

There are two possible ways to do this:

1. Cheat!
By simply replacing the bridge with a custom model that is an enclosed walk-way, you can avoid the problem entirely by hiding the unit(s) shortly after they enter the walk-way, and making them re-appear at the other side after a suitable delay, as though they walked through.
You can of course do the opposite as well and have the lower part of the bridge enclosed and the upper part behaving normally.

To make pathing work a bit beter you need to be a little bit cunning. Basically you paint either side of the bridge in a terrain type that you don't use anywhere else, then paint the ends of it in a different terrain type. The first terrain type will be passible to the normal units, while the second will be impassible. As units enter the area before crossing the bridge (the bigger the area you can designate the better), they will be detected by a GEOM and promoted using an artefact to a variation of the monster that can walk over the impassible terrain type you painted earlier, but not the ordinarily passible terrain type. Thus if you click on the other side of the bridge, they will quite happily walk towards it and your fake overpass. The reason you need this is that you have to be sure the bridge doesn't remove any cells, and you have to make sure units going under won't simply walk up the hillsides and through the bridge to reach the top, and likewise that no units at the top of the bridge will just walk off the sides of it (though they aren't as much an issue in this case as you'll be hiding them).

Don't forget to demote them when they make it far enough away from the bridge again.

2. Overkill
This method actually extends the pathing clean-up of the previous method. However, instead of a sneaky model, you will paint media height where the bridge is, and set it to the height of the bridge. You'll need a custom media type to achieve this properly, but by getting rid of any reflection, removing all surface effects, and being tricky with the wobble values you can prevent the media from being visible at all.

Now, when you promote the models so that their terrain passibility changes you will also needs to convert them such that will maintain constant heigh about the mesh, this will allow them to walk on the surface of your sneaky media, and thus "across" the top of your bridge. Slap in a suitable bridge model and the ruse is complete. Make sure your bridge units count as flying (so you can set the regular units so that they will be unable to attack units above them as required, and vice-versa, i.e - make sure units on the bridge can only attack other "flying" units).

The problem with this method is that the path-finding radii will be ignored, which is great for passing over units under the bridge, but not so great for making your way around units on the bridge. It's also a real bitch to get the effect to work correctly, particularly the media settings.
Being Haravikk gets you girls like these:
Image
Post Reply