| 04-21-2006, 09:27 PM | #2 |
why not jsut use the GUI action that loops throgh players? Why use a JASS loop? =/ (when using GUI..) |
| 04-21-2006, 09:40 PM | #3 |
I'm not good enough to write triggers completly in jass, but where it is possible for me and where it makes sense I use custom scripts. I thought it would be better to use loops through custom scripts then the For each integer A / B, because this is a global variable and I want to make it with local variables... Can you give me a suggestion of what the error can be? And thx for the fast answer! |
| 04-21-2006, 09:47 PM | #4 |
Can you convert the trigger to JASS (without changing anything) and then post it here? It would be easier to help for people who don't know German, or the german GUI function names. |
| 04-21-2006, 09:53 PM | #5 | |
Quote:
If you can use the GUI and understand JASS enogh to make a proper loop, then you can code enterly in JASS. Its a bit more difficult then GUI, because you have to type it instead of clicking to generate it, but its just better >_> If you can use the GUI, you can code in JASS. |
| 04-21-2006, 09:54 PM | #6 |
@ Blade.dk Ah, right, I already thought of something like that! So the same in JASS: JASS:function Trig_MultiboardErstellen_Func005001 takes nothing returns boolean return ( GetPlayerSlotState(ConvertedPlayer(udg_Integer_loop)) == PLAYER_SLOT_STATE_PLAYING ) endfunction function Trig_MultiboardErstellen_Actions takes nothing returns nothing local integer udg_Integer_loop=1 loop exitwhen udg_Integer_loop>12 call DisplayTextToForce( GetPlayersAll(), I2S(udg_Integer_Counter[7]) ) if ( Trig_MultiboardErstellen_Func005001() ) then set udg_Integer_Counter[7] = ( udg_Integer_Counter[7] + 1 ) else call DoNothing( ) endif set udg_Integer_loop = ( udg_Integer_loop + 1 ) endloop call DisplayTextToForce( GetPlayersAll(), I2S(udg_Integer_Counter[7]) ) endfunction //=========================================================================== function InitTrig_MultiboardErstellen takes nothing returns nothing set gg_trg_MultiboardErstellen = CreateTrigger( ) call TriggerAddAction( gg_trg_MultiboardErstellen, function Trig_MultiboardErstellen_Actions ) endfunction EDIT: Jass-code is NOW the exactly same as shown at the very beginning of the thread. |
| 04-21-2006, 10:17 PM | #7 |
@ Earth-Fury Yeah, it is properly much better to write in jass, but then I have to learn that in a way too (it's a change in editing)... I mean I already learned a lot of things for warcaft 3 (I also made own animated models), but someday I want to finish my map, and for now I'm working for already arround 3 years at one map idea, and I want to come to an end ... |
| 04-21-2006, 10:22 PM | #8 | |
JASS:function Trig_MultiboardErstellen_Actions takes nothing returns nothing local integer i = 1 loop exitwhen i > 12 call DisplayTextToForce( GetPlayersAll(), I2S(udg_Integer_Counter[7]) ) if ( GetPlayerSlotState(ConvertedPlayer(i)) == PLAYER_SLOT_STATE_PLAYING ) then set udg_Integer_Counter[7] = ( udg_Integer_Counter[7] + 1 ) else call DoNothing( ) endif set i = ( i + 1 ) endloop call DisplayTextToForce( GetPlayersAll(), I2S(udg_Integer_Counter[7]) ) endfunction //=========================================================================== function InitTrig_MultiboardErstellen takes nothing returns nothing set gg_trg_MultiboardErstellen = CreateTrigger( ) call TriggerAddAction( gg_trg_MultiboardErstellen, function Trig_MultiboardErstellen_Actions ) endfunction Parses sucsessfully in jasscraft. Quote:
You know basic programing, you knwo basic JASS syntax... downlaod jasscraft and use the built in function library and code templates... You have no valid excuse for not learning JASS, unless you have a mere 20 minutes a week to work on your map. if thats the case, stop playing WC3 and relax for a bit >_> |
| 04-21-2006, 10:32 PM | #9 |
It feels like a feeling of stupidity overwhelms me... I mean, the WE also announces no problems. It is "only" the game which quits with an Fatal error. Perhaps the mistake lies in the way I trigger my trigger? -> I trigger it namely from another trigger which has the event: Dialog - A dialog button is clicked for ... And then later in it I use the trigger command: Trigger - Run MultiboardErstellen <gen> (checking conditions) Can there be a connection? I don't know how to solve this... |
| 04-21-2006, 10:33 PM | #10 |
post that trigger. Edit: in GUI AND JaSS please =) (i still use the GUI allot to format rough code, and it just reads easyer ^^) |
| 04-21-2006, 10:40 PM | #11 |
The variable is not the same in the function generated that is the top of the script, it is not the global one there, that might be the problem. The problem is in this function: JASS:function Trig_MultiboardErstellen_Func005001 takes nothing returns boolean return ( GetPlayerSlotState(ConvertedPlayer(udg_Integer_loop)) == PLAYER_SLOT_STATE_PLAYING ) endfunction You will need jass to do this so it works, I think this is the problem. |
| 04-21-2006, 11:04 PM | #13 |
@ Blade.dk So you mean the error happens, because of the "if then else" - statement (which uses the local variable Integer_loop) which I wrote in GUI between the loop. And then when GUI is compiled to jass the "if then else" - function is set to another place and the local variable becomes a global? |
| 04-21-2006, 11:11 PM | #14 | |
Quote:
exactly. The modified version i posted fixes this for you. |
| 04-21-2006, 11:12 PM | #15 |
Ok, it seems you are right Blade.dk! I tested everything the same, only that I deleted the "if then else" - function and the showtext - functions and it worked! Looks like this now: GUI: Trigger: EDIT: @ Earth-Fury You mean the upper one you tested? W8 I reread... |
