• 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.

GUI Problem! [Unit isn't created]

Status
Not open for further replies.
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

I think, I must be stupid. I really don't get it, why the unit in the following trigger isn't created =O :

  • TB Cast
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Thunderball
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • TB_MUI[2] Equal to (==) 0
        • Then - Actions
          • Trigger - Turn on TB Loop <gen>
        • Else - Actions
      • Set TB_MUI[1] = (TB_MUI[1] + 1)
      • Set TB_MUI[2] = (TB_MUI[2] + 1)
      • Set TB_Caster[TB_MUI[1]] = (Triggering unit)
      • Set TB_Player[TB_MUI[1]] = (Owner of TB_Caster[TB_MUI[1]])
      • Set TB_Loc1[TB_MUI[1]] = (Position of TB_Caster[TB_MUI[1]])
      • Set TB_Loc2[TB_MUI[1]] = (Position of TB_Caster[TB_MUI[1]])
      • Set TB_Loc3[TB_MUI[1]] = (Position of TB_Caster[TB_MUI[1]])
      • Set TB_Face[TB_MUI[1]] = (Facing of TB_Caster[TB_MUI[1]])
      • Set TB_SwitchHigh[TB_MUI[1]] = 0
      • Set TB_High[TB_MUI[1]] = 150.00
      • Set TB_Ball[TB_MUI[1]] = (For TB_Player[TB_MUI[1]] create a unit of type MyDummy2 at location TB_Loc1[TB_MUI[1]] facing (Facing of TB_Caster[TB_MUI[1]]) degrees)
      • Unit - Turn collision for TB_Ball[TB_MUI[1]] Off
The dummy is fine so there isn't the problem. I also first create the unit and then store it into the variable with "last created unit" but it doesn't work and the hell, I don't know why -_-

Maybe someone can help we this =O

Greetings
~ The Bomb King > Dr. Boom
 
Level 16
Joined
May 1, 2008
Messages
1,605
Moin moin =)

I use JNGP with UMSWE triggers. ( And don't say: omg these trigger are this and this. It's Jass converted to GUI)

And this "create unit" is the same in Jass just in GUI:
JASS:
set udg_TB_Ball[udg_TB_MUI[1]] = CreateUnitAtLoc(udg_TB_Player[udg_TB_MUI[1]], 'h002', udg_TB_Loc1[udg_TB_MUI[1]], GetUnitFacing(udg_TB_Caster[udg_TB_MUI[1]]))

JASS:
function Trig_TB_Cast_Conditions takes nothing returns boolean
    if ( not ( GetSpellAbilityId() == 'A002' ) ) then
        return false
    endif
    return true
endfunction

function Trig_TB_Cast_Func001C takes nothing returns boolean
    if ( not ( udg_TB_MUI[2] == 0 ) ) then
        return false
    endif
    return true
endfunction

function Trig_TB_Cast_Actions takes nothing returns nothing
    if ( Trig_TB_Cast_Func001C() ) then
        call EnableTrigger( gg_trg_TB_Loop )
    else
    endif
    set udg_TB_MUI[1] = ( udg_TB_MUI[1] + 1 )
    set udg_TB_MUI[2] = ( udg_TB_MUI[2] + 1 )
    set udg_TB_Caster[udg_TB_MUI[1]] = GetTriggerUnit()
    set udg_TB_Player[udg_TB_MUI[1]] = GetOwningPlayer(udg_TB_Caster[udg_TB_MUI[1]])
    set udg_TB_Loc1[udg_TB_MUI[1]] = GetUnitLoc(udg_TB_Caster[udg_TB_MUI[1]])
    set udg_TB_Loc2[udg_TB_MUI[1]] = GetUnitLoc(udg_TB_Caster[udg_TB_MUI[1]])
    set udg_TB_Loc3[udg_TB_MUI[1]] = GetUnitLoc(udg_TB_Caster[udg_TB_MUI[1]])
    set udg_TB_Face[udg_TB_MUI[1]] = GetUnitFacing(udg_TB_Caster[udg_TB_MUI[1]])
    set udg_TB_SwitchHigh[udg_TB_MUI[1]] = 0
    set udg_TB_High[udg_TB_MUI[1]] = 150.00
    set udg_TB_Ball[udg_TB_MUI[1]] = CreateUnitAtLoc(udg_TB_Player[udg_TB_MUI[1]], 'h002', udg_TB_Loc1[udg_TB_MUI[1]], GetUnitFacing(udg_TB_Caster[udg_TB_MUI[1]]))
    call SetUnitPathing( udg_TB_Ball[udg_TB_MUI[1]], false )
endfunction

//===========================================================================
function InitTrig_TB_Cast takes nothing returns nothing
    set gg_trg_TB_Cast = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_TB_Cast, EVENT_PLAYER_UNIT_SPELL_EFFECT )
    call TriggerAddCondition( gg_trg_TB_Cast, Condition( function Trig_TB_Cast_Conditions ) )
    call TriggerAddAction( gg_trg_TB_Cast, function Trig_TB_Cast_Actions )
endfunction


But now I see, if I convert the trigger to Jass and make a syntax check, he mark the line " if ( not ( udg_TB_MUI[2] == 0 ) ) then" and say:
"Comparing two variables of different primitive types (except real and integer) is not allowed." - What the....

Greetings
~ The Bomb King > Dr. Boom
 
Level 28
Joined
Jan 26, 2007
Messages
4,789
Could you try using debug messages?

I couldn't see any problems with the trigger, so it might have to do with the trigger not functioning... at all.
Just use Debug messages for:
1) If it activates at all. (first action in the trigger)
2) Name of Triggering Unit (second)
3) X/Y-value of the location (after loc setup)
4) The player (after player setup)
5) Name of last created unit (at the end)

If any of these is not as expected and you still can't figure it out, then update the thread ^^
What could also help is posting the map here, then I can have a look myself :D

(p.s.: try using debug messages every time something unexpected happens, it gives you a very clear view of what the trigger is doing and where exactly it goes wrong).
 
Status
Not open for further replies.
Top