| 06-02-2006, 01:01 PM | #1 |
Need your collective help again.. How do you add an ability to a unit via triggers? I have a variable which is set to an ability. When i try to add the ability to the unit, it does nothing. Here is the code that doesnt work: Trigger: Unit - Add Item_Book_Ability_List[(Integer A)] to Item_Book_Player_UnitThis is the code that does: Trigger: Unit - Add Laser (Long) to Item_Book_Player_UnitItem_Book_Ability_List[0] is initalised at the start to point to Laser (Long) |
| 06-02-2006, 01:16 PM | #2 |
Are you sure the if is ever true? Are you sure you have set the ability array properly? Are you sure Item_Book_Player_Unit is set correctly? |
| 06-02-2006, 01:22 PM | #3 |
Yes - I display to the screen. Yes - I've compared the Jass code Yes - I've displayed it to the screen. Ive i just change that single line of code, it works. If anything, its got something to do with that ability variable, but i dont know why. Is this a BUG??? Because ive created a new map, and tried adding an ability from a variable and it doesnt work. Someone help??? VEX? |
| 06-02-2006, 03:33 PM | #4 | |
Quote:
Vex is a great great coder, but asking directly for him in a public post i find quite odd. If you want Vex's help, then PM him, but if you want other Jassers, not just directly Vex, then do not state you want somebody just because youv seen some of there posts, and you go "Wow, he must be clever, il ask him!" |
| 06-02-2006, 03:44 PM | #5 |
Post both complete triggers. Having just one line of GUI doesn't really help us much. |
| 06-02-2006, 03:48 PM | #6 |
If array[0] is set to something, how is array[1] going to give what array[0] was set to? |
| 06-02-2006, 04:51 PM | #8 | |
Those initalisation triggers have no event, so won't happen. You've nested a For loop integer A in a For loop integer A loop. Replace the second one with For loop integer B. Quote:
Not normally, but I have an idea. One moment. EDIT: Correction, you can, event if they are the same ability (passives only for this, and not all at that; I only tested pheonix fire, but I know movement speed passive doesn't work the same). |
| 06-03-2006, 11:32 AM | #10 |
Removing an ability will always reset cooldown, not much you can do about that. And I assume the item has the ability, so that is the problem. Try to add a game text message action to the trigger that sets up the array, to be 100% sure that it initializes them. |
| 06-03-2006, 01:45 PM | #11 |
Disabling rather than removing it can work. While not MUI if any one player has more than one, it works if you only have one/player. |
