• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Triggers

Status
Not open for further replies.
Level 10
Joined
Jun 20, 2017
Messages
333
I want a trigger to show the timer to multiboard that if a particular unit is standing elsewhere for more than 1.30 minutes.
Something like these pictures
0.jpg

2.jpg
 
Last edited:
Level 13
Joined
Oct 12, 2016
Messages
769
Well, your trigger there won't work since there's no "triggering player" for an Elapsed Time event.
I suggest making a periodic event (every 1.00 seconds, since it's a clock), then looping through the players to display the time in real time.
You can increment the AFK timer every 1 second of the periodic event, then reset the field to 0:00 through whatever conditions you use to detect an AFK player.
 
Level 10
Joined
Jun 20, 2017
Messages
333
I want a trigger to show the timer to multiboard that if a particular unit is standing elsewhere for more than 1.30 minutes.
Something like these pictures
0.jpg

2.jpg


Does this work?
  • AFK
    • Events
      • Time - Every 1.00 seconds of game time
    • Conditions
    • Actions
      • Set Integer_AFK = ((Player number of (Triggering player)) + (Player number of (Triggering player)))
      • For each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Boolean_AFK Equal to True
            • Then - Actions
              • Set Integer_AFK = ((Player number of (Triggering player)) + (Player number of (Triggering player)))
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • Integer_AFK Equal to 29
                • Then - Actions
                  • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + is now afk.)
                  • Multiboard - Set the text for Multiboard[(Integer B)] item in column 2, row (Integer_RowPlayers[(Player number of (Picked player))] + 2) to (((String(Integer_TimeHour)) + :) + (((String(Integer_TimeMinutes)) + :) + ((String(Integer_TimeSeconds)) + |r)))
                • Else - Actions
            • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • Integer_AFK Equal to 30
        • Then - Actions
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
When your hero buys 4 different items. The hero will change in that location.

  • Change
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Hero manipulating item) of type 1 of 4 Key)) Equal to 1 of 4 Key
          • (Item-type of (Item carried by (Hero manipulating item) of type 2 of 4 Key)) Equal to 2 of 4 Key
          • (Item-type of (Item carried by (Hero manipulating item) of type 3 of 4 Key)) Equal to 3 of 4 Key
          • (Item-type of (Item carried by (Hero manipulating item) of type 4 of 4 Key)) Equal to 4 of 4 Key
        • Then - Actions
          • Item - Remove (Item carried by (Hero manipulating item) of type 1 of 4 Key)
          • Item - Remove (Item carried by (Hero manipulating item) of type 2 of 4 Key)
          • Item - Remove (Item carried by (Hero manipulating item) of type 3 of 4 Key)
          • Item - Remove (Item carried by (Hero manipulating item) of type 4 of 4 Key)
          • Unit - Replace (Triggering unit) with a Arthas using The old unit's relative life and mana
          • Special Effect - Create a special effect at (Position of (Hero manipulating item)) using Abilities\Spells\Items\AIlm\AIlmTarget.mdl
        • Else - Actions
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
Kick player with writing (kick number) that works with yes to kick player then you have 1 minutes to vote(the amount of vote works same dota).
If you type nothing, it will be reset after 1 minute.

  • Kick
    • Events
      • Player - Player 1 (Red) types a chat message containing -kick as An exact match
      • Player - Player 1 (Red) types a chat message containing -yes as An exact match
    • Conditions
      • Boolean_Kick[(Player number of (Triggering player))] Equal to False
    • Actions
      • Set Boolean_Kick[(Player number of (Triggering player))] = True
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Entered chat string) Equal to -yes
        • Then - Actions
          • Set Integer_KickYes = (Integer_KickYes + 1)
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + you already have voted.)
        • Else - Actions
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
Why is my ability to change the unit not working?
4.jpg

ability
5.jpg

6.jpg

unit
7.jpg

8.jpg



  • Infernal Upgrades
    • Events
      • Unit - A unit Finishes an upgrade
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Infernal
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Ranged Infernal using The old unit's relative life and mana
          • Unit - Replace (Triggering unit) with a Frozen Infernal using The old unit's relative life and mana
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Ranged Infernal
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Corrupted Infernal using The old unit's relative life and mana
          • Unit - Replace (Triggering unit) with a Frozen Infernal using The old unit's relative life and mana
        • Else - Actions
 
Level 10
Joined
Jun 20, 2017
Messages
333
Because you don't have an upgrade, but an ability that does it, the event should be "a unit starts an effect of ability" and then have a condition to detect which ability was used.

So the problem is the unit have 2 ability to change, but 1 of them works
For example, I have ranged infernal and I want to turn it into a frozen infernal, But it turns into a corrupted infernal

  • Infernal Upgrades
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Triggering unit)) Equal to Infernal
          • (Unit-type of (Triggering unit)) Equal to Ranged Infernal
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to Infernal
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Ranged Infernal using The old unit's relative life and mana
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to Infernal
            • Then - Actions
              • Unit - Replace (Triggering unit) with a Frozen Infernal using The old unit's relative life and mana
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Unit-type of (Triggering unit)) Equal to Ranged Infernal
                • Then - Actions
                  • Unit - Replace (Triggering unit) with a Corrupted Infernal using The old unit's relative life and mana
                • Else - Actions
                  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Unit-type of (Triggering unit)) Equal to Ranged Infernal
                    • Then - Actions
                      • Unit - Replace (Triggering unit) with a Frozen Infernal using The old unit's relative life and mana
                    • Else - Actions
 
Level 10
Joined
Jun 20, 2017
Messages
333
How to fix this? What should I change?

1.jpg

2.jpg

3.jpg

4.jpg


JASS:
globals
constant integer Base_x_Index = 0
constant integer Base_y_Index = 1
constant integer Main_Timer_Index = 2
constant integer Player_Index = 3
constant integer Unit_1_Index = 4
constant integer Unit_Phase_1_Index = 5
constant integer Unit_2_Index = 6
constant integer Unit_Phase_2_Index = 7
constant integer Unit_3_Index = 8
constant integer Unit_Phase_3_Index = 9
constant integer Unit_4_Index = 10
constant integer Unit_Phase_4_Index = 11
constant integer Unit_5_Index = 12
constant integer Unit_Phase_5_Index = 13
constant integer Unit_6_Index = 14
constant integer Unit_Phase_6_Index = 15
constant integer Unit_7_Index = 16
constant integer Unit_Phase_7_Index = 17
constant integer Unit_8_Index = 18
constant integer Unit_Phase_8_Index = 19
constant integer Unit_Range_Index = 20
constant integer Unit_Slow_T_Index = 21
constant integer Unit_Phase_9_Index = 22
constant integer Unit_9_Index = 23
constant integer Unit_Phase_10_Index = 24
constant integer Unit_10_Index = 25
constant integer Unit_Phase_11_Index = 26
constant integer Unit_11_Index = 27
constant integer Unit_Phase_12_Index = 28
constant integer Unit_12_Index = 29
constant integer MAX_RC_ALLOWED = 3
integer array StartedRC
real MapMinX = 0.
real MapMinY = 0.
real MapMaxX = 0.
real MapMaxY = 0.
endglobals

struct CheckerPoint {
integer Base_X
integer Base_Y
}

function SafeX takes real x returns real
if MapMinX < x && x < MapMaxX
return x
elseif MapMinX > x
return MapMinX
elseif x > MapMaxX
return MapMaxX
endif
return x
endfunction

function SafeY takes real y returns real
if MapMinY < y && y < MapMaxY
return y
elseif MapMinY > y
return MapMinY
elseif y > MapMaxY
return MapMaxY
endif
return y
endfunction

function Trig_RangeChecker_Conditions takes nothing returns boolean
return GetSpellAbilityId() == 'A034'
endfunction

function Move1stStage takes nothing returns nothing
local timer tm = GetExpiredTimer()
local integer Handle = LoadInteger(Main_Hash, GetHandleId(tm), 0)
local real Range = LoadReal(Main_Hash, Handle, Unit_Range_Index)
local real x0 = LoadReal(Main_Hash, Handle, Base_x_Index)
local real y0 = LoadReal(Main_Hash, Handle, Base_y_Index)
local real Timer = LoadReal(Main_Hash, Handle, Main_Timer_Index)
local real Slow_T = LoadReal(Main_Hash, Handle, Unit_Slow_T_Index)
local real x_temp = 0.
local real y_temp = 0.
local real Length = 0.
local unit u = LoadUnitHandle(Main_Hash, Handle, Unit_1_Index)
local real Phase = LoadReal(Main_Hash, Handle, Unit_Phase_1_Index)
local real PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________

Length = Timer*Range/4 // _____ __ ____ __ _______ _______

if Length >= Range
Length = Range
endif

x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) - 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_2_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_2_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_3_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_3_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) - 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_4_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_4_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_5_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_5_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) - 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_6_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_6_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_7_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_7_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) - 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_8_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_8_Index)
PhaseForSin = Timer*360./4 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_9_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_9_Index)
PhaseForSin = Timer*360./8 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
//y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
y_temp = y0
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_10_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_10_Index)
PhaseForSin = Timer*360./8 + Phase // ____________ ________ __ _______ ___ 360 ________
x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
//y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
y_temp = y0
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_11_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_11_Index)
PhaseForSin = Timer*360./8 + Phase // ____________ ________ __ _______ ___ 360 ________
//x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
x_temp = x0
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

u = LoadUnitHandle(Main_Hash, Handle, Unit_12_Index)
Phase = LoadReal(Main_Hash, Handle, Unit_Phase_12_Index)
PhaseForSin = Timer*360./8 + Phase // ____________ ________ __ _______ ___ 360 ________
//x_temp = x0 + Length * Cos(bj_DEGTORAD*PhaseForSin)
x_temp = x0
y_temp = y0 + Length * Sin(bj_DEGTORAD*PhaseForSin)
SetUnitX(u, SafeX(x_temp))
SetUnitY(u, SafeY(y_temp))
SetUnitFacing(u, GetUnitFacing(u) + 5)

if Timer <= 8.00
Timer = Timer + 0.02
TimerStart(tm, 0.02, false, function Move1stStage)
elseif Timer <= 12.00
Slow_T = Slow_T - 0.0001
if Slow_T >= 0
Timer = Timer + Slow_T
TimerStart(tm, 0.02, false, function Move1stStage)
else
if HaveSavedHandle(Main_Hash, Handle, Unit_1_Index) // ____ ________ ____________ -1
StartedRC[GetPlayerId(GetOwningPlayer(LoadUnitHandle(Main_Hash, Handle, Unit_1_Index)))] = StartedRC[GetPlayerId(GetOwningPlayer(LoadUnitHandle(Main_Hash, Handle, Unit_1_Index)))] - 1
endif
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_1_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_2_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_3_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_4_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_5_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_6_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_7_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_8_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_9_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_10_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_11_Index))
KillUnit(LoadUnitHandle(Main_Hash, Handle, Unit_12_Index))
FlushChildHashtable(Main_Hash, Handle)
FlushChildHashtable(Main_Hash, GetHandleId(tm))
DestroyTimer(tm)
tm = null
endif
endif

SaveReal(Main_Hash, Handle, Main_Timer_Index,Timer)
SaveReal(Main_Hash, Handle, Unit_Slow_T_Index,Slow_T)
u = null
endfunction

function MoveChecker takes integer Handle returns nothing
local real x0 = LoadReal(Main_Hash, Handle, Base_x_Index)
local real y0 = LoadReal(Main_Hash, Handle, Base_y_Index)
local real Timer = LoadReal(Main_Hash, Handle, Main_Timer_Index)
local integer PId = LoadInteger(Main_Hash, Handle, Player_Index)
local timer tm = CreateTimer()

Timer = Timer + 0.02
SaveReal(Main_Hash, Handle, Main_Timer_Index,Timer)

if Timer <= 0.01 // ______ _______ _______
SaveUnitHandle(Main_Hash, Handle, Unit_1_Index, CreateUnit(Player(PId), 'h01J', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_1_Index, 0.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_1_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_2_Index, CreateUnit(Player(PId), 'h01K', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_2_Index, 45.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_2_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_3_Index, CreateUnit(Player(PId), 'h01L', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_3_Index, 90.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_3_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_4_Index, CreateUnit(Player(PId), 'h01M', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_4_Index, 135.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_4_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_5_Index, CreateUnit(Player(PId), 'h01N', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_5_Index, 180.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_5_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_6_Index, CreateUnit(Player(PId), 'h01O', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_6_Index, 225.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_6_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_7_Index, CreateUnit(Player(PId), 'h01Q', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_7_Index, 270.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_7_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_8_Index, CreateUnit(Player(PId), 'h01P', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_8_Index, 315.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_8_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_9_Index, CreateUnit(Player(PId), 'h01N', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_9_Index, 0.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_9_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_10_Index, CreateUnit(Player(PId), 'h01N', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_10_Index, 180.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_10_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_11_Index, CreateUnit(Player(PId), 'h01N', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_11_Index, 90.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_11_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)

SaveUnitHandle(Main_Hash, Handle, Unit_12_Index, CreateUnit(Player(PId), 'h01N', x0, y0, 0.))
SaveReal(Main_Hash, Handle, Unit_Phase_12_Index, 270.)
//SetUnitVertexColor(LoadUnitHandle(Main_Hash, Handle, Unit_12_Index), GetRandomInt(0,255), GetRandomInt(0,255), GetRandomInt(0,255), 255)
MoveChecker(Handle)
endif
SaveInteger(Main_Hash, GetHandleId(tm), 0, Handle)
TimerStart(tm, 0.02, false, function Move1stStage)
tm = null
endfunction

function Trig_RangeChecker_Actions takes nothing returns nothing
local unit u = GetSpellAbilityUnit()
local real x0 = GetUnitX(u)
local real y0 = GetUnitY(u)
local integer Handle = GetHandleId(u)
local integer PId = GetPlayerId(GetOwningPlayer(u))

if StartedRC[PId] < MAX_RC_ALLOWED
StartedRC[PId] = StartedRC[PId] + 1
SaveReal(Main_Hash, Handle, Base_x_Index, x0)
SaveReal(Main_Hash, Handle, Base_y_Index, y0)
SaveReal(Main_Hash, Handle, Main_Timer_Index, -0.02)
SaveReal(Main_Hash, Handle, Unit_Slow_T_Index, 0.02)
SaveInteger(Main_Hash, Handle, Player_Index, PId)
SaveReal(Main_Hash, Handle, Unit_Range_Index, GetUnitAcquireRange(u))
MoveChecker(Handle)
else
EchoPlayer(PId, "Only " + I2S(MAX_RC_ALLOWED) + " rangecheckers allowed at once.")
endif
u = null
endfunction

function InitTrig_RangeChecker takes nothing returns nothing
set gg_trg_RangeChecker = CreateTrigger(  )
call TriggerRegisterAnyUnitEventBJ( gg_trg_RangeChecker, EVENT_PLAYER_UNIT_SPELL_CAST )
call TriggerAddCondition( gg_trg_RangeChecker, Condition( function Trig_RangeChecker_Conditions ) )
call TriggerAddAction( gg_trg_RangeChecker, function Trig_RangeChecker_Actions )
endfunction
 
Level 39
Joined
Feb 27, 2007
Messages
5,013
I know you don't understand JASS, but... the pjass syntax checker literally tells you what the problem is right there. "Undeclared variable Main_Hash" means a variable named Main_Hash should have existed (because the line that threw the error referenced it) but wasn't declared anywhere. Same for the other 2 lines with the same description. "Undeclared function EchoPlayer" means a function named EchoPlayer should have existed (because the line that threw the error referenced it) but it wasn't declared anywhere.

Now, I happen to know that the EchoPlayer function does exist in one of the libraries you PM'd to me:
JASS:
library C

function ParserCalc takes string s returns real
    if s == "A" or s == "a" then
        return 0.8
    elseif s == "B" or s == "b" then
        return 0.3
    elseif s == "C" or s == "c" then
        return 0.7
    elseif s == "D" or s == "d" then
        return 0.8
    elseif s == "E" or s == "e" then
        return 0.9
    elseif s == "F" or s == "f" then
        return 0.3
    elseif s == "G" or s == "g" then
        return 0.4
    elseif s == "H" or s == "h" then
        return 0.8
    elseif s == "I" or s == "i" then
        return 0.9
    elseif s == "J" or s == "j" then
        return 1.
    elseif s == "K" or s == "k" then
        return 1.1
    elseif s == "L" or s == "l" then
        return 1.2
    elseif s == "M" or s == "m" then
        return 1.3
    elseif s == "N" or s == "n" then
        return 1.4
    elseif s == "O" or s == "o" then
        return 1.5
    elseif s == "P" or s == "p" then
        return 1.6
    elseif s == "Q" or s == "q" then
        return 1.7
    elseif s == "R" or s == "r" then
        return 1.8
    elseif s == "S" or s == "s" then
        return 1.9
    elseif s == "T" or s == "t" then
        return 2.0
    elseif s == "U" or s == "u" then
        return 2.1
    elseif s == "V" or s == "v" then
        return 2.2
    elseif s == "W" or s == "w" then
        return 2.3
    elseif s == "X" or s == "x" then
        return 2.4
    elseif s == "Y" or s == "y" then
        return 2.5
    elseif s == "Z" or s == "z" then
        return 2.6
    else
        return 0.3
    endif
return 0.0
endfunction

function GetPlayerColoredName takes integer i returns string
    if i == 0 then
        return ("|c00ff0202" + (GetPlayerName(Player(0)) + "|r"))
    elseif i == 1 then
        return ("|c000041ff" + (GetPlayerName(Player(1)) + "|r" ))
    elseif i == 2 then
        return ("|c001be5b8" + (GetPlayerName(Player(2))  + "|r" ))
    elseif i == 3 then
        return ("|c00530080" + (GetPlayerName(Player(3))  + "|r" ))
    elseif i == 4 then
        return ("|c00fffc00" + (GetPlayerName(Player(4)) + "|r" ))
    elseif i == 5 then
        return ("|c00fe890d" + (GetPlayerName(Player(5)) + "|r" ))
    elseif i == 6 then
        return ("|c001fbf00" + (GetPlayerName(Player(6)) + "|r" ))
    elseif i == 7 then
        return ("|c00e45aaf" + (GetPlayerName(Player(7)) + "|r" ))
    elseif i == 10 then
        return ("|c000f6145" + (GetPlayerName(Player(10)) + "|r" ))
    elseif i == 11 then
        return ("|c004d2903" + (GetPlayerName(Player(11)) + "|r" ))
    endif
return null
endfunction

function EchoForce takes force toForce, real duration, string message returns nothing
    if (IsPlayerInForce(GetLocalPlayer(), toForce)) then
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, duration, message)
    endif
endfunction

function EchoAllPlayers takes real duration, string message returns nothing
    if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
        call DisplayTimedTextToPlayer(GetLocalPlayer(), 0, 0, duration, message)
    endif
endfunction


function EchoPlayer takes integer PId, string text returns nothing
    DisplayTextToPlayer(Player(PId),0,0, text)
endfunction

function EchoPlayerM takes integer PId, string text returns nothing // minute edition
    DisplayTimedTextToPlayer(Player(PId),0,0, 60., text)
endfunction


function ClearPlayerTextMessages takes integer PId returns nothing
    if GetLocalPlayer() == Player(PId)
        ClearTextMessages()
    endif
endfunction


endlibrary
However, this library has a few errors in it and probably won't compile because of them. Or maybe it will because Zinc allows you to leave off calls, and I see { ... } syntax in the struct definition in the code you posted? I for the life of me have no idea if Zinc needs something special installed in the WE to work or if WEX supports it naturally. At any rate, try importing library C into your map and seeing if that gets rid of the EchoPlayer errors. If you can't, then add this into your map:
JASS:
function EchoPlayer takes integer PId, string text returns nothing
    call DisplayTextToPlayer(Player(PId),0,0, text)
endfunction

For the Main_Hash errors you're also probably missing a library somewhere that set up the hashtable, so look around for that in wherever you got the code you posted for something that has Main_Hash defined in a globals block. If you can't, try putting this into your map:
JASS:
library HashLibraryWorkaround initializer init
  globals
    hashtable Main_Hash
  endglobals

  private function init takes nothing returns nothing
    set Main_Hash = InitHashTable()
  endfunction
endlibrary

Finally, I think you're going to throw an error on this line too: call TriggerAddCondition( gg_trg_RangeChecker, Condition( function Trig_RangeChecker_Conditions ) ) since I don't see that condition function anywhere in your code. If you do get that error, just put // in that line just before the "call" to comment it out.
Could you create new threads for new problems
Please do this.
 
Level 10
Joined
Jun 20, 2017
Messages
333
How to make it longer more than one second? Also how to make it animated? and why dummy unit doesnt show on the fog?

my range

like this

  • Range Checker
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Check Range
    • Actions
      • Set Loc[1] = (Position of (Triggering unit))
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Set Loc[2] = (Loc[1] offset by (Current acquisition range of (Triggering unit)) towards ((Real((Integer A))) x 30.00) degrees)
            • Special Effect - Create a special effect at Loc[2] using Doodads\Cinematic\GlowingRunes\GlowingRunes8.mdl
            • Special Effect - Destroy (Last created special effect)
            • Custom script: call RemoveLocation(udg_Loc[2])
      • Custom script: call RemoveLocation(udg_Loc[1])
 
Last edited:
Level 39
Joined
Feb 27, 2007
Messages
5,013
Just saying again: it is really confusing to come back to a thread where you've edited the title and removed all your previous posts wondering wtf is going on here.

When you do Create SFX and immediately do Destroy SFX it only lasts for as long as the idle animation of that effect takes. In this case about a second. You're not using any units so I don't know what you mean about it not showing up in the fog. Doodads and destructables are the only thing I know of that show in Fog of War, but creating those on-demand is either impossible or not practical. To animate this you're going to need to use a timer and some Visualize: Dynamic Indexing
 
Level 10
Joined
Jun 20, 2017
Messages
333
whats wrong with this trading system?
I wanna make it work when a player writes -gg 1 1000 its giving player 1 1000 gold or -gw 1 1000 give player 1 1000 wood

  • Trading
    • Events
      • Player - Player 1 (Red) types a chat message containing -as as A substring
      • Player - Player 2 (Blue) types a chat message containing -as as A substring
      • Player - Player 3 (Teal) types a chat message containing -as as A substring
      • Player - Player 4 (Purple) types a chat message containing -as as A substring
      • Player - Player 5 (Yellow) types a chat message containing -as as A substring
      • Player - Player 6 (Orange) types a chat message containing -as as A substring
      • Player - Player 7 (Green) types a chat message containing -as as A substring
      • Player - Player 8 (Pink) types a chat message containing -as as A substring
      • Player - Player 9 (Gray) types a chat message containing -as as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -as as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -as as A substring
      • Player - Player 12 (Brown) types a chat message containing -as as A substring
    • Conditions
    • Actions
      • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
        • Loop - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Substring((Entered chat string), 10, (15 + (Length of String_PlayerColors[(Integer A)])))) Equal to (==) String_PlayerColors[(Integer A)]
              • ((Triggering player) is an ally of (Player((Integer A)))) Equal to (==) True
            • Then - Actions
              • Set Integer_Trad = (Integer((Substring((Entered chat string), (10 + (Length of String_PlayerColors[(Integer A)])), 15))))
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Substring((Entered chat string), 5, 10)) Equal to (==) (Name of (Player((Integer A))))
                    • ((Triggering player) Current gold) Greater than or equal to (>=) Integer_Trad
                  • Then - Actions
                    • Player - Add Integer_Trad to (Player((Integer A))) Current gold
                    • Player - Add (Integer_Trad x -1) to (Triggering player) Current gold
                    • Game - Display to (All players) the text: (String_PlayerColors[(Integer A)] + ((|r has given + String_PlayerColors[(Integer A)]) + (|r |CFFFFFF00 + ((String(Integer_Trad)) + |r gold.))))
                  • Else - Actions
                • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • (Substring((Entered chat string), 5, 10)) Equal to (==) (Name of (Player((Integer A))))
                    • ((Triggering player) Current lumber) Greater than or equal to (>=) Integer_Trad
                  • Then - Actions
                    • Player - Add Integer_Trad to (Player((Integer A))) Current lumber
                    • Player - Add (Integer_Trad x -1) to (Triggering player) Current lumber
                    • Game - Display to (All players) the text: (String_PlayerColors[(Integer A)] + ((|r has given + String_PlayerColors[(Integer A)]) + (|r |CFF008000 + ((String(Integer_Trad)) + |r lumber.))))
                  • Else - Actions
            • Else - Actions
 
Level 10
Joined
Jun 20, 2017
Messages
333
How to fix this? when a unit buy an item that item should kill the enemy unit with 1 attack

  • Heroic Heartbreak
    • Events
      • Unit - A unit Acquires an item
    • Conditions
      • Multiple ConditionsOr - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Hero manipulating item)) Equal to (==) Kael
          • (Unit-type of (Hero manipulating item)) Equal to (==) Arthas
          • (Unit-type of (Hero manipulating item)) Equal to (==) Maiev
          • (Unit-type of (Hero manipulating item)) Equal to (==) Malfurion
          • (Unit-type of (Hero manipulating item)) Equal to (==) Rexxar
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Hero manipulating item) of type Heroic-Heartbreak)) Equal to (==) Heroic-Heartbreak
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Sound - Play HumanX1 <gen>
          • Environment - Create at (Playable map area) the weather effect Rays Of Light
          • Environment - Turn (Last created weather effect) On
          • Visibility - Disable fog of war
          • Wait 15.00 seconds
          • Visibility - Enable fog of war
          • Environment - Remove (Last created weather effect)
        • Else - Actions
          • Unit - Kill (Attacked unit)
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
How to solve this? As you see in the video, when I click to use an ability, after that the page becomes dark and the first and second sound will not be played.
my atomic


like this

  • Sacrifice
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to (==) Sacrifice [Undead]
    • Actions
      • Trigger - Turn off (This trigger)
      • Sound - Play VolcanoLoop <gen>
      • Cinematic - Fade out over 5.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Camera - Shake the camera for (Triggering player) with magnitude 25.00
      • Wait 7.00 seconds
      • Sound - Play ThunderClapCaster <gen>
      • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • Destructible - Kill (Picked destructible)
          • Destructible - Remove (Picked destructible)
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit - Explode (Picked unit)
          • Unit - Kill (Picked unit)
          • Unit - Remove (Picked unit) from the game
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • Item - Remove (Picked item)
      • Wait 10.00 seconds
      • Visibility - Disable fog of war
      • Environment - Create a 10.00 second Normal ripple deformation at (Center of (Playable map area)) with starting radius 10.00, ending radius 50000.00, and depth 300.00, using 1.00 second ripples spaced 512.00 apart
      • Cinematic - Fade in over 10.00 seconds using texture White Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Camera - Stop swaying/shaking the camera for (Triggering player)
      • Game - Set the time of day to 24.00
      • Environment - Create Blight for (Triggering player) across (Playable map area)
      • Environment - Set fog to style Linear, z-start 1000.00, z-end 8000.00, density 0.90 and color (1.00%, 0.00%, 0.00%)
        • Do Multiple ActionsFor each (Integer B) from 1 to 3, do (Actions)
          • Loop - Actions
            • Multiboard - Set the text for Multiboard[(Integer B)] item in column 1, row (Integer_RowPlayers[(Player number of (Triggering player))] + 2) to (String_PlayerColors[(Player number of (Triggering player))] + (Dead)|r)
      • Game - Display to (All players) the text: The vampires were v...
      • Sound - Play PH1 <gen>
      • Wait 60.00 seconds
      • Player Group - Pick every player in PlayerGroup_Vampires and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
      • Player Group - Pick every player in PlayerGroup_Humans and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked player) with the message: Defeat!
 
Last edited:
Level 10
Joined
Jun 20, 2017
Messages
333
How to fix this leak? When I use the ability to kill everyone, multiboard only shows that I'm dead.

  • Sacrifice
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to (==) Sacrifice [Undead]
    • Actions
      • Trigger - Turn off (This trigger)
      • Sound - Play VolcanoLoop <gen>
      • Cinematic - Fade out over 5.00 seconds using texture Black Mask and color (0.00%, 0.00%, 0.00%) with 0.00% transparency
      • Camera - Shake the camera for (Triggering player) with magnitude 25.00
      • Wait 7.00 seconds
      • Sound - Play ThunderClapCaster <gen>
      • Cinematic - Fade out over 1.00 seconds using texture White Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Destructible - Pick every destructible in (Playable map area) and do (Actions)
        • Loop - Actions
          • Destructible - Kill (Picked destructible)
          • Destructible - Remove (Picked destructible)
      • Unit Group - Pick every unit in (Units in (Playable map area)) and do (Actions)
        • Loop - Actions
          • Unit - Explode (Picked unit)
          • Unit - Kill (Picked unit)
          • Unit - Remove (Picked unit) from the game
      • Item - Pick every item in (Playable map area) and do (Actions)
        • Loop - Actions
          • Item - Remove (Picked item)
      • Wait 10.00 seconds
      • Visibility - Disable fog of war
      • Environment - Create a 10.00 second Normal ripple deformation at (Center of (Playable map area)) with starting radius 10.00, ending radius 50000.00, and depth 300.00, using 1.00 second ripples spaced 512.00 apart
      • Cinematic - Fade in over 10.00 seconds using texture White Mask and color (100.00%, 100.00%, 100.00%) with 0.00% transparency
      • Camera - Stop swaying/shaking the camera for (Triggering player)
      • Game - Set the time of day to 24.00
      • Environment - Create Blight for (Triggering player) across (Playable map area)
      • Environment - Set fog to style Linear, z-start 1000.00, z-end 8000.00, density 0.90 and color (1.00%, 0.00%, 0.00%)
        • Do Multiple ActionsFor each (Integer B) from 1 to 3, do (Actions)
          • Loop - Actions
            • Multiboard - Set the text for Multiboard[(Integer B)] item in column 1, row (Integer_RowPlayers[(Player number of (Triggering player))] + 2) to (String_PlayerColors[(Player number of (Triggering player))] + (Dead)|r)
      • Game - Display to (All players) the text: The vampires were v...
      • Sound - Play PH1 <gen>
      • Wait 60.00 seconds
      • Player Group - Pick every player in PlayerGroup_Vampires and do (Actions)
        • Loop - Actions
          • Game - Victory (Picked player) (Show dialogs, Show scores)
      • Player Group - Pick every player in PlayerGroup_Humans and do (Actions)
        • Loop - Actions
          • Game - Defeat (Picked player) with the message: Defeat!
 
Level 10
Joined
Jun 20, 2017
Messages
333
How to solve this problem? When I click on an ability(using channel), that prepare a new page to buy. But my selection is gone
a.jpg

b.jpg




work like this

  • Shop Pages
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to (==) Vampires Research Center
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Vampires Research Center (2) using The old unit's relative life and mana
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to (==) Vampires Research Center (2)
            • Then - Actions
              • Unit - Replace (Triggering unit) with a Vampires Research Center using The old unit's relative life and mana
            • Else - Actions
 
Level 9
Joined
Jul 30, 2018
Messages
445
Whoah.. You sure know how to flood a page. Okay, let's see...

First of all, that your trading system seems just awfully complicated. I can't even say what's working and what's not. It could be just as simple as this:

  • Untitled Trigger 001
    • Events
      • Player - Player 1 (Red) types a chat message containing -g as A substring
      • Player - Player 2 (Blue) types a chat message containing -g as A substring
      • Player - Player 3 (Teal) types a chat message containing -g as A substring
      • Player - Player 4 (Purple) types a chat message containing -g as A substring
      • ... And so on ...
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 3)) Equal to -gg
        • Then - Actions
          • Set TradedPlayer = (Integer((Substring((Entered chat string), 5, 5))))
          • Set TradeAmount = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
          • Player - Add TradeAmount to (Player(TradedPlayer)) Current gold
          • Custom script: call DisplayTextToForce( GetPlayersAll(), GetPlayerName(GetTriggerPlayer()) + " gave " + (I2S(udg_TradeAmount)) + " gold to " + GetPlayerName(ConvertedPlayer(udg_TradedPlayer)) )
        • Else - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 3)) Equal to -gw
        • Then - Actions
          • Set TradedPlayer = (Integer((Substring((Entered chat string), 5, 5))))
          • Set TradeAmount = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
          • Player - Add TradeAmount to (Player(TradedPlayer)) Current lumber
          • Custom script: call DisplayTextToForce( GetPlayersAll(), GetPlayerName(GetTriggerPlayer()) + " gave " + (I2S(udg_TradeAmount)) + " lumber to " + GetPlayerName(ConvertedPlayer(udg_TradedPlayer)) )
        • Else - Actions

About the second one: (Attacked unit) refers to a trigger event "Unit is Attacked". If you want an instant kill item and do it through triggers you have make a trigger with said event. That your trigger is now ran only when you pick up the item.

I don't know if this is actually the most efficient way to make it, but something like this:

  • Untitled Trigger 002
    • Events
      • Unit - A unit Is attacked
    • Conditions
    • Actions
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Item-type of (Item carried by (Attacking unit) in slot (Integer A))) Equal to [Your item]
            • Then - Actions
              • Unit - Kill (Attacked unit)
              • -------- or --------
              • Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (Real((Max HP of (Attacked unit)))) damage of attack type Chaos and damage type Universal
            • Else - Actions

With the latter action the killing unit will get credit for killing the unit, like gains XP and the player gets points from the kill in the end screen, if you care about those. If you just simply want to kill off the unit, use Unit - Kill.

About the third one: there a couple of leaks. Sounds leak, so destroy the sound with Sound - Destroy (Last played sound), unit groups leak, so put Custom script: set bj_wantDestroyGroup = true before creating a group. Alternatively you can put the group in a variable and then destroy the variable with call DestroyGroup(udg_YouGroupVariableName). And player groups leak also (except (All players)) so they must be destroyed with call DestroyForce(udg_YouPlayerGroupVariableName). You should read this: Memory Leaks

And about the last one: you have to add an action Selection - Select Unit for Player X after replacing the unit.
 
Level 10
Joined
Jun 20, 2017
Messages
333
This works, but you can't submit if you dont have enough resources and cant send more than x references in a minute.
And the amount of resources from the menu above will not be reduced, and you shouldnt send resources to the enemy group.


  • Trading
    • Events
      • Player - Player 1 (Red) types a chat message containing -g as A substring
      • Player - Player 2 (Blue) types a chat message containing -g as A substring
      • Player - Player 3 (Teal) types a chat message containing -g as A substring
      • Player - Player 4 (Purple) types a chat message containing -g as A substring
      • Player - Player 5 (Yellow) types a chat message containing -g as A substring
      • Player - Player 6 (Orange) types a chat message containing -g as A substring
      • Player - Player 7 (Green) types a chat message containing -g as A substring
      • Player - Player 8 (Pink) types a chat message containing -g as A substring
      • Player - Player 9 (Gray) types a chat message containing -g as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -g as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -g as A substring
      • Player - Player 12 (Brown) types a chat message containing -g as A substring
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 3)) Equal to (==) -gg
        • Then - Actions
          • Set Integer_TradePlayer = (Integer((Substring((Entered chat string), 5, 5))))
          • Set Integer_TradeAmount = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
          • Player - Add Integer_TradeAmount to (Player(Integer_TradePlayer)) Current gold
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + ((|r has given + String_PlayerColors[Integer_TradePlayer]) + (|r |CFFFFFF00 + ((String(Integer_TradeAmount)) + |r gold.))))
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 3)) Equal to (==) -gw
        • Then - Actions
          • Set Integer_TradePlayer = (Integer((Substring((Entered chat string), 5, 5))))
          • Set Integer_TradeAmount = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
          • Player - Add Integer_TradeAmount to (Player(Integer_TradePlayer)) Current lumber
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + ((|r has given + String_PlayerColors[Integer_TradePlayer]) + (|r |CFF008000 + ((String(Integer_TradeAmount)) + |r lumber.))))
        • Else - Actions



about pages doesn't work
  • Shop Pages
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Unit-type of (Triggering unit)) Equal to (==) Vampires Research Center
        • Then - Actions
          • Unit - Replace (Triggering unit) with a Vampires Research Center (2) using The old unit's relative life and mana
          • Selection - Select (Triggering unit) for (Triggering player)
        • Else - Actions
          • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Unit-type of (Triggering unit)) Equal to (==) Vampires Research Center (2)
            • Then - Actions
              • Unit - Replace (Triggering unit) with a Vampires Research Center using The old unit's relative life and mana
              • Selection - Select (Triggering unit) for (Triggering player)
            • Else - Actions
 
Last edited:
Level 9
Joined
Jul 30, 2018
Messages
445
Oh right. Well, yeah, that was just the basic principle how it works. You have to use more if's to check if the player has the resources. Like if triggering player's current gold is equal to or greater than TradedAmount then do the trade, else do nothing, or like make a game message saying that you don't have enough resources. And if we're talking about like normal trading, you should also subtract the traded amount from the triggering player.

And about the player number, my bad, I didn't realize you have that many players. I'm not sure, but you could use the substring letter 5 and 6 to check the player number and still use 7 and (length of (entered chat string)) for the amount. I haven't tested it, but I'd guess the empty space won't matter, which would come with two-digit player number. If it doesn't work, you have to come up with some kind of workaround.

And about that second thing: switch (Triggering unit) with (Last replaced unit).
 
Level 10
Joined
Jun 20, 2017
Messages
333
So i have 2 this. 1 for when a unit buy item 2 for when is attacking with that item.
the problem is that unit kill ally unit and it kill every thing with 1 attack :D hahahahaha
i need that works to enemy not ally

  • Heroic Heartbreak
    • Events
      • Unit - A unit Acquires an item
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Hero manipulating item) of type Heroic-Heartbreak)) Equal to (==) Heroic-Heartbreak
        • Then - Actions
          • Trigger - Turn off (This trigger)
          • Sound - Play DarkVictory <gen>
          • Environment - Create at (Playable map area) the weather effect Rays Of Light
          • Environment - Turn (Last created weather effect) On
          • Visibility - Disable fog of war
          • Wait 15.00 seconds
          • Visibility - Enable fog of war
          • Environment - Remove (Last created weather effect)
        • Else - Actions

  • Attack Heroic Heartbreak
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • Multiple ConditionsOr - Any (Conditions) are true
        • Conditions
          • (Unit-type of (Attacking unit)) Equal to (==) Kael
          • (Unit-type of (Attacking unit)) Equal to (==) Arthas
          • (Unit-type of (Attacking unit)) Equal to (==) Maiev
          • (Unit-type of (Attacking unit)) Equal to (==) Malfurion
          • (Unit-type of (Attacking unit)) Equal to (==) Rexxar
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Item-type of (Item carried by (Attacking unit) of type Heroic-Heartbreak)) Equal to (==) Heroic-Heartbreak
        • Then - Actions
          • Trigger - Turn on Heroic Heartbreak <gen>
          • Unit - Kill (Attacked unit)
        • Else - Actions



I already have this one but cant help ;x
  • Cant Attack Ally
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • ((Attacked unit) is An Ancient) Equal to (==) True
      • ((Attacked unit) belongs to an ally of (Owner of (Attacking unit))) Equal to (==) True
    • Actions
      • Unit - Order (Attacking unit) to Stop
 
Level 9
Joined
Jul 30, 2018
Messages
445
You don't need that Can't attack trigger (unless you don't want it to be able attack an ally at all. If you do, use action "Interrupt attack"). On the Attack trigger just add that Attacked unit is not equal to ally of attacking unit under the "(Item-type of (item carried..." condition. That way the unit will do just a normal attack against a friendly unit, just like it would do if that trigger didn't exist at all.
 
Level 10
Joined
Jun 20, 2017
Messages
333
like this?

  • Trading
    • Events
      • Player - Player 1 (Red) types a chat message containing -g as A substring
      • Player - Player 2 (Blue) types a chat message containing -g as A substring
      • Player - Player 3 (Teal) types a chat message containing -g as A substring
      • Player - Player 4 (Purple) types a chat message containing -g as A substring
      • Player - Player 5 (Yellow) types a chat message containing -g as A substring
      • Player - Player 6 (Orange) types a chat message containing -g as A substring
      • Player - Player 7 (Green) types a chat message containing -g as A substring
      • Player - Player 8 (Pink) types a chat message containing -g as A substring
      • Player - Player 9 (Gray) types a chat message containing -g as A substring
      • Player - Player 10 (Light Blue) types a chat message containing -g as A substring
      • Player - Player 11 (Dark Green) types a chat message containing -g as A substring
      • Player - Player 12 (Brown) types a chat message containing -g as A substring
    • Conditions
    • Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 3)) Equal to (==) -gg
          • ((Triggering player) is an ally of (Triggering player)) Equal to (==) True
        • Then - Actions
          • Set Integer_TradePlayer = (Integer((Substring((Entered chat string), 5, 6))))
          • Set Integer_TradeAmount = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
          • If (((Triggering player) Current gold) Greater than or equal to (>=) Integer_TradeAmount) then do (Set Integer_TradeAmount = 0) else do (Do nothing)
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + not enough resources.)
          • Player - Add Integer_TradeAmount to (Player(Integer_TradePlayer)) Current gold
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + ((|r has given + String_PlayerColors[Integer_TradePlayer]) + (|r |CFFFFFF00 + ((String(Integer_TradeAmount)) + |r gold.))))
        • Else - Actions
      • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Substring((Entered chat string), 1, 3)) Equal to (==) -gw
        • Then - Actions
          • Set Integer_TradePlayer = (Integer((Substring((Entered chat string), 5, 6))))
          • Set Integer_TradeAmount = (Integer((Substring((Entered chat string), 7, (Length of (Entered chat string))))))
          • If (((Triggering player) Current gold) Greater than or equal to (>=) Integer_TradeAmount) then do (Set Integer_TradeAmount = 0) else do (Do nothing)
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + not enough resources.)
          • Player - Add Integer_TradeAmount to (Player(Integer_TradePlayer)) Current lumber
          • Game - Display to (All players) the text: (String_PlayerColors[(Player number of (Triggering player))] + ((|r has given + String_PlayerColors[Integer_TradePlayer]) + (|r |CFF008000 + ((String(Integer_TradeAmount)) + |r lumber.))))
        • Else - Actions
 
Status
Not open for further replies.
Top