HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Is this trigger possible in GUI

05-09-2005, 02:21 AM#1
The_AwaKening
I had a jass trigger at one time to change hero portrait order (what function key they are assigned to), but it works no more. I haven't been able to make a gui trigger yet to move their order. Is this even possible.

Would need to be something like a chat trigger (-up) and selected hero would move up one function key. I could post my jass trigger that used to work before blizzard patch 1.17 if this would help.
05-09-2005, 11:46 PM#2
johnfn
Hmm...


Can't you just remove heroes (and store them in the game cache) until you get to the right one, then create them again in the correct order so it works? That should work. I can give you an example if you want.
05-11-2005, 05:16 AM#3
The_AwaKening
An example would be good, I don't follow for sure. The way I had it working before was to add hero to neautral passive and then back to player which moved it to top, to make it simple.
05-11-2005, 06:41 AM#4
PitzerMike
What's the problem with giving it to the neutral player and then back?
I'm doing it that way too and it works just fine.
05-12-2005, 04:55 AM#5
SADISM
Yeah, I'm having problems with this too. I had a little system setup that worked before the 1.17 patch (I've been away a while). Basically it kept a list of the heroes for each player, and then changed owner to the passive comp and back to the player where needed.

Now, the list gets updated properly so I know there's no problem there. If I do a solo game to test, it will work properly. If I do a Bnet game with just myself, it will work. However no hero portraits move when more than 1 player has heroes in the map. And yes, this worked before in multiplayer.

Edit: Johnfn's idea of using game cache to save and restore units does work, although there are some side effects: unit animation reset, new units means enemies have to retarget, possible value relinking depending on the map and if individual units were used in storing information, reset of hp/mp, reset of ability cooldowns, just to name a few.
05-13-2005, 12:09 AM#6
Vexorian
I dunno, MY selection system would get screwed with this
05-13-2005, 12:29 AM#7
SADISM
Quote:
Originally Posted by Lord Vexorian
I dunno, MY selection system would get screwed with this

Yeah, but you don't seem to be doing a loop where you switch hero owners simply for the purpose of changing the portraits. This is my function that ended up working:

Code:
function hps_move takes integer x, integer y, integer p, integer max returns nothing
	local unit u
	local unit v
	local integer i
	if x!=y then
		set u=hps_gethero(p,x)
		call hps_sethero(hps_gethero(p,y),x)
		call hps_sethero(u,y)
	endif
	set v=CreateUnit(Player(p),'Hpal',0,0,270)
	call UnitAddAbility(v,'Aloc')
	call SetUnitOwner(v,Player(15),false)
	set i=1
	loop
		exitwhen i>max
		set u=hps_gethero(p,i)
		call SetUnitOwner(u,Player(15),false)
		call SetUnitOwner(u,Player(p),false)
		set i=i+1
	endloop
	call RemoveUnit(v)
endfunction

While this doesn't work:

Code:
function hps_move takes integer x, integer y, integer p, integer max returns nothing
	local unit u
	local unit v
	local integer i
	if x!=y then
		set u=hps_gethero(p,x)
		call hps_sethero(hps_gethero(p,y),x)
		call hps_sethero(u,y)
	endif
	set i=1
	loop
		exitwhen i>max
		set u=hps_gethero(p,i)
		call SetUnitOwner(u,Player(15),false)
		call SetUnitOwner(u,Player(p),false)
		set i=i+1
	endloop
endfunction

Apparently adding a hero that (which in the game's mind) is the last hero portrait, whether or not its seen by the player, then sacrificing it to the passive comp allows a loop changing unit owner to the passive and back to the player to work. Without the sacrifice, it doesn't work. At all. Hell, I even tried sacrificing the first unit, or any before the last, and it didn't work. A screw up in something I was trying got me to notice it was the last hero that worked.

Edit: Also, I plug in my little sacrificial hero idea into awakening's jass trigger, and it worked as well. Seems like Blizzard's fix in 1.17 did screw up something.

Quote:
Originally Posted by Blizzard from 1.17 Patch Notes
- Fixed Hero icons so their order is now consistent throughout the game.

Guess not all changes are in the WE directly, but in the engine.
05-13-2005, 04:09 PM#8
Vexorian
NO change is done in the WE directly unless it is a dummy interface one, all the changes are done in the engine
05-13-2005, 04:38 PM#9
SADISM
I saw in another thread someone mentioning that they didn't see any changes to functions in the patch that might cause the problem. Yeah, I blame being tired for not making myself clear, and my gigantic run on sentence. I think what I meant to say is that not all changes are noticable in the WE (functions, constants, etc.) but rather are under the hood without anything obvious having been done.