[Solved] what's wrong with this?

General talk about editing, cheating, and deprotecting maps.

Moderator: Cheaters

JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

[Solved] what's wrong with this?

Post by JustANewbie »

it doesn't work, but when i check it with world editor and jasscraft, no script error was found, i'm requesting for somebody who can find what's wrong with this trigger

Spoiler:

Code: Select all

Damage Up
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Unit-type of (Leveling Hero)) Equal to Phantom Assassin
                        (Unit-type of (Leveling Hero)) Equal to Master Stalker
                        (Unit-type of (Leveling Hero)) Equal to Professional Witcher
                        (Unit-type of (Leveling Hero)) Equal to Grand Inquisitor
            Then - Actions
                Player - Set the current research level of Damage Up 15  to ((Current research level of Damage Up 15  for (Owner of (Leveling Hero))) + 1) for (Owner of (Leveling Hero))
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Unit-type of (Leveling Hero)) Equal to Sniper
                                (Unit-type of (Leveling Hero)) Equal to invalid Hunter
                                (Unit-type of (Leveling Hero)) Equal to Grand Templar
                                (Unit-type of (Leveling Hero)) Equal to Dark ArchTemplar
                    Then - Actions
                        Player - Set the current research level of Damage Up 20 to ((Current research level of Damage Up 20 for (Owner of (Leveling Hero))) + 1) for (Owner of (Leveling Hero))
                    Else - Actions

Edit: added solved code

Spoiler:

Code: Select all

function Trig_Damage_Up_Func001Func002Func001C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetLevelingUnit()) == 'H02M' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Damage_Up_Func001Func002Func003C takes nothing returns boolean
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02E' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02F' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02L' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Damage_Up_Func001Func002C takes nothing returns boolean
    if ( not Trig_Damage_Up_Func001Func002Func003C() ) then
        return false
    endif
    return true
endfunction

function Trig_Damage_Up_Func001Func003C takes nothing returns boolean
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02N' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02O' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02P' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetLevelingUnit()) == 'H02Q' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Damage_Up_Func001C takes nothing returns boolean
    if ( not Trig_Damage_Up_Func001Func003C() ) then
        return false
    endif
    return true
endfunction

function Trig_Damage_Up_Actions takes nothing returns nothing
    if ( Trig_Damage_Up_Func001C() ) then
        set bj_forLoopAIndex = 1
        set bj_forLoopAIndexEnd = GetUnitLevel(GetLevelingUnit())
        loop
            exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
            call SetPlayerTechResearchedSwap( 'R00G', GetUnitLevel(GetLevelingUnit()), GetOwningPlayer(GetLevelingUnit()) )
            set bj_forLoopAIndex = bj_forLoopAIndex + 1
        endloop
    else
        if ( Trig_Damage_Up_Func001Func002C() ) then
            set bj_forLoopAIndex = 1
            set bj_forLoopAIndexEnd = GetUnitLevel(GetLevelingUnit())
            loop
                exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                call SetPlayerTechResearchedSwap( 'Remk', GetUnitLevel(GetLevelingUnit()), GetOwningPlayer(GetLevelingUnit()) )
                set bj_forLoopAIndex = bj_forLoopAIndex + 1
            endloop
        else
            if ( Trig_Damage_Up_Func001Func002Func001C() ) then
                set bj_forLoopAIndex = 1
                set bj_forLoopAIndexEnd = GetUnitLevel(GetLevelingUnit())
                loop
                    exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
                    call SetPlayerTechResearchedSwap( 'R00F', GetUnitLevel(GetLevelingUnit()), GetOwningPlayer(GetLevelingUnit()) )
                    set bj_forLoopAIndex = bj_forLoopAIndex + 1
                endloop
            else
            endif
        endif
    endif
endfunction

//===========================================================================
function InitTrig_Damage_Up takes nothing returns nothing
    set gg_trg_Damage_Up = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Damage_Up, EVENT_PLAYER_HERO_LEVEL )
    call TriggerAddAction( gg_trg_Damage_Up, function Trig_Damage_Up_Actions )
endfunction
Last edited by JustANewbie on November 21st, 2012, 4:48 am, edited 1 time in total.
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: what's wrong with this?

Post by Syre »

Im not quite sure. It looks fine to me. I remade the trigger exactly as you did..though with less units for testing purpose.

Code: Select all

Untitled Trigger 001
    Events
        Unit - A unit Gains a level
    Conditions
    Actions
        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                Or - Any (Conditions) are true
                    Conditions
                        (Unit-type of (Leveling Hero)) Equal to Paladin
            Then - Actions
                Player - Set the current research level of Iron Forged Swords to ((Current research level of Iron Forged Swords for (Owner of (Leveling Hero))) + 1) for (Owner of (Leveling Hero))
            Else - Actions
                If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    If - Conditions
                        Or - Any (Conditions) are true
                            Conditions
                                (Unit-type of (Leveling Hero)) Equal to Mountain King
                    Then - Actions
                        Player - Set the current research level of Black Gunpowder to ((Current research level of Black Gunpowder for (Owner of (Leveling Hero))) + 1) for (Owner of (Leveling Hero))
                    Else - Actions
And it worked without a problem. You said in jasscraft..are you trying to take this trigger and put it into another map? If so thats probably the problem. If not, make sure that the units have the upgrade.
Image
JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Re: what's wrong with this?

Post by JustANewbie »

yes i'm doing that, i extract the war3map.w3u and the war3map.w3q, then i edited them with jass new gen, after that i import the war3map.w3u and the war3map.w3q into the map, then i make the trigger in GUI, then i save with a blank map, i extract the trigger in the blank map with MPQ master, then i use jass craft to fused them into the same war3map.j, i tried other trigger, some of them works, but got 2 triggers never works no matter how hard i tried, one of them is this
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: what's wrong with this?

Post by Syre »

Unfortunately since the trigger works right i cant really help much. All i can really say is to double check that the unit/heros actually have the upgrade under their techtree - upgrades used line.
Image
JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Re: what's wrong with this?

Post by JustANewbie »

can you please check for me? i checked and checked and checked and tried and tried and tried many times but it still doesn't works, that's why i post here

i forgot to mentioned that i used standard upgrade, but i think this wont affect it to work right?
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: what's wrong with this?

Post by Syre »

Sure, either post or pm me the map, along with the w3u and w3q. Ill take a look and see if i can find anything. Standard upgrade?
Image
JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Re: what's wrong with this?

Post by JustANewbie »

ya standard upgrade, i'll pm you later, lunch time >_<
please help me check for the locust spell too, i link the locust unit with the hero so that the locust deal damage based on the hero attributes, but too bad, nothing happen :(
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: what's wrong with this?

Post by Syre »

Edit : Nevermind..im an idiot. I didn't completely change my trigger to match with the new ability. Trying other things now..

Well..it has to be a problem when the trigger was sent over to the other map. Using the same trigger with the upgrade and units you used i was able to get it working in a blank map. I cant help ya with jass though, so i suggest uploading the .j file and also copying/pasting it into a spoiler here for the people who know whats going on to help you out more.
Last edited by Syre on November 19th, 2012, 6:18 am, edited 2 times in total.
Image
JustANewbie
Forum Spammer
Posts: 510
Joined: August 18th, 2012, 2:32 am

Re: what's wrong with this?

Post by JustANewbie »

i understand what are you talking about but i don't know why it doesn't works since nothing is wrong what, so weird....
User avatar
Syre
Forum Staff
Posts: 506
Joined: November 17th, 2008, 3:49 pm

Re: what's wrong with this?

Post by Syre »

Edited post..made a simple mistake and posted before i found it. Seems that the problem is with the trigger transferring over to the other map. The upgrade and unit is fine and in gui the trigger works.
Image