| 07-20-2003, 05:03 PM | #1 |
I'm creating a spell based completely off JASS, but I can't find a function that returns the level of the spell.. Basically, the spell has 4 levels. However, at different levels, the spell does different things.. but I can't find a way to get the spell level. Anyone has any ideas, please help! |
| 07-21-2003, 12:32 AM | #2 |
I don't think there is a native to get that but what you can do is use the learn skill event to keep track of the current level the spell is. Or you could base it off a summon spell and check what unit got summoned. |
| 07-24-2003, 02:10 PM | #3 |
You can find out when a hero learns a ability. I forget if it is in the RoC WE, but I know its in the TFT editor, I remember seeing it. Event Response - Unit - UnitVarible Learns a Skill (or something like this) and conditions hero skill comparison, learned skill is = to select from the drop down. If so set a counter = to current value + 1 |
| 07-24-2003, 05:33 PM | #4 |
if ur doing multiple spells for multiple units, ud need to have an array to hold all those values. also if u have units that share spells, ud need to have an array for all those units. Here's what i suggest, if that's the case. 1) make constants. this'll help u for readablity. so lets say u have 5 units, and 20 spells. here's how it would look constant integer Arthas = 1 constant integer Thrall = 2 constant integer.... so forth until u have 5. they need to be integer values and not units. do the same with ur spells constant integer Blaze = 1 constant integer Whirlwind = 2 so on.... 2) you'll need a way to access these values. create a function. it'll go like this: function Vector takes integer X, integer Y returns integer return (X * Y) endfunction U could also just multiply the values within ur variable assignment, but that makes it a bit more confusing, so just use this method for readability. 3) What u've just done is made a grid which will have integers assigned to units on the horizontal, and integers assigned to spells on the vertical. it would look like this. i hope this turns out right. I put the actual integer value next to the constant name. Arthas(1) Thrall(2) Jaina(3) Blaze(1) 1 0 0 Wind(2) 0 2 1 Frost(3) 1 1 3 the numbers in the grid are the levels of the spells. 4) Everytime a unit levels up, Access his "square" on the grid and add 1 to that value. To access that "square": a) create a variable array called spells b) access the square like this: spells[Vector(Arthas, Blaze)] What would be better is if there was a way to convert the string value of the unit name and the spell name into the constant integer assigned to that string value. instead of creating 20 or so triggers for each combination of unit to spell, u would just do this: spells[Vector(NameOfTriggeringUnit, NameofLevelingSpell)]. I guess u could create a function that'll allow that. look into it. if u find out post. thanks |
| 07-26-2003, 07:22 AM | #5 |
sorry, made a mistake on the vector function. i think it should be: function Vector takes integer x, integer y, integer length returns integer return (((y-1) * length) + x) endfunction i haven't checked it yet though. length is how many different values u would have running across the top. so like for that little example of a grid i put, it would be that line saying arthas, thrall, jaina, etc. in that case length would be 3. i haven't tested this out yet, but i think it should work. if its buggy u could prolly fix it to work right. sorry bout that again. |
