HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Doodad/destructible Height

12-24-2006, 04:16 AM#1
Zandose
How do you find the height of a doodad or destructible? I tried this but it didnt work.
Trigger:
Untitled Trigger 001
Events
Conditions
Collapse Actions
Collapse Destructible - Pick every destructible in (Playable map area) and do (Actions)
Collapse Loop - Actions
Custom script: set udg_r[1] = GetLocationZ(GetEnumDestructable())
Collapse JASS:
function Trig_Untitled_Trigger_001_Func001A takes nothing returns nothing
    set udg_r[1] = GetLocationZ(GetEnumDestructable())
endfunction

function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    call EnumDestructablesInRectAll( GetPlayableMapRect(), function Trig_Untitled_Trigger_001_Func001A )
endfunction

//===========================================================================
function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger(  )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
endfunction


Does no one know how to get the height of a doodad or destructible?
12-24-2006, 08:33 PM#2
wyrmlord
I think this is the function you're looking for.
Collapse JASS:
native          GetDestructableOccluderHeight takes destructable d returns real
12-24-2006, 10:58 PM#3
Zandose
Doesn't that have something to do with seeing over trees?

Quote:
Originally Posted by wyrmlord
I think this is the function you're looking for.
Collapse JASS:
native          GetDestructableOccluderHeight takes destructable d returns real

Ok, I tested it and thats not what I'm looking for. It always returns the same height no matter what height the destructible is at.
12-24-2006, 11:59 PM#4
Feroc1ty
thats becouse you never change the destructibles occluder height, to do that select destructible and press pg up, or pg down, anyways i dont know how to find the destructibles actualy height.
12-25-2006, 01:27 AM#5
PipeDream
GetLocationZ() takes type location. You passed it a destructable. Store the destructable's location in a variable, get the Z, destroy the location and finally set the var to null if it's local.
12-25-2006, 02:17 AM#6
Zandose
Don't you mean Ctrl + Page Up/Down?

Quote:
Originally Posted by Jokes-On-You
thats becouse you never change the destructibles occluder height, to do that select destructible and press pg up, or pg down, anyways i dont know how to find the destructibles actualy height.

This don't seem to be working either. Did I do something wrong? It's only showing the height for how high the ground. For example if I place a destructible down on a level 1 terrain (128 points) then raise the destructible with Ctrl + Page Up it's still only showing where it should be and not where it is. If you get my meaning.
Trigger:
Untitled Trigger 001
Collapse Events
Player - Player 1 (Red) types a chat message containing -test as An exact match
Conditions
Collapse Actions
Collapse Destructible - Pick every destructible in (Playable map area) and do (Actions)
Collapse Loop - Actions
Set Point[1] = (Position of (Picked destructible))
Custom script: set udg_r[1] = GetLocationZ(udg_Point[1])
Game - Display to (All players) the text: (String(r[1]))

Quote:
Originally Posted by PipeDream
GetLocationZ() takes type location. You passed it a destructable. Store the destructable's location in a variable, get the Z, destroy the location and finally set the var to null if it's local.
12-25-2006, 02:30 AM#7
wyrmlord
From what I know, you can't get the location (including the Z value) of a destructable, only it's X/Y value. (GetDestructableLoc is a BJ function)
12-25-2006, 02:46 AM#8
PipeDream
You might be able to create a unit on top of the destructable and get its height. Failing that, attach the height at creation.
12-25-2006, 03:50 AM#9
Zandose
The unit doesn't get made on top of the destructible.

How do I attach the height at creation? Do you mean find the height myself without triggers and put them into a variable or something? Basicly preset the heights in variables; which won't work for what I need.

By any chance do you know where the Z point of destructibles are stores in the map file?

Quote:
Originally Posted by PipeDream
You might be able to create a unit on top of the destructable and get its height. Failing that, attach the height at creation.
12-25-2006, 04:01 AM#10
PipeDream
Destructables are all created by the map script, you can find the height when you place them. The world editor should keep track of them in a .doo file. If the height is stored its in the CreateDestructableZ call.
12-25-2006, 04:13 AM#11
Zandose
I'm using MPQMaster to view the .doo file but it's compressed. Is there another program I can use?

You've lost me a bit. The .doo compressed so I can't read it and I can't find any CreateDestructableZ calls in any of the maps files.

Quote:
Originally Posted by PipeDream
Destructables are all created by the map script, you can find the height when you place them. The world editor should keep track of them in a .doo file. If the height is stored its in the CreateDestructableZ call.
12-26-2006, 02:45 AM#12
wyrmlord
For creating a unit on top of a destructable, perhaps try making a flying unit without a model that has locust. Create it at the X/Y of the doodad and then check the unit's height, I don't see how that shouldn't work.
12-26-2006, 03:12 AM#13
Zandose
Didn't work. I changed the Gryphon Rider's abilities to ...
Abilities - Default Active Ability: Locust Swarm
Abilities - Normal: Locust
Model: None

And here's the trigger I used. Just assume that there are 3 barrels already placed on the map.
Trigger:
Untitled Trigger 001
Collapse Events
Player - Player 1 (Red) types a chat message containing -test as An exact match
Conditions
Collapse Actions
Collapse Destructible - Pick every destructible in (Playable map area) and do (Actions)
Collapse Loop - Actions
Unit - Create 1 Gryphon Rider for Player 1 (Red) at (Position of (Picked destructible)) facing Default building facing degrees
Set Point[1] = (Position of (Last created unit))
Custom script: set udg_r[1] = GetLocationZ(udg_Point[1])
Game - Display to (All players) the text: (String(r[1]))

Ok. Since the flying unit thing didn't work it's time to get back to the .doo file. How do I uncompress it for reading?
12-27-2006, 04:03 AM#14
wyrmlord
You'd have to probably create a program to read from it, unless someone else has already done so.
12-27-2006, 04:14 AM#15
Zandose
That's where we have a problem. My skills don't go that deep. Aka I can't make programs and I wouldn't know where to start.
Quote:
Originally Posted by wyrmlord
You'd have to probably create a program to read from it, unless someone else has already done so.

It's looking like I may have to do this by eyesight