Anomalies In My Code

Never_Quit

New Member
Reaction score
16
I don't see any errors in my code, but there are glitches that i'm finding in the game while testing.

I am making a guitar hero like game for warcraft. The delay is horrible with a slow connection...BUT i'm doing it cus i like to program. :]

Can someone please take a look at this code and see if they see any reasons the code wouldnt work?

Code:
function Trig_Esc_Copy_Func002Func006Func001C takes nothing returns boolean
    if ( not ( udg_uUpIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006Func002C takes nothing returns boolean
    if ( not ( udg_uDownIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006Func003C takes nothing returns boolean
    if ( not ( udg_uRightIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006Func004C takes nothing returns boolean
    if ( not ( udg_uLeftIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006C takes nothing returns boolean
    if ( Trig_Esc_Copy_Func002Func006Func001C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func002Func006Func002C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func002Func006Func003C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func002Func006Func004C() ) then
        return true
    endif
    return false
endfunction

function Trig_Esc_Copy_Func002C takes nothing returns boolean
    if ( not Trig_Esc_Copy_Func002Func006C() ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func001C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uLeftIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uUpIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func003C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uDownIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func004C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uRightIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006C takes nothing returns boolean
    if ( Trig_Esc_Copy_Func004Func006Func001C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func004Func006Func002C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func004Func006Func003C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func004Func006Func004C() ) then
        return true
    endif
    return false
endfunction

function Trig_Esc_Copy_Func004C takes nothing returns boolean
    if ( not Trig_Esc_Copy_Func004Func006C() ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func006Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func006Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func006C takes nothing returns boolean
    if ( not ( udg_uLeftIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func008Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func008Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func008C takes nothing returns boolean
    if ( not ( udg_uRightIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func010Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func010Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func010C takes nothing returns boolean
    if ( not ( udg_uDownIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func012Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func012Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func012C takes nothing returns boolean
    if ( not ( udg_uUpIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Actions takes nothing returns nothing
    // If there are ANY pressed keys where there are not any units=FAIL
    if ( Trig_Esc_Copy_Func002C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] = 1
        set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = 0
        return
    else
    endif
    // If there are ANY missed KEYS where there ARE units=FAIL
    if ( Trig_Esc_Copy_Func004C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] = 1
        set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = 0
        return
    else
    endif
    // If the LEFT key is pressed...
    if ( Trig_Esc_Copy_Func006C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func006Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func006Func002Func004A )
        else
        endif
    else
    endif
    // If the RIGHT key is pressed...
    if ( Trig_Esc_Copy_Func008C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func008Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func008Func002Func004A )
        else
        endif
    else
    endif
    // If the DOWN key is pressed...
    if ( Trig_Esc_Copy_Func010C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func010Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func010Func002Func004A )
        else
        endif
    else
    endif
    // If the UP key is pressed...
    if ( Trig_Esc_Copy_Func012C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func012Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func012Func002Func004A )
        else
        endif
    else
    endif
endfunction

//===========================================================================
function InitTrig_Esc_Copy takes nothing returns nothing
    set gg_trg_Esc_Copy = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(1) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(2) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(3) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(4) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(5) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(6) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(7) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(8) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(9) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(10) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(11) )
    call TriggerAddAction( gg_trg_Esc_Copy, function Trig_Esc_Copy_Actions )
endfunction

EDIT: The errors are that.... when pressing left and up at the same time, then esc, ONLY purple can kill the units (player 4? wth?) and then blue does NOT recieve a gold for hitting "notes" and others do recieve gold.

This is the only trigger controlling all players, so I am completely stumped.
 

aliminator8

New Member
Reaction score
3
arrows keys already have delay problems so you are better off using a hero with dummy abilities with hotkeys
 

RoarMan

Member
Reaction score
12
Yea, arrow keys do lag and if you want to make your map multiplayer, it'll lag even more. Just make a unit with spells that have the hotkeys w,a,s,d or whatever and make the appropriate adjustments.
 

istar

New Member
Reaction score
31
is there any particular reason you put them in JASS? theres a lot of conditions and its baffling
JASS:
function Trig_Esc_Copy_Func002Func006C takes nothing returns boolean
    local integer id = GetPlayerId(GetTriggerPlayer())+1
    if ( udg_uUpIsPressed[id] and(CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    if ( udg_uDownIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    if ( udg_uRightIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    if ( udg_uLeftIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    return false             //or
endfunction

function Trig_Esc_Copy_Func004Func006C takes nothing returns boolean
    local integer id = GetPlayerId(GetTriggerPlayer())+1
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uLeftIsPressed[id] == false ) ) then
        return true
    endif
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uUpIsPressed[id] == false ) ) then
        return true
    endif
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uDownIsPressed[id] == false ) ) then
        return true
    endif
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uRightIsPressed[id] == false ) ) then
        return true
    endif
    return false
endfunction                    //or

function Trig_Esc_Copy_Func006Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Actions takes nothing returns nothing
    local player tri = GetTriggerPlayer()
    local integer id = GetPlayerId(tri)+1
    local player neutral = Player(13)
    // If there are ANY pressed keys where there are not any units=FAIL
    if ( Trig_Esc_Copy_Func002Func006C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[id]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[id] ), tri, PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[id] = 1
        set udg_pCombo[id] = 0
        return
    endif
    // If there are ANY missed KEYS where there ARE units=FAIL
    if ( Trig_Esc_Copy_Func004Func006C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[id]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[id] ), tri, PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[id] = 1
        set udg_pCombo[id] = 0
        return
    endif
    // If the LEFT key is pressed...
    if ( udg_uLeftIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
    // If the RIGHT key is pressed...
    if ( udg_uRightIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
    // If the DOWN key is pressed...
    if ( udg_uDownIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
    // If the UP key is pressed...
    if ( udg_uUpIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
set neutral = null
set tri = null
endfunction

//===========================================================================
function InitTrig_Esc_Copy takes nothing returns nothing
    set gg_trg_Esc_Copy = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(1) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(2) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(3) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(4) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(5) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(6) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(7) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(8) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(9) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(10) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(11) )
    call TriggerAddAction( gg_trg_Esc_Copy, function Trig_Esc_Copy_Actions )
endfunction

i edited it for readability
i saw this GetRandomInt(1, 1) doesnt it always return 1?
and instead of CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) >= 1
you should use isunitgroup empty = false
it is utterly confusing, i may have made some errors when editing
 

Never_Quit

New Member
Reaction score
16
is there any particular reason you put them in JASS? theres a lot of conditions and its baffling
JASS:
function Trig_Esc_Copy_Func002Func006C takes nothing returns boolean
    local integer id = GetPlayerId(GetTriggerPlayer())+1
    if ( udg_uUpIsPressed[id] and(CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    if ( udg_uDownIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    if ( udg_uRightIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    if ( udg_uLeftIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return true
    endif
    return false             //or
endfunction

function Trig_Esc_Copy_Func004Func006C takes nothing returns boolean
    local integer id = GetPlayerId(GetTriggerPlayer())+1
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uLeftIsPressed[id] == false ) ) then
        return true
    endif
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uUpIsPressed[id] == false ) ) then
        return true
    endif
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uDownIsPressed[id] == false ) ) then
        return true
    endif
    if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) and ( udg_uRightIsPressed[id] == false ) ) then
        return true
    endif
    return false
endfunction                    //or

function Trig_Esc_Copy_Func006Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Actions takes nothing returns nothing
    local player tri = GetTriggerPlayer()
    local integer id = GetPlayerId(tri)+1
    local player neutral = Player(13)
    // If there are ANY pressed keys where there are not any units=FAIL
    if ( Trig_Esc_Copy_Func002Func006C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[id]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[id] ), tri, PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[id] = 1
        set udg_pCombo[id] = 0
        return
    endif
    // If there are ANY missed KEYS where there ARE units=FAIL
    if ( Trig_Esc_Copy_Func004Func006C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[id]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[id] ), tri, PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[id] = 1
        set udg_pCombo[id] = 0
        return
    endif
    // If the LEFT key is pressed...
    if ( udg_uLeftIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
    // If the RIGHT key is pressed...
    if ( udg_uRightIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
    // If the DOWN key is pressed...
    if ( udg_uDownIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
    // If the UP key is pressed...
    if ( udg_uUpIsPressed[id] ) then
        // If there are people in the region...
        if ( ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) >= 1 ) ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) ), tri, PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral), function Trig_Esc_Copy_Func006Func002Func004A )
        endif
    endif
set neutral = null
set tri = null
endfunction

//===========================================================================
function InitTrig_Esc_Copy takes nothing returns nothing
    set gg_trg_Esc_Copy = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(1) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(2) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(3) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(4) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(5) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(6) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(7) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(8) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(9) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(10) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(11) )
    call TriggerAddAction( gg_trg_Esc_Copy, function Trig_Esc_Copy_Actions )
endfunction

i edited it for readability
i saw this GetRandomInt(1, 1) doesnt it always return 1?
and instead of CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) >= 1
you should use isunitgroup empty = false
it is utterly confusing, i may have made some errors when editing

sorry about making it confusing, but thanks for puttin it in jass
looks good

ya it always returns one. I was planning on making multiple sounds that play when a wrong key is strummed because the one sound variable will play once per player, wait till the sound has finished, then play again when the next mess up occurs

thanks for the tip i'll try it

+rep
 

istar

New Member
Reaction score
31
well, actually i didnt answer your problem
EDIT: The errors are that.... when pressing left and up at the same time, then esc, ONLY purple can kill the units (player 4? wth?) and then blue does NOT recieve a gold for hitting "notes" and others do recieve gold.
is it ok now?
you should give the trigger in GUI, easier to read, evidently you made it in GUI
the code i gave can be further shortened, but i was too confused by it that i stopped in case of errors, if you give them in GUI and i understand, i could help further shortened it
 

Never_Quit

New Member
Reaction score
16
well, actually i didnt answer your problem

is it ok now?
you should give the trigger in GUI, easier to read, evidently you made it in GUI
the code i gave can be further shortened, but i was too confused by it that i stopped in case of errors, if you give them in GUI and i understand, i could help further shortened it

gold appears to work when I play as blue, but the up left combination still doesnt work :/

also, how do i post in the [ wc3] format easier? (i guess i could just post a picture)
 

istar

New Member
Reaction score
31
Code:
[wc3]Untitled Trigger 002
    Events
        Time - t expires
    Conditions
    Actions
        Unit - Kill (Triggering unit)
[/wc3/]
example
remove the second / in [/wc3/]
 

Never_Quit

New Member
Reaction score
16
so..

Code:
[wc3]
function Trig_Esc_Copy_Func002Func006Func001C takes nothing returns boolean
    if ( not ( udg_uUpIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006Func002C takes nothing returns boolean
    if ( not ( udg_uDownIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006Func003C takes nothing returns boolean
    if ( not ( udg_uRightIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006Func004C takes nothing returns boolean
    if ( not ( udg_uLeftIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func002Func006C takes nothing returns boolean
    if ( Trig_Esc_Copy_Func002Func006Func001C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func002Func006Func002C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func002Func006Func003C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func002Func006Func004C() ) then
        return true
    endif
    return false
endfunction

function Trig_Esc_Copy_Func002C takes nothing returns boolean
    if ( not Trig_Esc_Copy_Func002Func006C() ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func001C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uLeftIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uUpIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func003C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uDownIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006Func004C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    if ( not ( udg_uRightIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == false ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func004Func006C takes nothing returns boolean
    if ( Trig_Esc_Copy_Func004Func006Func001C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func004Func006Func002C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func004Func006Func003C() ) then
        return true
    endif
    if ( Trig_Esc_Copy_Func004Func006Func004C() ) then
        return true
    endif
    return false
endfunction

function Trig_Esc_Copy_Func004C takes nothing returns boolean
    if ( not Trig_Esc_Copy_Func004Func006C() ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func006Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func006Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func006C takes nothing returns boolean
    if ( not ( udg_uLeftIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func008Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func008Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func008C takes nothing returns boolean
    if ( not ( udg_uRightIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func010Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func010Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func010C takes nothing returns boolean
    if ( not ( udg_uDownIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func012Func002Func004A takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function Trig_Esc_Copy_Func012Func002C takes nothing returns boolean
    if ( not ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) >= 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Func012C takes nothing returns boolean
    if ( not ( udg_uUpIsPressed[GetConvertedPlayerId(GetTriggerPlayer())] == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Esc_Copy_Actions takes nothing returns nothing
    // If there are ANY pressed keys where there are not any units=FAIL
    if ( Trig_Esc_Copy_Func002C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] = 1
        set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = 0
        return
    else
    endif
    // If there are ANY missed KEYS where there ARE units=FAIL
    if ( Trig_Esc_Copy_Func004C() ) then
        call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())]), 750.00, 75.00), 0 )
        call AdjustPlayerStateBJ( ( 0 - udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
        set udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] = 1
        set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = 0
        return
    else
    endif
    // If the LEFT key is pressed...
    if ( Trig_Esc_Copy_Func006C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func006Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rLeftRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func006Func002Func004A )
        else
        endif
    else
    endif
    // If the RIGHT key is pressed...
    if ( Trig_Esc_Copy_Func008C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func008Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rRightRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func008Func002Func004A )
        else
        endif
    else
    endif
    // If the DOWN key is pressed...
    if ( Trig_Esc_Copy_Func010C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func010Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rDownRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func010Func002Func004A )
        else
        endif
    else
    endif
    // If the UP key is pressed...
    if ( Trig_Esc_Copy_Func012C() ) then
        // If there are people in the region...
        if ( Trig_Esc_Copy_Func012Func002C() ) then
            call AdjustPlayerStateBJ( ( ( udg_pMoney[GetConvertedPlayerId(GetTriggerPlayer())] * udg_pMultiplier[GetConvertedPlayerId(GetTriggerPlayer())] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM))) ), GetTriggerPlayer(), PLAYER_STATE_RESOURCE_GOLD )
            set udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] = ( udg_pCombo[GetConvertedPlayerId(GetTriggerPlayer())] + 1 )
            call ForGroupBJ( GetUnitsInRectOfPlayer(udg_rUpRegions[GetConvertedPlayerId(GetTriggerPlayer())], Player(bj_PLAYER_NEUTRAL_VICTIM)), function Trig_Esc_Copy_Func012Func002Func004A )
        else
        endif
    else
    endif
endfunction

//===========================================================================
function InitTrig_Esc_Copy takes nothing returns nothing
    set gg_trg_Esc_Copy = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(1) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(2) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(3) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(4) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(5) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(6) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(7) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(8) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(9) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(10) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(11) )
    call TriggerAddAction( gg_trg_Esc_Copy, function Trig_Esc_Copy_Actions )
endfunction

[/wc3]

? ehh


heres a picture of my original code:D

http://i274.photobucket.com/albums/jj247/XNeverQuit/CrazyCode-1.jpg
 

istar

New Member
Reaction score
31
erm...
go to the GUI>right click>COPY AS TEXT
then put it in
Trigger:
  • tags
    • not put the jass...
    • and your picture is too blurred?
 

Never_Quit

New Member
Reaction score
16
erm...
go to the GUI>right click>COPY AS TEXT
then put it in
Trigger:
  • tags
    • not put the jass...
    • and your picture is too blurred?
Trigger:
  • o ok thanks man. i just joined this forum yesterday
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code"><div class="bbCodeBlock-title">Trigger:</div><div class="wc3trigger"><ul class="wc3" id="wc3_3">
    • <li class="lastopen"><span class="default">Esc</span>
    • <ul>
    • <li class="open"><span class="events">Events</span>
    • <ul>
    • <li class="tree"><span class="player">Player - Player 1 (Red) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 2 (Blue) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 3 (Teal) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 4 (Purple) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 5 (Yellow) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 6 (Orange) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 7 (Green) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 8 (Pink) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 9 (Gray) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 10 (Light Blue) skips a cinematic sequence</span></li>
    • <li class="tree"><span class="player">Player - Player 11 (Dark Green) skips a cinematic sequence</span></li>
    • <li class="lasttree"><span class="player">Player - Player 12 (Brown) skips a cinematic sequence</span></li>
    • </ul>
    • </li>
    • <li class="tree"><span class="conditions">Conditions</span></li>
    • <li class="lastopen"><span class="actions">Actions</span>
    • <ul>
    • <li class="tree"><span class="comments">-------- If there are ANY pressed keys where there are not any units=FAIL --------</span></li>
    • <li class="open"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lastopen"><span class="or">Or - Any (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="open"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">uUpIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rUpRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Equal to 0</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="open"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">uDownIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rDownRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Equal to 0</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="open"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">uRightIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rRightRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Equal to 0</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lastopen"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">uLeftIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rLeftRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Equal to 0</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="sound">Sound - Play iRandomSound[(Random integer number between 1 and 1)] at 100.00% volume, located at ((Center of rLeftRegions[(Player number of (Triggering player))]) offset by (750.00, 75.00)) with Z offset 0.00</span></li>
    • <li class="tree"><span class="player">Player - Add (0 - pMoney[(Player number of (Triggering player))]) to (Triggering player) Current gold</span></li>
    • <li class="tree"><span class="set">Set pMultiplier[(Player number of (Triggering player))] = 1</span></li>
    • <li class="tree"><span class="set">Set pCombo[(Player number of (Triggering player))] = 0</span></li>
    • <li class="lasttree"><span class="default">Skip remaining actions</span></li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • <li class="tree"><span class="comments">-------- If there are ANY missed KEYS where there ARE units=FAIL --------</span></li>
    • <li class="open"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lastopen"><span class="or">Or - Any (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="open"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">(Number of units in (Units in rLeftRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • <li class="lasttree"><span class="default">uLeftIsPressed[(Player number of (Triggering player))] Equal to False</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="open"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">(Number of units in (Units in rUpRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • <li class="lasttree"><span class="default">uUpIsPressed[(Player number of (Triggering player))] Equal to False</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="open"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">(Number of units in (Units in rDownRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • <li class="lasttree"><span class="default">uDownIsPressed[(Player number of (Triggering player))] Equal to False</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lastopen"><span class="and">And - All (Conditions) are true</span>
    • <ul>
    • <li class="lastopen"><span class="conditions">Conditions</span>
    • <ul>
    • <li class="tree"><span class="default">(Number of units in (Units in rRightRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • <li class="lasttree"><span class="default">uRightIsPressed[(Player number of (Triggering player))] Equal to False</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="sound">Sound - Play iRandomSound[(Random integer number between 1 and 1)] at 100.00% volume, located at ((Center of rLeftRegions[(Player number of (Triggering player))]) offset by (750.00, 75.00)) with Z offset 0.00</span></li>
    • <li class="tree"><span class="player">Player - Add (0 - pMoney[(Player number of (Triggering player))]) to (Triggering player) Current gold</span></li>
    • <li class="tree"><span class="set">Set pMultiplier[(Player number of (Triggering player))] = 1</span></li>
    • <li class="tree"><span class="set">Set pCombo[(Player number of (Triggering player))] = 0</span></li>
    • <li class="lasttree"><span class="default">Skip remaining actions</span></li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • <li class="tree"><span class="comments">-------- If the LEFT key is pressed... --------</span></li>
    • <li class="open"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">uLeftIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="comments">-------- If there are people in the region... --------</span></li>
    • <li class="lastopen"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rLeftRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="player">Player - Add ((pMoney[(Player number of (Triggering player))] x pMultiplier[(Player number of (Triggering player))]) x (Number of units in (Units in rLeftRegions[(Player number of (Triggering player))] owned by Neutral Victim))) to (Triggering player) Current gold</span></li>
    • <li class="tree"><span class="set">Set pCombo[(Player number of (Triggering player))] = (pCombo[(Player number of (Triggering player))] + 1)</span></li>
    • <li class="lastopen"><span class="unitgroup">Unit Group - Pick every unit in (Units in rLeftRegions[(Player number of (Triggering player))] owned by Neutral Victim) and do (Actions)</span>
    • <ul>
    • <li class="lastopen"><span class="loop">Loop - Actions</span>
    • <ul>
    • <li class="tree"><span class="unit">Unit - Explode (Picked unit)</span></li>
    • <li class="lasttree"><span class="unit">Unit - Remove (Picked unit) from the game</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • <li class="tree"><span class="comments">-------- If the RIGHT key is pressed... --------</span></li>
    • <li class="open"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">uRightIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="comments">-------- If there are people in the region... --------</span></li>
    • <li class="lastopen"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rRightRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="player">Player - Add ((pMoney[(Player number of (Triggering player))] x pMultiplier[(Player number of (Triggering player))]) x (Number of units in (Units in rRightRegions[(Player number of (Triggering player))] owned by Neutral Victim))) to (Triggering player) Current gold</span></li>
    • <li class="tree"><span class="set">Set pCombo[(Player number of (Triggering player))] = (pCombo[(Player number of (Triggering player))] + 1)</span></li>
    • <li class="lastopen"><span class="unitgroup">Unit Group - Pick every unit in (Units in rRightRegions[(Player number of (Triggering player))] owned by Neutral Victim) and do (Actions)</span>
    • <ul>
    • <li class="lastopen"><span class="loop">Loop - Actions</span>
    • <ul>
    • <li class="tree"><span class="unit">Unit - Explode (Picked unit)</span></li>
    • <li class="lasttree"><span class="unit">Unit - Remove (Picked unit) from the game</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • <li class="tree"><span class="comments">-------- If the DOWN key is pressed... --------</span></li>
    • <li class="open"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">uDownIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="comments">-------- If there are people in the region... --------</span></li>
    • <li class="lastopen"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rDownRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="player">Player - Add ((pMoney[(Player number of (Triggering player))] x pMultiplier[(Player number of (Triggering player))]) x (Number of units in (Units in rDownRegions[(Player number of (Triggering player))] owned by Neutral Victim))) to (Triggering player) Current gold</span></li>
    • <li class="tree"><span class="set">Set pCombo[(Player number of (Triggering player))] = (pCombo[(Player number of (Triggering player))] + 1)</span></li>
    • <li class="lastopen"><span class="unitgroup">Unit Group - Pick every unit in (Units in rDownRegions[(Player number of (Triggering player))] owned by Neutral Victim) and do (Actions)</span>
    • <ul>
    • <li class="lastopen"><span class="loop">Loop - Actions</span>
    • <ul>
    • <li class="tree"><span class="unit">Unit - Explode (Picked unit)</span></li>
    • <li class="lasttree"><span class="unit">Unit - Remove (Picked unit) from the game</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • <li class="tree"><span class="comments">-------- If the UP key is pressed... --------</span></li>
    • <li class="lastopen"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">uUpIsPressed[(Player number of (Triggering player))] Equal to True</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="comments">-------- If there are people in the region... --------</span></li>
    • <li class="lastopen"><span class="if">If (All Conditions are True) then do (Then Actions) else do (Else Actions)</span>
    • <ul>
    • <li class="open"><span class="if">If - Conditions</span>
    • <ul>
    • <li class="lasttree"><span class="default">(Number of units in (Units in rUpRegions[(Player number of (Triggering player))] owned by Neutral Victim)) Greater than or equal to 1</span></li>
    • </ul>
    • </li>
    • <li class="open"><span class="ifthen">Then - Actions</span>
    • <ul>
    • <li class="tree"><span class="player">Player - Add ((pMoney[(Player number of (Triggering player))] x pMultiplier[(Player number of (Triggering player))]) x (Number of units in (Units in rUpRegions[(Player number of (Triggering player))] owned by Neutral Victim))) to (Triggering player) Current gold</span></li>
    • <li class="tree"><span class="set">Set pCombo[(Player number of (Triggering player))] = (pCombo[(Player number of (Triggering player))] + 1)</span></li>
    • <li class="lastopen"><span class="unitgroup">Unit Group - Pick every unit in (Units in rUpRegions[(Player number of (Triggering player))] owned by Neutral Victim) and do (Actions)</span>
    • <ul>
    • <li class="lastopen"><span class="loop">Loop - Actions</span>
    • <ul>
    • <li class="tree"><span class="unit">Unit - Explode (Picked unit)</span></li>
    • <li class="lasttree"><span class="unit">Unit - Remove (Picked unit) from the game</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • <li class="lasttree"><span class="ifelse">Else - Actions</span></li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </li>
    • </ul>
    • </div></div>
 

istar

New Member
Reaction score
31
firstly, i just discovered the
Trigger:
  • tags myself
    • secondly, why is the formatting so off? did you right right copy text from trigger title?
    • thirdly, dont put it in
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code">
      • <div class="bbCodeBlock-title">
        • Code:
      • </div>
      • <div class="bbCodeBlock-content" dir="ltr">
        • <pre class="bbCodeCode" dir="ltr" data-xf-init="code-block" data-lang=""><code> tags, it put them there just to show you
    • fourth, haha, sorry, but it doesnt help much, still way too confusing, maybe you could say how it works
    • i try my best to read, but its late for me here, i may reply tmr instead</code></pre>
      • </div>
    • </div>
 

Never_Quit

New Member
Reaction score
16
firstly, i just discovered the
Trigger:
  • tags myself
    • secondly, why is the formatting so off? did you right right copy text from trigger title?
    • thirdly, dont put it in
    • <div class="bbCodeBlock bbCodeBlock--screenLimited bbCodeBlock--code">
      • <div class="bbCodeBlock-title">
        • Code:
      • </div>
      • <div class="bbCodeBlock-content" dir="ltr">
        • <pre class="bbCodeCode" dir="ltr" data-xf-init="code-block" data-lang=""><code> tags, it put them there just to show you
    • fourth, haha, sorry, but it doesnt help much, still way too confusing, maybe you could say how it works
    • i try my best to read, but its late for me here, i may reply tmr instead[/QUOTE]
    • i put it inside the code box so that the page wouldnt go on for forever
    • i&#039;ll take it out anyways
    • and its cool. i program so everything is in one trigger and its easy for me to change and add stuff that will apply to all players. Requires less time for me to change if something is wrong, also I assumed it would be universal and every player would have the same problems and it would be easier to fix my problems, but apparently not, If thats what you are asking.</code></pre>
      • </div>
    • </div>
 

istar

New Member
Reaction score
31
JASS:
function penalty takes integer id,player tri,rect r  returns nothing
    call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(r), 750.00, 75.00), 0 )
    call AdjustPlayerStateBJ( ( 0 - udg_pMoney[id] ), tri, PLAYER_STATE_RESOURCE_GOLD )
    set udg_pMultiplier[id] = 1
    set udg_pCombo[id] = 0
endfunction

function Escexplodeunits takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function score takes integer id,player tri,rect r returns nothing
    call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(r, Player(13))) ), tri, PLAYER_STATE_RESOURCE_GOLD )
    set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
    call ForGroupBJ( GetUnitsInRectOfPlayer(r, Player(13)), function Escexplodeunits )
endfunction

function Trig_Esc_Copy_Actions takes nothing returns nothing
    local player tri = GetTriggerPlayer()
    local integer id = GetPlayerId(tri)+1
    if udg_uLeftIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rLeftRegions[id])
    elseif udg_uLeftIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rLeftRegions[id])           
    endif
    if udg_uRightIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rRightRegions[id])
    elseif udg_uRightIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rRightRegions[id])           
    endif
    if udg_uDownIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rDownRegions[id])
    elseif udg_uDownIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rDownRegions[id])           
    endif
    if udg_uUpIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rUpRegions[id])
    elseif udg_uUpIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rUpRegions[id])           
    endif          
set tri = null
endfunction

//===========================================================================
function InitTrig_Esc_Copy takes nothing returns nothing
    set gg_trg_Esc_Copy = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(1) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(2) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(3) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(4) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(5) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(6) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(7) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(8) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(9) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(10) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(11) )
    call TriggerAddAction( gg_trg_Esc_Copy, function Trig_Esc_Copy_Actions )
endfunction

its now easier to read and edit!
it could be further improved but i am tired
check for leaks
basically
JASS:
    if udg_uLeftIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rLeftRegions[id])
    elseif udg_uLeftIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rLeftRegions[id])           
    endif

this part is repeated 4 times, substituting Left for Right, Up and Down each time
check the score and penalty for leaks
i decided not to use the check if unitgroupisempty thingy coz i not too sure if it includes dead corpse and whatever
check the if/else part for any situation i left out
check the score and penalty for the results
 

istar

New Member
Reaction score
31
poke, just to remind you, i edited it again, made some errors just now check it again
 

Never_Quit

New Member
Reaction score
16
sorry bro but i get tons of expected name errors along with missing code statements....

EDIT: scratch that i think i might have figured something out...
 

istar

New Member
Reaction score
31
JASS:
function penalty takes integer id,player tri,rect r  returns nothing
    call PlaySoundAtPointBJ( udg_iRandomSound[GetRandomInt(1, 1)], 100, OffsetLocation(GetRectCenter(r), 750.00, 75.00), 0 )
    call AdjustPlayerStateBJ( ( 0 - udg_pMoney[id] ), tri, PLAYER_STATE_RESOURCE_GOLD )
    set udg_pMultiplier[id] = 1
    set udg_pCombo[id] = 0
endfunction

function Escexplodeunits takes nothing returns nothing
    call ExplodeUnitBJ( GetEnumUnit() )
    call RemoveUnit( GetEnumUnit() )
endfunction

function score takes integer id,player tri,rect r returns nothing
    call AdjustPlayerStateBJ( ( ( udg_pMoney[id] * udg_pMultiplier[id] ) * CountUnitsInGroup(GetUnitsInRectOfPlayer(r, Player(13))) ), tri, PLAYER_STATE_RESOURCE_GOLD )
    set udg_pCombo[id] = ( udg_pCombo[id] + 1 )
    call ForGroupBJ( GetUnitsInRectOfPlayer(r, Player(13)), function Escexplodeunits )
endfunction

function Trig_Esc_Copy_Actions takes nothing returns nothing
    local player tri = GetTriggerPlayer()
    local integer id = GetPlayerId(tri)+1
    local player neutral = Player(13)
    if udg_uLeftIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rLeftRegions[id])
    elseif udg_uLeftIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rLeftRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rLeftRegions[id])           
    endif
    if udg_uRightIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rRightRegions[id])
    elseif udg_uRightIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rRightRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rRightRegions[id])           
    endif
    if udg_uDownIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rDownRegions[id])
    elseif udg_uDownIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rDownRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rDownRegions[id])           
    endif
    if udg_uUpIsPressed[id] and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) &gt;= 1 )then        
        call score(id,tri,udg_rUpRegions[id])
    elseif udg_uUpIsPressed[id]==false and ( CountUnitsInGroup(GetUnitsInRectOfPlayer(udg_rUpRegions[id], neutral)) == 0 ) then
        call DoNothing()
    else
        call penalty(id,tri,udg_rUpRegions[id])           
    endif          
set tri = null
set neutral = null
endfunction

//===========================================================================
function InitTrig_Esc_Copy takes nothing returns nothing
    set gg_trg_Esc_Copy = CreateTrigger(  )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(0) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(1) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(2) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(3) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(4) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(5) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(6) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(7) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(8) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(9) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(10) )
    call TriggerRegisterPlayerEventEndCinematic( gg_trg_Esc_Copy, Player(11) )
    call TriggerAddAction( gg_trg_Esc_Copy, function Trig_Esc_Copy_Actions )
endfunction

lol, i was tired yesterday, i forgot add local player netural = Player(13) thats why there is a unnamed veriable neutral
post the error msg if theres still errors
 

Never_Quit

New Member
Reaction score
16
oh ya that makes sense now.

i also pasted the code in a trigger named something different, but i got that fixed :)

and it appears to work now :D thanks.

i'm going to do a quick multiplayer test and see how it turns out:thup:


EDIT: I tested and the up left problem still persists. Perhaps it is a hardware problem?
 

istar

New Member
Reaction score
31
up left problem, elaborate
is there up-right, down-right, left-right etc problem?
if its exclusive to up-left only, then i dont know, basically up,left,right,down are carbon copies
maybe check your regions
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top