• 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.

[Trigger] Trying to make Unit Specific Ability Triggers

Status
Not open for further replies.
Level 16
Joined
Aug 20, 2009
Messages
1,554
hello..

i will explain about the system

the hero selection system is like dota's selection system

where you pick your hero from a tavern

and there is a Hero Core, which contains the 2nd hero's ability

how can i trigger give ability of type XYZ according to the hero we pick to the Hero Core?

there is 4 diffrent ability inside hero core for each diffrent heroes, so...

i wanted to make it like

Event
Map Initialization
Action
Set HeroCore[1] = Hero Core 001 Gen
------------Setup Specific Hero Ability-----------------------
Set SpecAbility [PointValueofHeroPicked(which is 1 for this hero type)[1(Ability Type 1)]] = Shockwave
Set SpecAbility [PointValueofHeroPicked(which is 1 for this hero type)[2(Ability Type 2)]] = Storm Bolt
Set SpecAbility [PointValueofHeroPicked(which is 1 for this hero type)[3(Ability Type 3)]] = WarStomp
Set SpecAbility [PointValueofHeroPicked(which is 1 for this hero type)[4(Ability Type 4)]] = Blizzard

Then, i tried to give it to the unit after the hero was picked

and i came to this
Loop for Integer A from 1 to 4
Give "SpecAbility [Point Value of Sold Unit]" to Hero Core [Player Number(Owner of Buying Unit)]

and i can't seem to put another array in the Spec Ability Variable...

i wanted to make it so that it become like this
Loop for Integer A from 1 to 4
"SpecAbility [Point Value of Sold Unit[Integer A]] to Hero Core [Player Number(Owner of Buying Unit)]

i am aware of hashtable, but i can't understand how to use it,
since the Save - Ability Handle
trigger seems so weird, i am confused +__+

can anyone show me how to do do this?..
+REP for Helper, and usefull Replyer whos trying to help me properly. :D
 
Last edited:
Level 16
Joined
Aug 20, 2009
Messages
1,554
well, inside the SpecAbility Array,

if i really does input "Point value of sold unit type"

how can i set up the ability numbers? (hero ability type of that certain hero is set up with numbers)

i used Hero's Point Value to diffrentiate each hero type
And 1, 2, 3, 4 as their skills in Hero Core

1 is 1st skill for Hero Core
2 is 2nd skill for Hero Core
3 is 3rd skill for Hero Core
4 is Ultimates for the Hero Core

See the one below...
"-----
Set SpecAbility [1][1] = Shockwave
Set SpecAbility [1][2] = Storm Bolt
Set SpecAbility [1][3] = WarStomp
Set SpecAbility [1][4] = Blizzard
[1] is the Hero's Point Value, in the Map initialization where i set it up...so, when it comes picking unit, i can use the Sold unit's point value to set the ability for Hero Core..
"-------

See the 1 2 3 4 numbers, there are 4 abilities, and i want them for LoopInteger A

i want all of them in the Hero Core when i buy the unit from tavern +__+

help me pleasee D:

SpecAbility[PointValueofHeroPicked[Point value of (Sold unit)]] <--- Your code only contains what type of hero it were...

its hard to explain , my english is my 3rd language, so maybe my explanation is dumb -__-"
sorry for the bad explanation






\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Cut those All\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


can you help me if i give you some sample map?

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\Cut those again\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


Anyway, i just need an Ability Variable, with 2 Array !!

So it looks like this

SpecAbility [Integer][Integer]

The First Integer, i want to fill it with the Hero's Point Value
The Second Integer, i want to fill it with ability type integer

With this Double integer, i want to set up my skills at map initialization, and give them with Sold Hero's Refference

like

1st trigger -----------------------------------------
"map initialization"
"Set HeroCore = Hero core 124Gen(A unit on my map)"
"Set SpecAbility [52] [1] = Shockwave"
"Set SpecAbility [52] [2] = Thunderclap"
"Set SpecAbility [52] [3] = Warstomp"
"Set SpecAbility [52] [4] = Storm Bolt"


2nd trigger-----------------------------------------
"Unit is Sold"
"Sold unit is a hero equals to true"
"For loop Integer A 1 to 4"
"Give "SpecAbility [Point Value of Sold Hero] [Integer A] to "HeroCore [Player Number of Owner Of Buying Unit]"

can somebody made this kind of trigger for me? its pretty complete in my description, but i can't seem to find any other way than Hashtable, and i don't understand hash tables at all...

can somebody made this for me???? i heard there is a way for double arrays in hash....

i have complete null intelegent when it comes to hash...
 
Last edited:
Level 16
Joined
Aug 20, 2009
Messages
1,554
i don't really understand what are you saying +___+"...

that hero has a set of ability for another unit,
so if you pick that hero, the other unit get a set of special ability just given if he got that type of hero, other type of heroes has a diffrent set...\\anyway, reread above, i redid my words\\
 
Ok, I made it.
The main trigger lies in the Map Initialization; this is where you set the abilities and the units. In order to add more unit types,
  • Actions
    • Custom script: local integer array abilities
    • Custom script: local integer i = 0
    • Custom script: local integer i2 = 4
    • Hashtable - Create a hashtable
    • Set Hash = (Last created hashtable)
    • -------- ------------------ --------
    • -------- Unit-types' Set Up --------
    • -------- ------------------ --------
    • Set UnitsUsed[1] = Paladin
    • Set UnitsUsed[2] = Archmage
    • Set UnitsUsed[3] = Death Knight
    • Set UnitsUsed[4] = Demon Hunter
    • -------- ------------------ --------
    • -------- Paladin's abilities --------
    • -------- ------------------ --------
    • Custom script: set abilities[1] = 'AHhb'
    • Custom script: set abilities[2] = 'AHds'
    • Custom script: set abilities[3] = 'AHad'
    • Custom script: set abilities[4] = 'AHre'
    • Custom script: loop
    • Custom script: exitwhen i == i2
    • Custom script: set i = i + 1
    • Custom script: call SaveInteger (udg_Hash, udg_UnitsUsed[1], StringHash("abilities" + I2S (i)), abilities[i])
    • Custom script: endloop
    • Custom script: set i = 0
    • -------- ------------------ --------
    • -------- Archmage's abilities --------
    • -------- ------------------ --------
    • Custom script: set abilities[1] = 'AHbz'
    • Custom script: set abilities[2] = 'AHwe'
    • Custom script: set abilities[3] = 'AHab'
    • Custom script: set abilities[4] = 'AHmt'
    • Custom script: loop
    • Custom script: exitwhen i == i2
    • Custom script: set i = i + 1
    • Custom script: call SaveInteger (udg_Hash, udg_UnitsUsed[2], StringHash("abilities" + I2S (i)), abilities[i])
    • Custom script: endloop
    • Custom script: set i = 0
    • -------- ------------------ --------
    • -------- Death Knight's abilities --------
    • -------- ------------------ --------
    • Custom script: set abilities[1] = 'AUdc'
    • Custom script: set abilities[2] = 'AUdp'
    • Custom script: set abilities[3] = 'AUau'
    • Custom script: set abilities[4] = 'AUan'
    • Custom script: loop
    • Custom script: exitwhen i == i2
    • Custom script: set i = i + 1
    • Custom script: call SaveInteger (udg_Hash, udg_UnitsUsed[3], StringHash("abilities" + I2S (i)), abilities[i])
    • Custom script: endloop
    • Custom script: set i = 0
    • -------- ------------------ --------
    • -------- Demon Hunter's abilities --------
    • -------- ------------------ --------
    • Custom script: set abilities[1] = 'AEmb'
    • Custom script: set abilities[2] = 'AEim'
    • Custom script: set abilities[3] = 'AEev'
    • Custom script: set abilities[4] = 'AEme'
    • Custom script: loop
    • Custom script: exitwhen i == i2
    • Custom script: set i = i + 1
    • Custom script: call SaveInteger (udg_Hash, udg_UnitsUsed[4], StringHash("abilities" + I2S (i)), abilities[i])
    • Custom script: endloop
    • Custom script: set i = 0
You can see how each, respective ability set is stored on the UnitsUsed variable. You will need the rawcodes of the abilities of your heroes. To do that, go to Object Editor and press Ctrl + D, to display them as raw values. then, replace those 'AUau' with your ability, e.g. 'A001'.

For every new unit type you are going to add in the list, make the following changes:
• Copy paste from line "Custom script: set abilities[1] = 'AEmb'"...to line "Custom script: set i = 0".

• Change the ability id's from abilities[1] to abilities[4], to match your hero's abilities' set.

• Set UnitsUsed variable, e.g. Set UnitsUsed[5] = (Dark Screamer).

• Swap the array value of your new unit to the following line's value:
call SaveInteger (udg_Hash, udg_UnitsUsed[4], StringHash("abilities" + I2S (i)), abilities)

You see udg_UnitsUsed[4]? Change "4" to the new value, e.g. 5.

Test Map:
View attachment Hero Core.w3x
 
Level 16
Joined
Aug 20, 2009
Messages
1,554
Woahhh!! That helped me a bunch!! Thx a lot !! +REP

but i don't understand, why would you use the custom script?
when there is Save Ability Handle?

or when there is hashtable triggers...provided by blizzard..

i would try to learn some custom script or JASS from here on, its gonna be usefull

well, i tested it, That is Great!! :D it works perfectly :D :D on your map

and i really appreciate your efforts, putting all those colours in the region, and making up to 4 units :D :D...

thx a lot

btw, i got a problem while importing..
but
i realized my problems while importing, thx
 
Last edited:
Status
Not open for further replies.
Top