• 🏆 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!

Simple pick hero with trackable (FOR GUI USER)

This code inside trigger just test, so you can use it for some stuff and you will understand trackable by using samples of this code :).......

SORRY FOR MY BAD ENGLISH

  • Trackable
  • Trackable
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Custom script: local trackable tr
      • -------- ------------------------- --------
      • -------- Configuration --------
      • -------- ------------------------- --------
      • Custom script: set udg_T_HASH = InitHashtable()
      • Set T_COUNT = 1
      • -------- ------------------------- --------
      • -------- Trackable Path --------
      • Set T_PATH = war3mapImported\64x64Track.mdx
      • -------- Region create icon --------
      • Set T_RECT = IconCreator <gen>
      • -------- Min distance between 2 icon creating --------
      • Set T_MIN = 200.00
      • -------- When the system reached this value, it will automatically down to the next row --------
      • Set T_MAX = 400.00
      • -------- Down row distance --------
      • Set T_ROW_DISTANCE = 100.00
      • -------- This value is very useful, don't touch this ;) --------
      • Set T_ANGLE = -90.00
      • -------- Effect when you clicking an icon --------
      • Set T_EFFECT = Abilities\Spells\Undead\AnimateDead\AnimateDeadTarget.mdl
      • -------- Trigger get event you click --------
      • Set T_TRIGGER = Track Hero <gen>
      • -------- Region create a review unit --------
      • Set T_REVIEW = Review <gen>
      • -------- ------------------- --------
      • -------- ------------------- --------
      • -------- CONFIGURATION --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Paladin
      • Set T_DES_TYPE[T_INT] = (HERO) Paladin
      • Set T_INFO[T_INT] = Warrior Hero, exceptional at defense and augmenting nearby friendly troops. Can learn Holy Light, Divine Shield, Devotion Aura and Resurrection.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Archmage
      • Set T_DES_TYPE[T_INT] = (HERO) Arch
      • Set T_INFO[T_INT] = Mystical Hero, adept at ranged assaults. Can learn Blizzard, Summon Water Elemental, Brilliance Aura and Mass Teleport.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Mountain King
      • Set T_DES_TYPE[T_INT] = (HERO) Mount
      • Set T_INFO[T_INT] = Warrior Hero, adept at offensive combat and disrupting enemy troops. Can learn Storm Bolt, Thunder Clap, Bash and Avatar.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Blood Mage
      • Set T_DES_TYPE[T_INT] = (HERO) Blood
      • Set T_INFO[T_INT] = Mystical Hero, adept at controlling magic and ranged assaults. Can learn Flame Strike, Banish, Siphon Mana and Phoenix.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Blademaster
      • Set T_DES_TYPE[T_INT] = (HERO) Bl
      • Set T_INFO[T_INT] = Cunning Hero, adept at quickly killing individual units and creating confusion among enemies. Can learn Mirror Image, Wind Walk, Critical Strike and Bladestorm.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Far Seer
      • Set T_DES_TYPE[T_INT] = (HERO) FS
      • Set T_INFO[T_INT] = Mystical Hero, effective at ranged attacks and scouting. Can learn Chain Lightning, Far Sight, Feral Spirit and Earthquake.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Tauren Chieftain
      • Set T_DES_TYPE[T_INT] = (HERO) TR
      • Set T_INFO[T_INT] = Warrior Hero, exceptional at absorbing damage and melee combat. Can learn Shockwave, War Stomp, Endurance Aura and Reincarnation.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Shadow Hunter
      • Set T_DES_TYPE[T_INT] = (HERO) SD
      • Set T_INFO[T_INT] = Cunning Hero, adept at healing magics and voodoo curses. Can learn Healing Wave, Hex, Serpent Ward and Big Bad Voodoo.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Death Knight
      • Set T_DES_TYPE[T_INT] = (HERO) DK
      • Set T_INFO[T_INT] = Warrior Hero, evil counterpart to the Human Paladin. Can learn Death Coil, Death Pact, Unholy Aura, and Animate Dead.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Lich
      • Set T_DES_TYPE[T_INT] = (HERO) L
      • Set T_INFO[T_INT] = Mystical Hero, particularly adept at cold magic. Can learn Frost Armor, Frost Nova, Dark Ritual and Death And Decay.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Dreadlord
      • Set T_DES_TYPE[T_INT] = (HERO) DL
      • Set T_INFO[T_INT] = Cunning Hero, adept at controlling combat. Can learn Carrion Swarm, Sleep, Vampiric Aura, and Inferno.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Crypt Lord
      • Set T_DES_TYPE[T_INT] = (HERO) CL
      • Set T_INFO[T_INT] = Warrior Hero, adept at summoning insect minions and crushing enemies. Can learn Impale, Spiked Carapace, Carrion Beetles and Locust Swarm.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Keeper of the Grove
      • Set T_DES_TYPE[T_INT] = (HERO) KP
      • Set T_INFO[T_INT] = Mystical Hero, adept at using nature spells. Can learn Entangling Roots, Force of Nature, Thorns Aura, and Tranquility.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Priestess of the Moon
      • Set T_DES_TYPE[T_INT] = (HERO) PM
      • Set T_INFO[T_INT] = Warrior Hero, adept at enhancing ranged attacks and slaying enemies from afar. Can learn Scout, Searing Arrows, Trueshot Aura, and Starfall.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Demon Hunter
      • Set T_DES_TYPE[T_INT] = (HERO) DM
      • Set T_INFO[T_INT] = Cunning Hero, adept at maneuvering through battles. Can learn Immolation, Evasion, Mana Burn, and Metamorphosis.
      • -------- ------------------- --------
      • Set T_INT = (T_INT + 1)
      • Set T_UNITS[T_INT] = Warden
      • Set T_DES_TYPE[T_INT] = (HERO) WD
      • Set T_INFO[T_INT] = Cunning Hero, adept at entering and escaping combat. Can learn Blink, Fan of Knives, Shadow Strike and Vengeance.
      • -------- ------------------- --------
      • Set T_TOTAL = T_INT
      • Set T_INT = 1
      • -------- ------------------- --------
      • -------- ------------------- --------
      • -------- END CONFIGURATION --------
      • -------- ------------------- --------
      • -------- ------------------- --------
      • For each (Integer T_INIT) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Player(T_INIT)) controller) Equal to User
              • ((Player(T_INIT)) slot status) Equal to Is playing
            • Then - Actions
              • Set T_COUNT = (T_COUNT + 1)
              • For each (Integer T_INT) from 1 to T_TOTAL, do (Actions)
                • Loop - Actions
                  • -------- Create the path visible for 1 player only --------
                  • Custom script: if GetLocalPlayer() == Player(udg_T_INIT-1) then
                  • Set T_S = T_PATH
                  • Custom script: endif
                  • -------- ------------- --------
                  • -------- Get X,Y,O,Z --------
                  • Custom script: set udg_T_X = GetRectCenterX(udg_T_RECT) + udg_T_Row_Creator * Cos(udg_T_ANGLE*0.01747)
                  • Custom script: set udg_T_Y = GetRectCenterY(udg_T_RECT) + udg_T_Row_Creator * Sin(udg_T_ANGLE*0.01747)
                  • Custom script: set udg_T_O = udg_T_X + udg_T_Creator * Cos(0.01747)
                  • Custom script: set udg_T_Z = udg_T_Y + udg_T_Creator * Sin(0.01747)
                  • -------- Create Trackable --------
                  • Custom script: set tr = CreateTrackable(udg_T_S,udg_T_O,udg_T_Z,0.)
                  • -------- Save Data --------
                  • Custom script: set udg_T_INTEGER = GetHandleId(tr)
                  • Hashtable - Save T_INIT as 0 of T_INTEGER in T_HASH
                  • Hashtable - Save T_INT as 1 of T_INTEGER in T_HASH
                  • Hashtable - Save T_O as 2 of T_INTEGER in T_HASH
                  • Hashtable - Save T_Z as 3 of T_INTEGER in T_HASH
                  • -------- Register Trigger For Trackable --------
                  • Custom script: call TriggerRegisterTrackableHitEvent(udg_T_TRIGGER,tr)
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • T_Creator Less than or equal to T_MAX
                    • Then - Actions
                      • Set T_Creator = (T_Creator + T_MIN)
                    • Else - Actions
                      • Set T_Creator = 0.00
                      • Set T_Row_Creator = (T_Row_Creator + T_ROW_DISTANCE)
                  • -------- Begin Create Track and Destructable --------
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • T_Destructable[T_INT] Equal to No destructible
                    • Then - Actions
                      • Custom script: set udg_T_Destructable[udg_T_INT] = CreateDestructable(udg_T_DES_TYPE[udg_T_INT],udg_T_O,udg_T_Z,0.,1.,0)
                    • Else - Actions
            • Else - Actions
          • Custom script: call TriggerRegisterPlayerEvent(gg_trg_PlayerLeft, Player(udg_T_INIT), EVENT_PLAYER_LEAVE)
      • Custom script: set tr = null
  • Track Hero
    • Events
    • Conditions
    • Actions
      • -------- This trigger takes data of trigger Trackable --------
      • -------- Load trackable you clicked --------
      • Custom script: local trackable tr = GetTriggeringTrackable()
      • -------- Begin load data --------
      • -------- id = number of trackable --------
      • Custom script: local integer id = LoadIntegerBJ(1,GetHandleId(tr),udg_T_HASH)
      • -------- Load player --------
      • Custom script: local player p = Player(LoadIntegerBJ(0,GetHandleId(tr),udg_T_HASH))
      • -------- x,y for effect --------
      • Custom script: local real x = LoadRealBJ(2,GetHandleId(tr),udg_T_HASH)
      • Custom script: local real y = LoadRealBJ(3,GetHandleId(tr),udg_T_HASH)
      • -------- Stuff --------
      • Custom script: local unit u
      • -------- You must set this value = 100 to make unit invisible for other player --------
      • Set T_VISIBLE = 100.00
      • -------- Create effect and unit visible for 1 player only --------
      • Custom script: if GetLocalPlayer() == p then
      • Set T_S = T_EFFECT
      • -------- Then set it = 0, T_VISIBLE = 0.00 on this player click trackable, and other, it = 100. --------
      • Set T_VISIBLE = 0.00
      • -------- Clear Text Messages --------
      • Custom script: call ClearTextMessages()
      • Custom script: endif
      • -------- ------ --------
      • Custom script: call DestroyEffect(AddSpecialEffect(udg_T_S,x,y))
      • -------- ------ --------
      • Custom script: call RemoveUnit(LoadUnitHandleBJ(0,GetPlayerId(p),udg_T_HASH))
      • Custom script: if GetUnitTypeId(LoadUnitHandleBJ(GetPlayerId(p),0,udg_T_HASH)) == udg_T_UNITS[id] then
      • -------- IMPORTANT: THIS LINE JUST TEST, YOU MUST TO EDIT IT --------
      • Custom script: set udg_TEST_HERO[GetPlayerId(p)] = CreateUnit(p,udg_T_UNITS[id],GetRectCenterX(gg_rct_W),GetRectCenterY(gg_rct_W),0.)
      • -------- --------Clean Leak and Flush Data-------- --------
      • -------- ------ --------
      • Set T_COUNT = (T_COUNT - 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • T_COUNT Equal to 0
        • Then - Actions
          • Hashtable - Clear T_HASH
          • Custom script: call DestroyTrigger(udg_T_TRIGGER)
        • Else - Actions
      • Custom script: set tr = null
      • -------- Return nothing --------
      • Custom script: return
      • -------- ----------------------------------------------------------------- --------
      • Custom script: endif
      • -------- ------ --------
      • -------- Create unit for review --------
      • Custom script: set u = CreateUnit(p,udg_T_UNITS[id],GetRectCenterX(udg_T_REVIEW),GetRectCenterY(udg_T_REVIEW),0.)
      • -------- Text --------
      • Custom script: call DisplayTextToPlayer(p,0,0,"Hero Name:"+ GetUnitName(u))
      • Custom script: call DisplayTextToPlayer(p,0,0,udg_T_INFO[id])
      • Custom script: call DisplayTextToPlayer(p,0,0,"Click Again to choose this hero")
      • -------- Save this unit !! --------
      • Custom script: call SaveUnitHandleBJ(u,0,GetPlayerId(p),udg_T_HASH)
      • -------- This line make unit visible --------
      • Custom script: call UnitAddAbility(u,'Aloc')
      • Custom script: call SetUnitPathing(u,false)
      • Custom script: call SetUnitPosition(u,GetRectCenterX(udg_T_REVIEW),GetRectCenterY(udg_T_REVIEW))
      • Animation - Change (Last created unit)'s vertex coloring to (100.00%, 100.00%, 100.00%) with T_VISIBLE% transparency
      • -------- Recycle --------
      • Custom script: set tr = null
      • Custom script: set u = null
  • [/HIDDEN]
--------------------------------
Using this code when player has left the game :)
  • PlayerLeft
    • Events
    • Conditions
    • Actions
      • Game - Display to (All players) for 30.00 seconds the text: ((Name of (Triggering player)) + OUT !)
      • Set T_COUNT = (T_COUNT - 1)
      • -------- Clean Data --------
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • T_COUNT Equal to 0
        • Then - Actions
          • Hashtable - Clear T_HASH
          • Custom script: call DestroyTrigger(udg_T_TRIGGER)
          • Custom script: call DestroyTrigger(GetTriggeringTrigger())
        • Else - Actions
Keywords:
trackable, gui, pick, hero
Contents

Trackable for GUI USER (Map)

Reviews
Simple pick hero with trackable | Reviewed by Maker | 29th Sep 2013 APPROVED The system works but it lacks features and polish [tr] Get rid of the bj functions in the custom scripts Using abyss reserves a tile type...

Moderator

M

Moderator


Simple pick hero with trackable | Reviewed by Maker | 29th Sep 2013
APPROVED


126248-albums6177-picture66521.png


  • The system works but it lacks features and polish
126248-albums6177-picture66523.png


  • Get rid of the bj functions in the custom scripts
  • Using abyss reserves a tile type. You could use Textures\Black32.blp
  • Lock the camera
  • You should hide the stuff when not in pick mode
[tr]
 
Level 22
Joined
Aug 27, 2013
Messages
3,973
Yeah, I can do that after i turning ofel into a ghost, it does'nt hurt you, right

  • Unit - Turning ofel into a ghost
JASS:
call MakeOfelKute(false)
if GetLocalPlayer() == GetOwningPlayer(Ofel) then
call MakeOfelKute(true)
endif
You know what i mean right Rheiko :p
@Mage: Yes yes, you're right, i'll fix it right now
yeh, i know :p
now he has turned into a Ghost
Rider
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
Yes your GUI Functions is different.... Are you using a 3rd Party Tool??? or UMSWE??
:((
  • Unit - Remove (Load (GetPlayerId(p)) of 0 in T_HASH) from the game
Where did you get GetPlayerId() in GUI Functions?
 
Level 20
Joined
Aug 13, 2013
Messages
1,696
No I think this codes can be done in JNGP in vJASS Codes. I don't think so GUI with vJASS Codes???? So the Regular or Normal WE can't open it.. I have JNGP in here but It can't open too.

@nhocklanox

why you make this in GUI????
Why not vJASS? ( because I know your Good at vJASS )
 
Before Reading, I hope you don't get offended, if you did get offended by my post, then I'm sorry

Honestly guys, I understand why UMSWE aren't allowed for spells and system for Hive Spells Section, but keep in mind that UMSWE is not that buggy. If we talk about UMSWE 4.0, then I understand, but UMSWE 5.0 [from JNGP] is way advanced and no longer bugs a lot[except throw some error during load of WE].

Almia said:
UMSWE is never been advanced. It just creates a GUI version of the native.
but that doesn't mean it's that buggy, if not, UMSWE never been available at JNGP.

jakeZinc said:
But Dr.Super_Good told that from me when Using UMSWE. "( I think )" means with no offense who created that 3rd party tool
I believe you refer to this post actually.

Okay, if anybody wonder why UMSWE aren't allowed, then here's my explanation :
UMSWE has advanced triggers, which causes crash to both WE and Normal JNGP, to react to this issue, the Hive Workshop has disallowed usage of Third Party GUI Modification as stated in the Submission Rules.
this line :
Your spell must be made using Vanilla GUI (aka. Triggers), JASS, vJASS, Zinc and under very special circumstances, cJASS. No third party languages will be accepted. If you have designed such a language and wish to have it standardized, contact the staff and present your language.)
 
Top