• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

Messing with the image stack

Status
Not open for further replies.
Level 14
Joined
Jun 27, 2008
Messages
1,325
imagestack.jpg


Code:
package Test
import Image
import Unit

image array images

init
	let max = 100
	for n = 1 to max
		images[n] = createImage("ReplaceableTextures\\CommandButtons\\BTNPeasant.blp", vec2(0., 0.), 1., 1.)
	for n = 1 to max
		DestroyImage(images[n])
	createUnit(Player(0), 'hfoo', vec2(0., 0.), angle(0.))
	for n = 1 to max
		DestroyImage(images[n])

I managed to mess up the selection circles. They pop up at wrong units, dont disappear on deselection or sometimes a unit has two circles (as can be seen in the picture).
However i didnt manage to manipulate the hp bars, arent those images? Or are they just updated too frequently (since they have to adapt to the units health...)?
 
Cool.

However i didnt manage to manipulate the hp bars, arent those images? Or are they just updated too frequently (since they have to adapt to the units health...)?

Well, some things may be inherently part of the wc3 engine/hardcoded. Selection circles and shadows are very convenient as images since they are just centered at the unit's position and don't require a 3rd dimension. Hp bars are a bit more dynamic (e.g. when you scroll down they still face you, whereas images lie flat on the terrain). I think that hp bars are just billboarded models.

One neat thing that may help:
JASS:
function I2Image takes integer id returns image
    call SaveFogStateHandle(hash, 0, 0, ConvertFogState(id))
    return LoadImageHandle(hash, 0, 0)
endfunction

You can iterate through a loop starting at 0x100000 and increment by 1. iirc you can just check if I2Image(<id>) != null, and then that means there is an image in that slot (that handle ID).
 
Status
Not open for further replies.
Top