| 08-21-2007, 07:10 PM | #2 |
redeclare the locals in the If then else statment or use JASS |
| 08-21-2007, 07:16 PM | #3 |
When you use those multiple-function if then else locals do not work. You need to use single function if-then else and use AND , OR to concatenate. But that would look really ugly. Well I guess general answer for all GUI questions is - learn JASS. EDIT: Or you can try this: Trigger: Actions
![]() Custom script: local unit udg_a
![]() Set a = (Target unit of ability being cast)
![]() Custom script: if GetOwningPlayer(GetSpellAbilityUnit()) == GetOwningPlayer(udg_a) then
![]() -------- add anything here --------
![]() Custom script: else
![]() -------- add anything here --------
![]() Custom script: endif |
| 08-21-2007, 07:16 PM | #4 |
Problem is that when the gui code is being JASSized, codes within all forms of multiline loops and conditions are put into separate function, so you cannot use locals there. There are three possible solutions that come to my mind: 1) Redeclare the local inside the IF. You wont wbe able to bring its value in and out of the IF. IFs are simply separate groups of commands in GUI. 2) Use globals. If you don't have any waits there, it should be okay. [RECCOMENDED] 3) Learn JASS :P [RECCOMENDED EVEN MORE] |
| 08-21-2007, 08:44 PM | #5 |
also, there is a bug that you cannot have 2 local variables in a function with the same name as a global variable. |
| 08-21-2007, 11:38 PM | #6 |
i know a little jass, but i always like to make my stuff in GUI so that i can show it to anyone and they'll understand it. thanks for the help guys, i think i outa be able to get it to work now (or at least find a way to make it work) ![]() |
| 08-22-2007, 03:06 PM | #8 |
Theres gonna be waits in the final thing though, so if i go global i wont be able to have it be MUI. |
| 08-22-2007, 08:09 PM | #10 |
ah, i get what your saying. that'd work, but in the end i just decided to convert everything to custom text and code the whole thing in half jass, half custom text converted to Jass. |
| 08-22-2007, 08:11 PM | #11 |
Have fun with that >< |
| 08-22-2007, 08:14 PM | #12 |
well, i did it and it worked quite well. right now im working on the healing part of it without using dummy units. simple enough, it just takes a little bit. |
