HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

need help making stat gain auras

10-19-2006, 07:04 AM#1
Nazra7
i need help making a stat gain aura for my pet system. like strength and intelegence. im having a problem because i want to make it to when you use the item called bow meow it will summon a bow meow and when the bow meow is within 500 range of the unit which summoned it it gives + stats.

it will not let me pick a unit variable so i have no idea how i can do this. please help me.
10-19-2006, 07:18 AM#2
Fr0zenLord
(Unit variable, name = Pet, array size number of players u have)
Trigger:
Event - A unit uses an item
Conditions item equal to Bow Meow
Collapse Actions - wait .01 seconds
- pick every unit in units of type "Pet Meow" matching condition matching unit belongs to owner of hero manipulating item (Its a bool condition)
- set Pet[Player Number Of Owner Of Hero Manipulating item] = picked unit
(Point var, named Point, array size 1)
(Unit var, name PlayerHero, array size number of players you have)

Trigger:
Event - Map initilization
Conditions
Collapse Actions - set PlayersHero[1] = Player 1 reds hero
- set PlayerHero[2] = Player 2 blues hero (Do that for all players)
if they are bought

Trigger:
Event - A unit is sold
Conditions
Actions - Set PlayerHero[Player Number Of Owner Of Sold Unit] = Sold Unit
Trigger:
Event - Every 1 second
Conditions
Collapse Actions - For each integer A from 1 to 12
Collapse - set Point[0] = position of PlayerHero[Integer A]
Collapse set Point[1] = Position of Pet[Integer A]
Collapse if then else multiple functions
if conditions distance between Point[0] and Point[1] less than or equal to 550
- then actions - hero modify strength of PlayerHero[Integer A] add 1
Collapse - call RemoveLocation(udg_Point[0])
- call RemoveLocation(udg_Point[1])

MAKE SURE the above is in the loop, of the integer A

tell me if it works
10-19-2006, 08:35 AM#3
Fireeye
Sorry Fr0zenLord, but your solution have a big problem.
Take a look in the 4th Trigger, you didn't make a condition when it's already in range, so it will give a endless bonus.
Add a normal Boolean variable with array and set it true when the unit is in range if not set it false.
Then it should work without the problem.
10-19-2006, 09:18 AM#4
Nazra7
frozenlord i came across a problem. where it says point[0] and [1] i had to replace with the variables PP(petpoint) and HP(Heropoint) which both have a index of 8. this is because there are 8 players in the map. and each player can have a pet and i only want the players pet to only effect them and no other players. so where it would say set variable HP[?] the ? is the problem. how am i supposed to make it know what index it should be? i cant use owner of variable "pet" becuase that also has an index of 8 which is needed.
10-19-2006, 09:50 AM#5
Fr0zenLord
Fireeye, look a bit closer

Trigger:
if conditions distance between Point[0] and Point[1] less than or equal to 550

if what you meant is, it gaining endless stats if its within range, that is what I intended it to do... Nazra7 can configure it to how he wants

And, you only need Hp[0], and PetPoint[0], you dont need 8 for each, trigger 4 works, for all players

Trigger:
Event - Every 1 seconds
Conditions
Collapse Actions - For each integer A from 1 to 8
set HP = position of PlayerHero[Integer A]
Collapse set PP = Position of Pet[integer A]
Collapse if then else multiple functions
Collapse if conditions Distance Between HP and PP less then or equal to 550
- Owner of Pet[Integer A] equal to Owner Of PlayerHero[Integer A]
then actions - modify hero strength of PlayerHero[Integer A] Add 1
call RemoveLocation(udg_HP)
call RemoveLocation(udg_PP)

You dont need an array for each player

It will set HP = position of PlayerHero[1], and PP = position of Pet[1]

It checks distance, if less then or equal to 550, it adds a str point

Then it does it again, for PlayerHero[2], and Pet[2], then 3, then 4, you dont need multiple's
10-19-2006, 10:04 AM#6
Nazra7
ok i see but heres another problem i dont get... where it says set variable hp = position of unit how am i suposed to make it know what unit speficly i want it to set to? in my map when you start your hero isnt there it does not exsist until you pick it. same with the pet. if interger A has somthing to do with this please tell me because i dont understand it. also how do i set it like that.... position of heroplayer[intergera]?

EDIT OH OK sorry i didnt read the post throughlly. the thing about how i am supposed to make it know what hero unit in spefic ... ok i know what to do thanks frozenlord.