• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Hero Icon for just an ally, not full control ally

Status
Not open for further replies.
Level 8
Joined
Feb 20, 2007
Messages
338
IF (a big one at that) I set my forces to where there is full unit control for allies I get a hero icon for each hero of that ally.

I want the hero icon (to see its health and mana and of course to right click it) but I do not want to have full control of the ally team (just shared vision).

Its kinda essential for the player to see the health of the ally hero, if that hero dies the game is lost.

Again I do not want full control of ally units, just shared vision.

I did a search, but I am uncertain what it is exactly I am looking for (the name), and I am uncertain if this is a triggering question, game constants, game interface... If it is not a trigger, pardon me for placing this in the wrong forum.

Cheers
 
Level 8
Joined
Feb 20, 2007
Messages
338
If you mean:

  • Player - For Player 1 (Red), turn Full shared units On toward Player 2 (Blue)

It didn't work.

Can you explain a little more what you mean?

Thanks.
 

Dr Super Good

Spell Reviewer
Level 63
Joined
Jan 18, 2005
Messages
27,191
JASS:
function SetPlayerAllianceStateBJ takes player sourcePlayer,player otherPlayer,integer allianceState returns nothing
    if (sourcePlayer == otherPlayer) then
        return
    endif
    if allianceState == bj_ALLIANCE_UNALLIED then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
    elseif allianceState == bj_ALLIANCE_UNALLIED_VISION then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
    elseif allianceState == bj_ALLIANCE_ALLIED then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
    elseif allianceState == bj_ALLIANCE_ALLIED_VISION then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
    elseif allianceState == bj_ALLIANCE_ALLIED_UNITS then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
    elseif allianceState == bj_ALLIANCE_ALLIED_ADVUNITS then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, true  )
    elseif allianceState == bj_ALLIANCE_NEUTRAL then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
        call SetPlayerAlliance( sourcePlayer, otherPlayer, ALLIANCE_PASSIVE, true )
    elseif allianceState == bj_ALLIANCE_NEUTRAL_VISION then
        call SetPlayerAllianceStateAllyBJ(        sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateVisionBJ(      sourcePlayer, otherPlayer, true  )
        call SetPlayerAllianceStateControlBJ(     sourcePlayer, otherPlayer, false )
        call SetPlayerAllianceStateFullControlBJ( sourcePlayer, otherPlayer, false )
        call SetPlayerAlliance( sourcePlayer, otherPlayer, ALLIANCE_PASSIVE, true )
    else
    endif
endfunction

Try just

JASS:
    call SetPlayerAlliance(sourcePlayer, otherPlayer, ALLIANCE_SHARED_ADVANCED_CONTROL, flag)
 
Level 8
Joined
Feb 20, 2007
Messages
338
Just teaching you how to fish.

No your not teaching.

Teaching is where you give the student the tools they need to find things on their own, it is not where you give a half statement and leave the student hanging.

IF this was fishing all you did was hand me some string and a hook, no pole and no instructions on how to use bait, how to cast the line into the water and what signs to look for when a fish takes the bait.

If it was not self evident in my first post that I did not know what I am/was looking for exactly, let me reiterate, I do not know what search terms to use to find this particular bit of information.

I tried "hero icons" in the search engine, take a guess at how many pages came back...

You are not the only one, go and read through these forums, folk post one sentence replies thinking that a person knows what they are talking about. Then the same one line posters complain, moan and groan and are pretty nasty to 'new comers' and their maps.

Better yet do a search for 'hero icons' and read the replies to the many, many questions to get an idea of how the educated on this forum (and others like it) treat the question seekers.
 
Level 14
Joined
Nov 20, 2005
Messages
1,156
No your not teaching.

Teaching is where you give the student the tools they need to find things on their own, it is not where you give a half statement and leave the student hanging.

IF this was fishing all you did was hand me some string and a hook, no pole and no instructions on how to use bait, how to cast the line into the water and what signs to look for when a fish takes the bait.

If it was not self evident in my first post that I did not know what I am/was looking for exactly, let me reiterate, I do not know what search terms to use to find this particular bit of information.

I tried "hero icons" in the search engine, take a guess at how many pages came back...

You are not the only one, go and read through these forums, folk post one sentence replies thinking that a person knows what they are talking about. Then the same one line posters complain, moan and groan and are pretty nasty to 'new comers' and their maps.

Better yet do a search for 'hero icons' and read the replies to the many, many questions to get an idea of how the educated on this forum (and others like it) treat the question seekers.

I gave you the info - you just couldn't be arsed to think about how to do full shared but not shared units. A quick search of the GUI triggers would have told you.
 
Level 6
Joined
Sep 5, 2007
Messages
264
JASS:
function ShowHeroIconForPlayer takes player sourcePlayer, player otherPlayer returns nothing
    call SetPlayerAllianceStateAllyBJ(sourcePlayer, otherPlayer, true)
    call SetPlayerAllianceStateVisionBJ(sourcePlayer, otherPlayer, true)
    call SetPlayerAllianceStateControlBJ(sourcePlayer, otherPlayer, false)
    call SetPlayerAllianceStateFullControlBJ(sourcePlayer, otherPlayer, true)
endfunction

Run this function for both players
IE: For red & blue, use:
JASS:
call ShowHeroIconForPlayer(Player(0), Player(1))
call ShowHeroIconForPlayer(Player(1), Player(0))

When you left click on the hero icon, it doesn't select the allied hero, just zooms to it... but, you can do any normal command on the hero icon (move, attack, cast ability, etc.)
It also shows the "Team Resources" Leaderboard in the top right. :thumbs_up:
 
Level 8
Joined
Feb 20, 2007
Messages
338
JASS:
When you left click on the hero icon, it doesn't select the allied hero, just zooms to it... but, you can do any normal command on the hero icon (move, attack, cast ability, etc.)
It also shows the "Team Resources" Leaderboard in the top right. :thumbs_up:[/QUOTE]

That is what I want, the icon showing and the ability to cast, attack, move to blah.

Thanks.

+rep
 
Level 30
Joined
Sep 30, 2008
Messages
1,460
awesome! This is pretty much was I was looking for as well :)

However, im a bit of a jass newbie :/ Would someone be able to give me some instructions on how to apply that to a map? e.g. what triggers these custom scripts belong to xD or possibly just a working example so i can work it out for myself :D

Sorry to hijack the thread ^^
 
Level 19
Joined
Sep 4, 2007
Messages
2,826
I would guess we could create a script trigger using an initialization event and incorporate those lines. The function would have to be ontop to be able to run.

This is a function:

JASS:
function ShowHeroIconForPlayer takes player sourcePlayer, player otherPlayer returns nothing
    call SetPlayerAllianceStateAllyBJ(sourcePlayer, otherPlayer, true)
    call SetPlayerAllianceStateVisionBJ(sourcePlayer, otherPlayer, true)
    call SetPlayerAllianceStateControlBJ(sourcePlayer, otherPlayer, false)
    call SetPlayerAllianceStateFullControlBJ(sourcePlayer, otherPlayer, true)
endfunction

These lines should be in the same trigger. Functions shouldn't be able to be called from the outside.
JASS:
call ShowHeroIconForPlayer(Player(0), Player(1))
call ShowHeroIconForPlayer(Player(1), Player(0))
 
Status
Not open for further replies.
Top