"Expected array index"

Aiden

Member
Reaction score
0
Trigger:
  • Events
    • Unit - A unit Finishes casting an ability
    • Conditions
    • Set Temp_Point4[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
      • If - Conditions
        • Diceroll[(Player number of (Triggering player))] Equal to 2
        • Dicerolldoble[(Player number of (Triggering player))] Equal to 1
      • Then - Actions
        • Item - Create Goblin Land Mines at Temp_Point4[(Player number of (Owner of (Triggering unit)))]
        • Hero - Give (Last created item) to (Triggering unit)
      • Else - Actions
    • Custom script: call RemoveLocation(udg_Temp_Point4)

Custom script: call RemoveLocation(udg_Temp_Point4)
This does a fatal error. i just need delete Temp_point for correct player.
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
There are 2 ways for you to do this yourself without needing the help of us.
1). Copy your trigger, transform it into custom text completely, and then have a look what the jass equivalent to this:
Set Temp_Point4[(Player number of (Owner of (Triggering unit)))]
is, copy it into your custom script line at the appropriate position:
=> win.

2). Declare an integer variable, for example, Temp_Int, to be equal to (Player number of (Owner of (Triggering unit))) and then use the variable instead. This means you will do:
Custom script: call RemoveLocation(udg_Temp_Point4[udg_Temp_Int])

The second method will result in a "larger trigger" but it is more efficient and of a better style.
 

Aiden

Member
Reaction score
0
like this for method 1?
Custom script: call RemoveLocation(udg_Temp_Point4[GetConvertedPlayerId(GetOwningPlayer(GetTriggerUnit()))])
sadasfasfsf
i dont know what im doing =_=
 

Aiden

Member
Reaction score
0
Trigger:
  • Lanzar el dado 1
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
    • Actions
      • Set TempP = (Player number of (Owner of (Triggering unit)))
      • Set Temp_Point4[TempP] = (Position of (Triggering unit))
      • Custom script: call RemoveLocation(udg_Temp_Point4[udg_TempP])

If i understand may look like this, but dosent works. because the item appear. in this litle test im saying do a point, then destroy it, then again do a item in no point existing.
but appears anyway
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
May it be that your unit is in the center of the map? Because if you try to create an item at no set point it will be created at the position (0/0).
 

Accname

2D-Graphics enthusiast
Reaction score
1,462
I cant see a problem in your trigger, are you sure that the above posted code is exactly how it looks like in your editor and there is nothing else which might interfere?
 

Aiden

Member
Reaction score
0
Trigger:
  • Lanzar el dado 1
    • Lanzar el dado Test
      • Events
        • Unit - A unit Finishes casting an ability
      • Conditions
        • (Ability being cast) Equal to DiceMaster (item)
        • (Hero level of (Triggering unit)) Less than 12
      • Actions
        • Set TempP = (Player number of (Owner of (Triggering unit)))
        • Set Temp_Point4[TempP] = (Position of (Triggering unit))
        • Custom script: call RemoveLocation(udg_Temp_Point4[udg_TempP])
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • Gold_Score[(Player number of (Owner of (Triggering unit)))] Less than or equal to Puntajeporpralyer
          • Then - Actions
            • Set Diceroll[(Player number of (Owner of (Triggering unit)))] = 2
            • Set Dicerolldoble[(Player number of (Triggering player))] = (Random integer number between 1 and 2)
            • -------- Numeros 2 --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Diceroll[(Player number of (Triggering player))] Equal to 2
                • Dicerolldoble[(Player number of (Triggering player))] Equal to 1
              • Then - Actions
                • Item - Create Goblin Land Mines at Temp_Point4[(Player number of (Owner of (Triggering unit)))]
                • Hero - Give (Last created item) to (Triggering unit)
              • Else - Actions
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Diceroll[(Player number of (Triggering player))] Equal to 2
                • Dicerolldoble[(Player number of (Triggering player))] Equal to 2
              • Then - Actions
                • Item - Create Aldos Firestar at Temp_Point4[(Player number of (Owner of (Triggering unit)))]
                • Hero - Give (Last created item) to (Triggering unit)
              • Else - Actions
          • Else - Actions
        • Item - Make (Last created item) Undroppable

Well this its whole trigger :/
 

Aiden

Member
Reaction score
0
now works.
problem Hero - Give (Last created item) to (Triggering unit)
thanks +rep
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
it would create less lag if you cleared the point after the actions rather than before, because the way it is now it saves that variable until the roll ability is cast again, possibly the rest of the game for no reason
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top