Drain Mana Lightning with height

Zetrix91

TH.net Regular
Reaction score
2
so i wanna create a chain lightning effect with height and Drain Mana Lightning type..
ive got this so far

Trigger:
  • Custom script: call AddLightningEx("CLPB", true, GetLocationX(udg_Light_Start_Point), GetLocationY(udg_Light_Start_Point), 290, GetLocationX(udg_Light_End_Point), GetLocationY(udg_Light_End_Point), 30)


i know that CLPB stands for Chain Lightning Primary Bounce or something like that.. what is the code for Drain Mana "DM"?

and i get an error saying "Expected a name" any pointers why?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, "DRAM" is the Drain Mana lightning...

And I don't get an error with that code...
 

Zetrix91

TH.net Regular
Reaction score
2
mayby it has something to do with my similar trigger.

Trigger:
  • Custom script: call AddLightningEx("CLPB", true, GetLocationX(udg_Dark_Start_Point), GetLocationY(udg_Dark_Start_Point), 290, GetLocationX(udg_Dark_End_Point), GetLocationY(udg_Dark_End_Point), 30)


and this one doesnt get an error
 

Zetrix91

TH.net Regular
Reaction score
2
sorry for the 2x post but i really need help here, can someone explain to me why out of 2 similar trigger only one of them get an error... explain how the custom script lightning works plz.... +rep !! <3 ;*
 

Zetrix91

TH.net Regular
Reaction score
2
move and destroy

so if i have created a lightning without the error with the following action:
Trigger:
  • Custom script: call AddLightningEx(&quot;DRAM&quot;, true, GetLocationX(udg_Frost_Ward_Ward_Point), GetLocationY(udg_Frost_Ward_Ward_Point), 90, GetLocationX(udg_Frost_Ward_Target_Point), GetLocationY(udg_Frost_Ward_Target_Point), 90)
    • Set Frost_Ward_Lightning = (Last created lightning effect)


how do i move it and destroy it afterwards? ty in advance
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, where do you want to move it ? :S
And, when do you want to destroy it ?

You need to provide more information, otherwise it's very hard to help...

But, this is just an example of how to move lightning:
Trigger:
  • Move Lightning
    • Events
    • Conditions
    • Actions
      • Set TempPoint = (Center of (Playable map area))
      • Set TempPoint2 = ((Center of (Playable map area)) offset by 100.00 towards (Random angle) degrees)
      • Lightning - Move (Last created lightning effect) to source TempPoint and target TempPoint2
      • Custom script: call RemoveLocation(udg_TempPoint2)
      • Custom script: call RemoveLocation(udg_TempPoint)
 

LightChaosma

New Member
Reaction score
60
just a sugestion... knowing that lightbning can be complicated... why not use dummies and finger of death?

u can set height, distance etc

create a dummy for you, a dummy for neutral ohstile, set the heights (you can even let the lightning move upwards if you like), the duration in the object editor ad voila
 

GetTriggerUnit-

DogEntrepreneur
Reaction score
129
Trigger:
  • Custom script: call AddLightningEx(&quot;DRAM&quot;, true, GetLocationX(udg_Frost_Ward_Ward_Point), GetLocationY(udg_Frost_Ward_Ward_Point), 90, GetLocationX(udg_Frost_Ward_Target_Point), GetLocationY(udg_Frost_Ward_Target_Point), 90)
    • Set Frost_Ward_Lightning = (Last created lightning effect)


This won't work because you're not using the bj_lastCreatedLightning.

When you use the BJ, the GUI action 'Create lightning', it triggers like this:
JASS:
function AddLightningLoc takes string codeName, location where1, location where2 returns lightning
    set bj_lastCreatedLightning = AddLightningEx(codeName, true, GetLocationX(where1), GetLocationY(where1), GetLocationZ(where1), GetLocationX(where2), GetLocationY(where2), GetLocationZ(where2))
    return bj_lastCreatedLightning
endfunction

(Jasscraft)

You have two options now.
Or you use
(This will work as jass works.)
JASS:
local effect e = AddLightning(etc...)
call DestroyEffect(e)
set e=null


Or you use

(This will work with the GUI-ed.)
Trigger:
  • Actions -
    • Custom script: set bj_lastCreatedLightning = AddLightning(etc...)
    • Lightning - DestroyLightning(Last created lightning effect)
 

Zetrix91

TH.net Regular
Reaction score
2
one more issue if u have the patience =)

how do i mix "Integer A" in with the variables in the Custom Script ? :p
example
Trigger:
  • For each (Integer A) from 1 to 6, do (Actions)
    • Loop - Actions
      • Custom script: set bj_lastCreatedLightning = AddLightningEx(&quot;DRAM&quot;, true, GetLocationX(udg_Frost_Ward_Ward_Point[IntegerA here?]), GetLocationY(udg_Frost_Ward_Ward_Point[IntegerA here?]), 140, GetLocationX(udg_Frost_Ward_Target_Point[IntegerA here?]), GetLocationY(udg_Frost_Ward_Target_Point[IntegerA here?]), 60)
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Trigger:
  • Custom script: set bj_lastCreatedLightning = AddLightningEx(&quot;DRAM&quot;, true, GetLocationX(udg_Frost_Ward_Ward_Point[IntegerA here?]), GetLocationY(udg_Frost_Ward_Ward_Point[IntegerA here?]), 140, GetLocationX(udg_Frost_Ward_Target_Point[IntegerA here?]), GetLocationY(udg_Frost_Ward_Target_Point[IntegerA here?]), 60)


Becomes:
Trigger:
  • Custom script: set bj_lastCreatedLightning = AddLightningEx(&quot;DRAM&quot;, true, GetLocationX(udg_Frost_Ward_Ward_Point[bj_forLoopAIndex]), GetLocationY(udg_Frost_Ward_Ward_Point[bj_forLoopAIndex), 140, GetLocationX(udg_Frost_Ward_Target_Point[bj_forLoopAIndex]), GetLocationY(udg_Frost_Ward_Target_Point[bj_forLoopAIndex]), 60)


;)
 

Zetrix91

TH.net Regular
Reaction score
2
okay that worked fine =) except i had to shorten the variable names because the custom script line was too long (any way to not do that?)

but for the next problem :p

i want one of the lightnings to be an Array i choose, not Integer A so i tried this
Trigger:
  • Custom script: set bj_lastCreatedLightning = AddLightningEx(&quot;DRAM&quot;, true, GetLocationX(udg_FWWPoint[6]), GetLocationY(udg_FWWPoint[6]), 140, GetLocationX(udg_FWWPoint[1), GetLocationY(udg_FWWPoint[1]), 60)

but got an error saying "expected expression"
how do i set the array myself?
 

Komaqtion

You can change this now in User CP.
Reaction score
469
You forgot an "]" here:
Code:
Custom script: set bj_lastCreatedLightning = AddLightningEx("DRAM", true, GetLocationX(udg_FWWPoint[6]), GetLocationY(udg_FWWPoint[6]), 140, GetLocationX(udg_FWWPoint[1[COLOR="Red"]][/COLOR]), GetLocationY(udg_FWWPoint[1]), 60)

;)
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top