Doom Angel's Question Thread

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
but acehart said that they all can take up to the same amount of index
Other than that, all arrays have the same maximum number of elements: 8192.
Regardless of size.
so i guess that's not just the index...
 

Chocobo

White-Flower
Reaction score
409
but acehart said that they all can take up to the same amount of index

so i guess that's not just the index...

The index starts from 0, it the maximal index is 8191.

Choosing between 1,50 or 100? It's for map init. When you give it a pre-defined value, it will loop between 0 and the size you put. Example :

MyVar Size = 100
MyVar Value = 3

MyVar[0] = 3
MyVar[1] = 3
MyVar[2] = 3
MyVar[3] = 3
MyVar[4] = 3
MyVar[5] = 3
MyVar[6] = 3
MyVar[7] = 3
MyVar[8] = 3
MyVar[9] = 3
MyVar[10] = 3
...
MyVar[93] = 3
MyVar[94] = 3
MyVar[95] = 3
MyVar[96] = 3
MyVar[97] = 3
MyVar[98] = 3
MyVar[99] = 3
MyVar[100] = 3
MyVar[101] = 0

It stops at 101.

If you put a size to 0, it does :

MyVar[0] = 3
MyVar[1] = 0
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
so basically what u are saying is that if i have 1 i can use the value up to 8191 arrays but basically from 100 and above it the value i put inside it will not be saved unless i will increase the size of it am i getting it right?

any1 wanna make some tut about it? :p
 

Chocobo

White-Flower
Reaction score
409
so basically what u are saying is that if i have 1 i can use the value up to 8191 arrays but basically from 100 and above it the value i put inside it will not be saved unless i will increase the size of it am i getting it right?

any1 wanna make some tut about it? :p

Ignore the Size, it only applies to predefined Values, that's all.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
so it doesn't realy matter and i can just put all my variables to 1?

Predefined is the ones that are defined at map init?
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
oh i think i get it so basically it only affect it by the deafult value means that i can set deafult value for only up to 100 arrays in the map init and the rest of it i must set using set variable actions, did i get it right?
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
k i got new question:
is it possible to put item on some unit and make it affect on other unit?
(e.g: Claws on peasant but it add +3 attack to paladin)
 
M

Mythic Fr0st

Guest
Yes it is,

WEU has a feature to add "Bonus" Damage or Subtract it, same with armor, not sure if you can do it in simple jass without WEU,

But yea

You'd store the main hero into a unit array, then add the bonuses, to that Unit Array, and the hero would get the effects, and same for armor, however, you'd have to make a trigger for both "Acquiring the Item" and "Loosing" the item, if you get WEU I can show you how to do it all in one simple trigger for adding the bonuses, and 2 small triggers for acquiring the item / losing the item
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
WEU has a feature to add "Bonus" Damage or Subtract it, same with armor, not sure if you can do it in simple jass without WEU,
WEU is basically Jass based actions which became GUI

You'd store the main hero into a unit array, then add the bonuses, to that Unit Array, and the hero would get the effects, and same for armor, however, you'd have to make a trigger for both "Acquiring the Item" and "Loosing" the item, if you get WEU I can show you how to do it all in one simple trigger for adding the bonuses, and 2 small triggers for acquiring the item / losing the item
but i can do something like add bonus of current item right?
cuz if im gonna add bonus for each item using trigger this will take years...
 
M

Mythic Fr0st

Guest
I dont know what you mean, but you'd do this

Variables:
Weapons, item type, array 1
Weapon_Bonus, integer, array 1
Hero, unit, array 1 (Which is set to all your heroes)
Weapon_Index, integer, no array
PN, integer, no array

Code:
    Events
        Map Initilization
    Conditions
    Actions
        Set Weapon[0] = Claws Of Attack + 15
        Set Weapon_Bonus[0] = 15
        Set Weapon[1] = Rabbit Fangs + 20
        Set Weapon_Bonus[1] = 20
        Weapon_Index = 1 //Set to the highest index of them all

Code:
    Events
        A unit looses an item
    Conditions
    Actions
        Set PN = Player number of owner of triggering unit
        For each Integer A from 0 to Weapon_Index do MULTIPLE Actions
            Loop - Actions
                If / Then / Else, Multiple Functions
                    If - Conditions
                        Item Type of Item being manipulated equal to Weapon[Integer A]
                    Then - Actions
                        Advanced - Subtract Weapon_Bonus[Integer A] Damage from Hero[PN]

Same thing for acquiring, except u change event, and "Add" Weapon_Bonus[Integer A]

And WEU has actions that normal WE doesn't (In jass)
It has a list of functions made up (You can make your own functions in jass)
 

Chocobo

White-Flower
Reaction score
409
WEU is basically Jass based actions which became GUI


but i can do something like add bonus of current item right?
cuz if im gonna add bonus for each item using trigger this will take years...

WEU = Adds 336 variables, 9271 lines of script, .. and many things you won't use.

Remember, the max level of upgrades used by WEU for Advanced Upgrades thing if I remember is 4095. You go over? It's over for the upgrade, it sticks at 4095.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
I dont know what you mean, but you'd do this
doing that is execly what i rather not having it will take too much time and triggers for all of the items besides that's only for atk what about mana regeneration, hp , attrib bonus and more....
is it possible to add all of them?
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
k i got new question:
is it possible to put item on some unit and make it affect on other unit?
(e.g: Claws on peasant but it add +3 attack to paladin)
Replace item with a same one but with enchanged stats when carried by a specific unit?

P.S: How could a Peasant...hold an item by default? :eek:
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
Replace item with a same one but with enchanged stats when carried by a specific unit?
just simply make item affect on a unit without carrying it (i don't realy care who holds it as long as it gives what i need)
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
yea it was just an example but bassically even putting this item at the end of the map just how can i make it affect the unit even if it's not holding it?
 

Master

Thou shall be helped by...The Black Adder!
Reaction score
72
Add a Hero/Unit ability you made, identical with the item's abilities to the Unit :)
 
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