- Joined
- Aug 31, 2018
- Messages
- 167
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
if dg_index == 0 then
// do something
else if dg_index == 0 then
// do something else
end
Thank you, but oh, i am so doomed, lol. I used ChatGPT to help me do that. I dont have experience with world editor, but from what i see, i may consider and just give the map to someone else ^^your indexing is off, since default value of DG_Index is zero. Yet your loop is iterating from value 1 till DG_Index.
Your deindexing doesn't work because you do not properly deindex instances.
You should also either choose arrays or hashtable and use that for everything in your spell. Mixing it doesn't make much sense.
Read Visualize: Dynamic Indexing to see how to properly index and deindex instances.
You do not clean leaks after yourself. This is especially bad with the "Move unit" action inside that 0.03 loop. Check Things That Leak to see how to fix it.
Same for your hashtable values - you do not clean up after yourself.
Your DG_Index check at the end of the loop trigger doesn't make sense, it basically says:
JASS:if dg_index == 0 then // do something else if dg_index == 0 then // do something else end
Sadly it still doesnt work :/ The guy above gave me useful info to read and understand, but the thing is, i dont want to become a developer, i just need to fix this spell so the map becomes editable, because right now no matter whan change we do on the map, we are left without this important spell and i need to fix it in order to keep map working/clean. So i just need easy solution to make this workHave you tried moving DG_INDEX = DG_INDEX + 1 to the top of the first trigger?
Spell is literally Death Knight (from WoW) death grip (the pull/grab ability) and the map is WoW Arena Allstars itself. Catze (the creator) used same variables/hashtables on that skill and when you open the map, no matter what change u do, the trigger for that spell just breaks. So i am trying to remade it, but i am lacking skills and used ChatGPT to help me. The picture above you see is what he told me to do, but for some reason its not working.Can you provide description of the spell and your Warcraft III patch?
step 1

Events


Unit - A unit Starts the effect of an ability

Conditions


(Ability being cast) Equal to Life Drain

Actions


Set VariableSet DG_Caster = (Triggering unit)


Set VariableSet DG_Target = (Target unit of ability being cast)


Set VariableSet DG_Timer = 0.00


Trigger - Turn on step 2 <gen>
step 2

Events


Time - Every 0.03 seconds of game time

Conditions


DG_Target Not equal to No unit


DG_Caster Not equal to No unit

Actions


Set VariableSet DG_Timer = (DG_Timer + 0.03)


Set VariableSet DG_Distance = (Distance between (Position of DG_Caster) and (Position of DG_Target))


If (All Conditions are True) then do (Then Actions) else do (Else Actions)



If - Conditions




(DG_Distance Less than or equal to 100.00) or (DG_Timer Greater than or equal to 1.50)



Then - Actions




Set VariableSet DG_Caster = No unit




Set VariableSet DG_Target = No unit




Set VariableSet DG_Timer = 0.00




Trigger - Turn off step 2 <gen>



Else - Actions




Set VariableSet DG_Angle = (Angle from (Position of DG_Target) to (Position of DG_Caster))




Unit - Move DG_Target instantly to ((Position of DG_Target) offset by 35.00 towards DG_Angle degrees.)
Event: Map Initialization
Action:
Hashtable - Create a hashtable and store it in DeathGripTable
Set DeathGripGroup = (Empty group)
Event: Unit starts the effect of an ability
Condition: Ability being cast = Death Grip
Actions:
Set Caster = Triggering Unit
Set Target = Target unit of ability being cast
Custom script: set bj_wantDestroyGroup = true
Unit Group - Add Target to DeathGripGroup
Hashtable - Save (Caster) as 0 of (Handle of Target) in DeathGripTable
Hashtable - Save 0.00 as 1 of (Handle of Target) in DeathGripTable
Turn on skill Loop
Event: Every 0.03 seconds
Actions:
Unit Group - Pick every unit in DeathGripGroup and do actions:
Set Target = (Picked unit)
Hashtable - Load 0 of (Handle of Target) in DeathGripTable → Caster
Hashtable - Load 1 of (Handle of Target) in DeathGripTable → Timer
If (Target or Caster is dead) then:
Remove Target from DeathGripGroup
Clear hashtable entries
then we skip to next unit
Set Angle = (Angle from Position of Target to Position of Caster)
Set Distance = Distance between them
If (Distance <= 100 or Timer >= 1.50) then:
Remove Target from DeathGripGroup
Clear hashtable entries
Else:
Move Target instantly to (Target position offset by 20 toward Angle) with pathing
Save (Timer + 0.03) as 1 of Handle of Target
Unit - Move DG_Target instantly to ((Position of DG_Target) offset by 35.00 towards DG_Angle degrees.)
Set VariableSet Point1 = (Position of DG_Target)
Set VariableSet Point2 = (Point1 offset by 35.00 towards DG_Angle degrees.)
Unit - Move DG_Target instantly to Point2
Custom script: call RemoveLocation(udg_Point1)
Custom script: call RemoveLocation(udg_Point2)
