HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Unit Elevation and Path Detection

07-03-2008, 10:18 AM#1
Evernite.
Hello there, I am currently making a map for the mapping contest, and I have a few questions.

The idea is to recreate the Bust-A-Move atmosphere and gameplay in the Warcraft III engine. I basically got the ideas set in motion and how I would execute everything, however some problems came to me.
  • Firstly, to reproduce the 'canon' of the original game, I was thinking about the human Siege Tank, which I wanted to have negative flying height so that it would only show its actual canon, eventually holding it up through this simple trigger:
    Play Unit Animation:
    Play Siege Tank 000's 'Stand Ready' animation
    However, when testing the map, the unit was flat on the ground instead of being 'submerged' by the ground as I wanted.
  • Secondly, I wanted to do a pathing detection trigger so that I could make the 'bubbles' (here represented by large Wisps) rebound against the walls, but stick to the other 'bubbles.'

If anyone would like to contribute, in GUI terms if possible (my JASS knowledge being pretty much null), I would be grateful. Thank you in advance!
07-03-2008, 10:38 AM#2
Alexander244
For subterranean units shift change fly height & min fly height to negatives on a flying unit. This will create the unit below ground level. You cannot change a units fly height to be below zero post creation, or create non-fliers with fly-height.

For bouncing of walls, check when the unit enters the wall, and then reverse the units x-velocity. (enter region, assuming you have straight walls)

When a clump of wisps collides with another clump of wisps you calculate the momentum of 2 starting objects and then, making them a single object object, give all the wisps the same final velocity conserving momentum.
07-03-2008, 10:57 AM#3
Evernite.
Ah, thank you for the unit flying height, I had forgotten to fix the minimum height as well.

However I am not sure how to change the unit's velocity when hitting a wall in GUI; and will it also enforce a certain angle upon impact? As in, the 'bubble' will change directions depending on its original one?

And as for the momentum, I have no precise idea of how to do this (forgive me, but I had my math lessons in French...). Like, how would it detect that it's a unit it is 'hitting'?
07-03-2008, 11:08 AM#4
Alexander244
If you don't have velocity split into x and y components, split it. That way by reversing the x velocity (times by -1) it keeps the same downward speed but it's horizontal direction reverses. (It bounces off the wall).

For detecting collision Enum the area around each wisp, checking for other wisps. In GUI this is something like Pick every unit in range.
07-03-2008, 07:42 PM#5
Evernite.
I got the idea for detection right in my head now; sorry for coming to the bouncing problem again, but I have searched for a while in the GUI for velocity-affecting functions, but I cannot find any. Would you mind showing me which lines it refers to?

Thank you for your patience and interest.
07-09-2008, 09:09 AM#6
Pyrogasm
Why don't you show us what you have? That would make it easier to tell you what to do.

If you're moving the unit through triggers, you should have velocity variables setup and shtuff, so that shouldn't be a problem. However, if you're just ordering the units to move to positions, that's not going to work and you'll need to move to triggered movement.