- Joined
- Aug 18, 2013
- Messages
- 71
I'm having an issue finding all my ifs and end ifs. I had everything nice and indented. but after adding about 10 lines of code, its all fucked up. Now I have to start from scratch because the code is missing end ifs/end loops, even though they are there. Why is jass so shitty structurally compared to other languages like c++
the bracket system is so much more organized
compared to
anyone get mad at this system because its virtually impossible to find out what you mixed up?
cant figure this shit out for my life
PS: before people tell me i'm using BJ and other inefficient code I know. But Its converted gui. I'm just finishing what I wanted to get done first, then I was gonna go back and change everything
the bracket system is so much more organized
Code:
int main(params)
{
while(condition)//loop
{
if(condition)
{
function(u,0,0);//random function thingy
}//end if
else
{
other shit going on;
}//end else
}//end while
return 0;
}//end function
JASS:
function derp take nothing returns nothing
loop
exitwhen conditon
if(condition) then
function(u,0,0);//random function thingy
else
other shit going on;
endif
endloop
endfunction
anyone get mad at this system because its virtually impossible to find out what you mixed up?
JASS:
function Trig_SufferingPriest_Loop_Actions takes nothing returns nothing//
local integer rand = GetRandomInt(0,100)
local integer chance = 0
local boolean silence = false
set udg_Gen_CIndex = 1
loop//
exitwhen udg_Gen_CIndex > udg_Gen_MIndex
set udg_Gen_Counter[udg_Gen_CIndex] = ( udg_Gen_Counter[udg_Gen_CIndex] + 1 )
call CreateNUnitsAtLoc( 1, 'e007', udg_Gen_Player[udg_Gen_CIndex], GetUnitLoc(udg_Gen_Caster[udg_Gen_CIndex]), bj_UNIT_FACING )
set udg_Gen_Dummy[udg_Gen_CIndex] = GetLastCreatedUnit()
// Affliction
if ( udg_Gen_Abil[udg_Gen_CIndex] == 'A03Z'() ) then //4
if ( udg_Gen_AbilLevel[udg_Gen_CIndex] == 1 ) then//3
set chance = 7
else
if ( udg_Gen_AbilLevel[udg_Gen_CIndex] == 2 ) then //2
set chance = 10
else
if ( udg_Gen_AbilLevel[udg_Gen_CIndex] == 3 ) then //1
set chance = 14
else
set chance = 20
endif//end level 3 and 4 //1
endif//end level 2 //2
endif//end level 1 //3
endif//4
if(chance >= rand)then
set udg_Gen_Damage[udg_Gen_CIndex] = udg_Gen_Damage[udg_Gen_CIndex]+ (GetHeroInt(udg_Gen_Caster[udg_Gen_CIndex],true)/2)
set silence = true
call UnitAddAbility(udg_Gen_D,'A047')
endif//end chance //
endif//
call ForGroupBJ( udg_Gen_TargetG[udg_Gen_CIndex], function Trig_SufferingPriest_Loop_Func001Func005Func002A )
// Affliction END
set udg_Gen_CIndex = udg_Gen_CIndex + 1
endloop//
endfunction//
PS: before people tell me i'm using BJ and other inefficient code I know. But Its converted gui. I'm just finishing what I wanted to get done first, then I was gonna go back and change everything