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!
i am not sure cause its been a long time since mapping for me but try out the following:
I found an old testmap of mine where i implemented something like this.
Its quite difficult cause u have to calculate and do the damage by yourself.
This is my Trigger-Code
Code:
Trigger Unit Attack
Events
Unit - A unit Is attacked
Conditions
(Attacking unit) Equal to AD&D Hero 0000 <gen>
Actions
Trigger - Turn off (This trigger)
Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) + 1.00)
Set DamageP[1] = (Random integer number between WeaponMinDamageP[1] and WeaponMaxDamageP[1])
Floating Text - Create floating text that reads (String(DamageP[1])) above (Attacked unit) with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
Set DamageInfoP[1] = (Last created floating text)
Unit - Set life of (Attacked unit) to ((Life of (Attacked unit)) - (Real(DamageP[1])))
Wait (10.00 / (Real((Agility of AD&D Hero 0000 <gen> (Include bonuses))))) seconds
Floating Text - Destroy DamageInfoP[1]
Trigger - Turn on (This trigger)
hmm i dont really get it am not good with variables, too lazy to learn them and all... i think i can do things without variables so i dont wanna learn them, i think the count hits can be found or made in the condition->intger condition.
Heh, and how do you want to put value in condition withouth variable? Variables are your friends and it is really easy - imo easiest than write your last post
ok i found this way but i dont know if its gonna work or not, it doesnt need variable, ok first i make a small lil unit and put it anywhere in the make, then i make a item with 100charge and give it to the unit, then do trigger if a unit attacks use 1 charge, then if then item reachs 0 charge remove item and and give it another 100charge, and add 1 damage to attacking unit, btw this might work with no variable but how do i add 1 damage. :\
EDIT:
Heh, and how do you want to put value in condition withouth variable? Variables are your friends and it is really easy - imo easiest than write your last post
hm.. alot of people said variable is easy, but i dont find a good way to use them, or i dont even know how to learn them, i try to mess around with them, but its only set this unit = last create unit or so...
A variable is an object which can be everything. There r different datatypes of variables i. e. Integer (Only round numbers) String (Text) Float (Numbers)
You have to set a Variable i. e.
Set Integer1 = 5
Later then u can use this Variable
Set Hitpoints of X Unit to Integer1
Why is it useful?
One advantage is that it helps you with modifiing ur map i. e.
instead of changing one value in all your triggers (like add X hp) u have only to change the variable if u r using it.
Unit - Set the custom value of UNIT to ((Custom value of UNIT)) + 1)
Like, you would increase that value each time you hit, and once it becomes 99... etc...
This should not be of any problems.
(Unless you already used custom value for another purpose...)
2.)
Now if you are already using custom values for a unit for another purpose after all, you would have to use gamecache, which requires some knowledge with JASS.
JASS:
function game_cache takes nothing returns gamecache
if (udg_gamecache==null) then
call FlushGameCache(InitGameCache("hax.w3v"))
set udg_gamecache=InitGameCache("hax.w3v")
endif
return udg_gamecache
endfunction
function SetHandleInt takes handle subject, string name, integer value returns nothing
if value==0 then
call FlushStoredInteger(game_cache(),I2S(H2I(subject)),name)
else
call StoreInteger(game_cache(), I2S(H2I(subject)), name, value)
endif
endfunction
This "stores" an integer into a unit, meaning, you will be able to retrieve the stored integer from that unit anytime,using
JASS:
function GetHandleInt takes handle subject, string name returns integer
return GetStoredInteger(game_cache(), I2S(H2I(subject)), name)
endfunction
This basicly does the same as Custom Values.
K', that's it for counting hits, now counting damage is a totally different story, but unfortunately I didn't get what you wanted...
Do you want to save the total damage dealt?
Then use the same procedure as before, only that this time:
JASS:
function GetHandleReal...
Store Reals instead of Integers
Oh and, your sense of "not using global variables as much as possible" is a right way to think.
You should learn JASS, I feel you can do it.
thx, i always wanted to know some JASS, but i try to learn it its too hard, i was only up to the converting triggers into text, and the rest i dont really get, so i was thinking ill learn them the normal way, like the normal way i learn how do use WE, i didnt take no tutorial and stuff just comes by.
btw thx for posting the JASS but i dont get it, so am not gonna use it, i dont use the stuff i dont know sry.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.