• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

4 Simple Things :) Credits + Rep

Status
Not open for further replies.
Level 15
Joined
Oct 29, 2012
Messages
1,474
I wanna ask 3 questions and 1 request , It's all about the JASS:

1))- When I transfer for example this into JASS :
  • Game - Show to (All Players) the text : Hello To ...!
It's just turned into :
JASS:
call DisplayTimedTextToForce( GetPlayersAll(), 15.00, "TRIGSTR_1690" )
Where the hell do I find TRIGSTR_1690 ?!

2)) What the hell does this function do ?And How is it in GUI:
JASS:
function Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnumUnit()) == 'npig' ) ) then
        return false
    endif
    return true
endfunction

3)) This is a line of JASS which is repeated every time there is a new function :

JASS:
function Trig_Erect_Wall_Conditions takes nothing returns boolean
Trig_Erect_Wall_Conditions => ???
takes ==> ??
nothing ==>?
returns ==>?


And what is it in GUI?

4)) The Request , This is a long trigger , But by the mistake I turned it into Custom Script and I couldn't Undo . Please Return it into GUI , It's the core system for my map .
JASS:
function Trig_Income_and_long_periodic_Func002Func002002002001 takes nothing returns boolean
    return ( IsUnitType(GetFilterUnit(), UNIT_TYPE_UNDEAD) == true )
endfunction

function Trig_Income_and_long_periodic_Func002Func002002002002 takes nothing returns boolean
    return ( IsUnitAliveBJ(GetFilterUnit()) == true )
endfunction

function Trig_Income_and_long_periodic_Func002Func002002002 takes nothing returns boolean
    return GetBooleanAnd( Trig_Income_and_long_periodic_Func002Func002002002001(), Trig_Income_and_long_periodic_Func002Func002002002002() )
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func001C takes nothing returns boolean
    if ( ( GetUnitTypeId(GetEnumUnit()) == 'nshe' ) ) then
        return true
    endif
    if ( ( GetUnitTypeId(GetEnumUnit()) == 'n00E' ) ) then
        return true
    endif
    return false
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002Func001Func001C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnumUnit()) == 'n00G' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002Func001C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnumUnit()) == 'n00F' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnumUnit()) == 'npig' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001C takes nothing returns boolean
    if ( not Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func001C() ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001Func002C takes nothing returns boolean
    if ( not ( GetUnitTypeId(GetEnumUnit()) == 'nech' ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func003Func001C takes nothing returns boolean
    if ( not ( GetUnitUserData(GetEnumUnit()) > 0 ) ) then
        return false
    endif
    if ( not ( GetUnitUserData(GetEnumUnit()) < 17 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func003A takes nothing returns nothing
    if ( Trig_Income_and_long_periodic_Func002Func003Func001C() ) then
        set udg_TempPlayer = ConvertedPlayer(GetUnitUserData(GetEnumUnit()))
        if ( Trig_Income_and_long_periodic_Func002Func003Func001Func002C() ) then
            call AdjustPlayerStateBJ( 1, udg_TempPlayer, PLAYER_STATE_RESOURCE_GOLD )
        else
            if ( Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001C() ) then
                call AdjustPlayerStateBJ( 2, udg_TempPlayer, PLAYER_STATE_RESOURCE_GOLD )
            else
                if ( Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002C() ) then
                    call AdjustPlayerStateBJ( 3, udg_TempPlayer, PLAYER_STATE_RESOURCE_GOLD )
                else
                    if ( Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002Func001C() ) then
                        call AdjustPlayerStateBJ( 4, udg_TempPlayer, PLAYER_STATE_RESOURCE_GOLD )
                    else
                        if ( Trig_Income_and_long_periodic_Func002Func003Func001Func002Func001Func002Func001Func001C() ) then
                            call AdjustPlayerStateBJ( 6, udg_TempPlayer, PLAYER_STATE_RESOURCE_GOLD )
                        else
                        endif
                    endif
                endif
            endif
        endif
    else
    endif
endfunction

function Trig_Income_and_long_periodic_Func002Func007Func001C takes nothing returns boolean
    if ( not ( TimerGetElapsed(udg_EndgameTimer) > 1200.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002Func007A takes nothing returns nothing
    if ( Trig_Income_and_long_periodic_Func002Func007Func001C() ) then
        call AdjustPlayerStateBJ( 15, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
    else
        call AdjustPlayerStateBJ( ( 3 + ( ( CountPlayersInForceBJ(udg_Hunters) * 2 ) - 2 ) ), GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
    endif
endfunction

function Trig_Income_and_long_periodic_Func002Func008Func001A takes nothing returns nothing
    call AdjustPlayerStateBJ( 1, GetEnumPlayer(), PLAYER_STATE_RESOURCE_GOLD )
endfunction

function Trig_Income_and_long_periodic_Func002Func008C takes nothing returns boolean
    if ( not ( udg_Progame == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func002C takes nothing returns boolean
    if ( not ( udg_IncomeInt == 2 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func004Func001Func004C takes nothing returns boolean
    if ( not ( udg_TempInteger == 1 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func004Func001C takes nothing returns boolean
    if ( not ( GetUnitStateSwap(UNIT_STATE_MANA, GetEnumUnit()) >= 10 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func004A takes nothing returns nothing
    if ( Trig_Income_and_long_periodic_Func004Func001C() ) then
        call SetUnitManaBJ( GetEnumUnit(), ( GetUnitStateSwap(UNIT_STATE_MANA, GetEnumUnit()) - 10.00 ) )
        set udg_TempPoint1 = GetUnitLoc(GetEnumUnit())
        set udg_TempInteger = GetRandomInt(1, 2)
        if ( Trig_Income_and_long_periodic_Func004Func001Func004C() ) then
            call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetEnumUnit()), udg_TempPoint1, bj_UNIT_FACING )
            call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
            call UnitAddAbilityBJ( 'Asta', GetLastCreatedUnit() )
            call IssuePointOrderLocBJ( GetLastCreatedUnit(), "stasistrap", udg_TempPoint1 )
        else
            call CreateNUnitsAtLoc( 1, 'h000', GetOwningPlayer(GetEnumUnit()), udg_TempPoint1, bj_UNIT_FACING )
            call UnitApplyTimedLifeBJ( 2.00, 'BTLF', GetLastCreatedUnit() )
            call UnitAddAbilityBJ( 'Aeye', GetLastCreatedUnit() )
            call IssuePointOrderLocBJ( GetLastCreatedUnit(), "evileye", udg_TempPoint1 )
        endif
        call RemoveLocation(udg_TempPoint1)
    else
    endif
endfunction

function Trig_Income_and_long_periodic_Func008C takes nothing returns boolean
    if ( not ( DistanceBetweenPoints(udg_TempPoint1, udg_ZeppPoint) < 900.00 ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func012A takes nothing returns nothing
    call SetUnitUserData( GetEnumUnit(), udg_TempInt )
    set udg_StuckPoint[udg_TempInt] = GetUnitLoc(GetEnumUnit())
    set udg_TempInt = ( udg_TempInt + 1 )
endfunction

function Trig_Income_and_long_periodic_Func014Func002Func001C takes nothing returns boolean
    if ( not ( IsTerrainPathableBJ(udg_TempPoint, PATHING_TYPE_WALKABILITY) == true ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func014Func002C takes nothing returns boolean
    if ( not ( GetLocationX(udg_TempPoint) == GetLocationX(udg_StuckPoint[GetUnitUserData(GetEnumUnit())]) ) ) then
        return false
    endif
    if ( not ( GetLocationY(udg_TempPoint) == GetLocationY(udg_StuckPoint[GetUnitUserData(GetEnumUnit())]) ) ) then
        return false
    endif
    return true
endfunction

function Trig_Income_and_long_periodic_Func014A takes nothing returns nothing
    set udg_TempPoint = GetUnitLoc(GetEnumUnit())
    if ( Trig_Income_and_long_periodic_Func014Func002C() ) then
        if ( Trig_Income_and_long_periodic_Func014Func002Func001C() ) then
            call SetUnitPositionLoc( GetEnumUnit(), udg_TempPoint )
        else
        endif
        set udg_TempInt2 = GetRandomInt(1, 18)
        set udg_TempPoint2 = GetRandomLocInRect(udg_wayRect[udg_TempInt2])
        call SetUnitAbilityLevelSwapped( 'A00G', GetEnumUnit(), udg_TempInt2 )
        call IssuePointOrderLocBJ( GetEnumUnit(), "attack", udg_TempPoint2 )
        call RemoveLocation (udg_TempPoint2)
    else
    endif
    call RemoveLocation (udg_StuckPoint[udg_TempInt])
    call RemoveLocation (udg_TempPoint)
endfunction

function Trig_Income_and_long_periodic_Actions takes nothing returns nothing
    set udg_IncomeInt = ( udg_IncomeInt + 1 )
    if ( Trig_Income_and_long_periodic_Func002C() ) then
        set udg_TempGroup = GetUnitsInRectMatching(GetPlayableMapRect(), Condition(function Trig_Income_and_long_periodic_Func002Func002002002))
        call ForGroupBJ( udg_TempGroup, function Trig_Income_and_long_periodic_Func002Func003A )
        call DestroyGroup(udg_TempGroup)
        set udg_IncomeInt = 0
        // toto sem chcel Richard pridat ale to bolo vtedy
        call ForForce( udg_Farmers, function Trig_Income_and_long_periodic_Func002Func007A )
        if ( Trig_Income_and_long_periodic_Func002Func008C() ) then
            call ForForce( udg_Hunters, function Trig_Income_and_long_periodic_Func002Func008Func001A )
        else
        endif
    else
    endif
    // trappers
    call ForGroupBJ( udg_Trappers, function Trig_Income_and_long_periodic_Func004A )
    // zeppelin
    set udg_TempPoint1 = GetUnitLoc(gg_unit_nzep_0048)
    call PingMinimapLocForForce( udg_Hunters, udg_TempPoint1, 1 )
    if ( Trig_Income_and_long_periodic_Func008C() ) then
        call RemoveLocation (udg_ZeppPoint)
        set udg_ZeppPoint = GetRandomLocInRect(GetPlayableMapRect())
        call IssuePointOrderLocBJ( gg_unit_nzep_0048, "move", udg_ZeppPoint )
    else
    endif
    call RemoveLocation (udg_TempPoint1)
    // stuckcheck
    set udg_TempInt = 0
    call ForGroupBJ( udg_StuckGroup, function Trig_Income_and_long_periodic_Func012A )
    call TriggerSleepAction( 0.10 )
    call ForGroupBJ( udg_StuckGroup, function Trig_Income_and_long_periodic_Func014A )
endfunction

//===========================================================================
function InitTrig_Income_and_long_periodic takes nothing returns nothing
    set gg_trg_Income_and_long_periodic = CreateTrigger(  )
    call TriggerRegisterTimerExpireEventBJ( gg_trg_Income_and_long_periodic, udg_IncomeTimmer )
    call TriggerAddAction( gg_trg_Income_and_long_periodic, function Trig_Income_and_long_periodic_Actions )
endfunction


Thank you , I will give reps every time I see the name of the helper on the hive !!!!!!
Credits also!
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
1.) Its because strings are put to some table, and thats just how GUI does it, the strings are rewrote to the respective position in the string file

2.) when you do If-Then-Else block, the if part is put in functions like that when generated GUI code

3.) Trig_Erect_Wall_Conditions is a function that is created as a condition of GUI(conditions part)
takes is the argument
nothing means that there will be no arguments
returns says what return type does the function have

for more info on this, go and read some Jass tutorials

4.) I for sure will not go through that :D, too buzy for that
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
1 - I believe the string file is generated to the map so you need to open the map as mpq to read the string table

2 - when you want to create some conditions, either in if then else vlock, or in group enumeration or player enumeration, functions like that will be created
one line of conditional statement(Is unit alive equal to false for instance) generates one function of multiple if blocks or multiple functions(cant remember which is generated how)
you example is equal to unit-type check, which is
is Picked unit of type pig(assuming by the raw code) equals to true
So if the unit is indeed pig, it will yeald true, otherwise false

3 - this is programming, you cant see things like that in GUI unless you use something with Custom Script, because GUI hides all of that stuff with the shiny click me interface
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
@deathismyfriend : I don't learn JASS , But you tutorial is really useful , tnx + rep
@Anvil : Thank you Credits+ Rep
@FirstLegacy : It's a Farmer vs Hunter based map , I wanted to edit it as long as I took the permission . Also I can tell you that after a long thinking I finally understood how you want your spell and I am going to make it :D
 
Level 7
Joined
Nov 8, 2008
Messages
174
@deathismyfriend : I don't learn JASS , But you tutorial is really useful , tnx + rep
@Anvil : Thank you Credits+ Rep
@FirstLegacy : It's a Farmer vs Hunter based map , I wanted to edit it as long as I took the permission . Also I can tell you that after a long thinking I finally understood how you want your spell and I am going to make it :D

aw, goodluck also in your map...:ogre_haosis:

offtopic:
btw,if you could, you can modify my spell even better if you want....like adding
some leap to it..
 
Status
Not open for further replies.
Top