HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Create Unit: Elevation problems.

10-27-2004, 01:31 PM#1
Squally425
Heres a nifty problem I'm unable to solve.
Perhaps I didn't look hard enough.

Anyhow, the problem I have is:

Say I had a map (which I do) which contains a maze like terrain. That terrain will obviously include, high and low terrain spots, and walls. I made a region fitting across the maze area of the map, and created a trigger which will fill the region with 25 creeps at all times.
Nothing wrong with that area.

The Problem? Create unit is actually creating units inside walls, on top of walls, inside walls, and some are on actual ground. Most units look like they got stuck in a wall. Is there a way to fix that?
10-27-2004, 02:45 PM#2
Dead-Inside
Well... You could check how far the next cliff-level is, possibly. And if it's in X radius of the spawned unit, just move it to a new random place. It's pretty instant so players won't notice.
10-27-2004, 03:35 PM#3
Squally425
I forgot to add that the creeps appear in random locations in the maze.
10-27-2004, 05:18 PM#4
Dalten
Quote:
Originally Posted by Squally425
I forgot to add that the creeps appear in random locations in the maze.

If your not dead set on being perfectly random, one solution would be to plop down about 10 or 20 rects and assign them to an array variable, SpawnRects() for example.

Then when you spawn the units, you'd just have to make them spawn in Center of (SpawnRects(Random number between 1 and 20))

Just an idea.
10-27-2004, 07:24 PM#5
Squally425
Perhaps I need to explain my map a bit =P
It's a hero arena. It's also a Maze Arena.
It's what you call a Labyrinth type Arena.
Aside from the little details like all custom abilties and stuff..

The maze, is composed of only the arena part of the map.
Creeps appear in random locations (up to 25).
There are WALLS which are at 2 levels higher than normal level.

The thing is, its dark there and the only way u can find things is by exploring around and seeing what there is. Basically its two teams... in a maze, if you meet each other you fight. If you don't you explore, and you go and find other creeps to fight. The problem in this case is that monsters that are appearing on the maze are actually being randomly placed in ANY POSITIONS even inside a wall, on top of a non-standable wall, if thats a word, and anyhow, thats not wut I want.
Its got something to do with elevation of the land because I don't want any of the monsters to be ON TOP of anything, but on just plain flat ground.

However, thats the problem I have right now and I don't know what to do about it.
10-27-2004, 09:40 PM#6
xxxSpikexxx
there may be ways like replacing worng placed units and stuff but thats all to complicated...

fixing this problem is very easy:
i think you want to make some kind of dungeon so no unit can ever be on the walls.
there is an easy way and a very easy way:
easy: place pathing blockers on the walls
very easy: create boundarys on the walls
you can do that in the terrain editot they are placed like textures, if you didn't know yet.

i hope i could help
10-28-2004, 02:37 AM#7
Squally425
Pathing blockers, nice try.
No it didn't work.
The walls are pathing blockers by nature.. putting pathing blockers was no use.

Boundary? No. My walls are only one square wide, and a boundary is one square wide. No deal.

Thanks anyways though.
Now back to the drawing board.


Well basically.. if walls are one square width.. there shouldn't be units on it, and I'm getting units stuck inside a wall. -.-
10-28-2004, 01:20 PM#8
Dead-Inside
Wc3 doesn't offer such features, you'll have to go with boundaries or pathingblockers. Boundaries work well, even if they take up "the whole wall".
10-28-2004, 01:28 PM#9
Vexorian
You can keep but reduce the randominess, likelly you can have invisible units with no pathing, placed at random zones of the maze, they should be owned by neutral passive, let's say their type is (creep spawn place) ; SpawnPlaces is an unit group variable and SpawnPoint a point variable

Code:
Map Initialization:
    set SpawnPlaces = All Units of Type (creep spawn place)
    Unit Group Pick Every unit in SpawnPlaces and do
        - custom Script: call UnitAddAbility(GetEnumUnit(),'Aloc')

Now when you want to spawn a creep:
Code:
Creep Spawner
Events: Add your event here
Conditions : add your conditions here
Actions: 
    set SpawnPoint= Position of ( Random Unit of (Spawn Places))
    Unit - Create One (insert creep type here) for Neutral Hostile at SpawnPoint facing Default building degrees.
    Custom Script: call RemoveLocation(udg_Point)
10-28-2004, 02:21 PM#10
Squally425
Hey thats a great idea Lord Vexorian.
Thanks!