Variables To Players

xmkiller

New Member
Reaction score
6
This is kinda hard to explain..

Alright so what I have right now is..

variable1[player number of (owner of (casting unit))] = variable1[player number of (owner of (casting unit))] + 1

Now would this mean that each player will have a seperate number?

Lets say that player 1 casts the spell 4 times, so variable 1 would be 4 for him. Then lets say player 2 casts the spell 3 times. Would the variable stay at 4 for player 1 and 3 for player 2?

If thats true..

What I would want is that if a player is holding an item it will give that player variable1[player number of (owner of (casting unit))] = 4. But I reliezed that the array wouldn't work because the unit isnt casting anything. So if i change it to is carring an item. But if the player casts then it wouldnt work with "is carring the item".

Im trying to make as much sense as I can. For Example this is what its suppose to do.


Items give +spell damage.
When the caster casts I want the +spell damage to add to the damage that it has done.

I already know how to do all of that except for calculating the spell damage for each player INDIVIDUALY.


I hope this makes sense.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
I hope this makes sense
not at all.......
i thought i understood what u want at the start but then u started with the item and i didn't get what u wanna do...
so try explain in a more simple way of what u are trying to do....
 

xmkiller

New Member
Reaction score
6
Ok um


Some items have something i added called "Spell Damage". What it does is it adds damage to abilities (All my abilities are trigger based).

An example of the variable I use to track how much "Spell Damage" the player has is..

Set hero_spellDamage[(Player number of (Owner of (Item carried by (Hero manipulating item) in slot 1)))] = ((Player number of (Owner of (Item carried by (Hero manipulating item) in slot 1))) + 1)

Now the problem is that when the hero thats carring the item casts a spell, it will do damage based on how much hero_spellDamage is. But since the variable is "Owner of Item Carried by Hero" and not "Owner of Casting Unit" it wont know the variable hero_spellDamage for that player.
 

PurgeandFire

zxcvmkgdfg
Reaction score
508
I'm still confused, but simply put, do you mean that it can't track the spell damage, but it can for regular damage? :confused: :confused:
 

xmkiller

New Member
Reaction score
6
No no, im wondering if theres another way to do it. Because it wont work. If the unit casts a spell and since the variable array is "Item carried by hero" the varriable array wont work. It has to be "owner of casting unit", does it not?
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
well it's the same thing basically cuz let me expalin it like that:
Variable[Player number of (triggering player)] = 1 - now let's say triggering player is 1, so it's simply sets Variable[1] = 1

now if u use this with something like:
Variable[Owner of (Casting unit)] = 2 - it would simply use the same as be4 in case it's the same player since they (the same player's numbers) are the same number of this player so they are both - Variable[1]

so if u do "Owner of Item Carried by Hero" or "Owner of Casting Unit" u would simply end using the same array number in case it's the same player of course.

u get it?
 

xmkiller

New Member
Reaction score
6
Ok so aslong as I have "Player number of" it wont mix between players even if i have "Player number of owner of casting unit" and "Player number of owner of manipulating hero" ?
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
look it just takes the number so it's simply the same between owner of casting unit and owner of manipulating hero just all u need to make sure is that it's the same player cuz if it's 1 then both will be 1
and don't worry it won't mix in cases like this
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top