Store lightning into local

Frozenwind

System maker
Reaction score
99
lightning in local

---> see post #8, this is outdated!



[del]Well, I got this trigger... I've put "Game - Display Text To Force" so I could confirm that the trigger and all loops run, but the odd, the functions withing the loop seems to do nothing.[/del]
Code:
Custom script:   local unit cast = GetSpellAbilityUnit ()
Custom script:   set udg_Temp_point1 = GetUnitLoc (cast)
Set Temp_point2 = (Temp_point1 offset by 50.00 towards 0.00 degrees)
Lightning - Create a Healing Wave - Primary lightning effect from source Temp_point1 to target Temp_point2
[del]I don't see any problem there for example, and don't worry, the problem isn't that I dont got a Casting Unit --> If I do from center of playable map area to center of playable map area with offset I don't see any lightning either.

Here is a part of the trigger that seems to do nothing:
Code:
Actions
    Custom script:   local location array loc
    Custom script:   local unit cast = GetSpellAbilityUnit ()
    Custom script:   local real array angle
    Custom script:   local real offset = 0.00
    Custom script:   local integer array A
    Custom script:   local integer array B
    Custom script:   local lightning array light
    Custom script:   set udg_Temp_point1 = GetUnitLoc (cast)
    Set Temp_point2 = (Temp_point1 offset by 50.00 towards 0.00 degrees)
    Custom script:   set A[0] = 0
    Custom script:   set A[1] = 2
    Custom script:   loop
    Custom script:       exitwhen A[0]>A[1]
    Game - Display to (All players) the text: loop1
    Custom script:       set angle[A[0]] = I2R( A[0] * 120)
    Custom script:       set loc[A[0]] = GetUnitLoc (cast)
    Lightning - Create a Healing Wave - Primary lightning effect from source Temp_point1 to target Temp_point2
    Custom script:       set light[A[0]] = GetLastCreatedLightningBJ()
    Custom script:       set A[0] = A[0] + 1
    Custom script:   endloop
    Custom script:   call RemoveLocation (udg_Temp_point1)
    Custom script:   call RemoveLocation (udg_Temp_point2)
    Game - Display to (All players) the text: endfunction
I myself think that it has to do with the array of the integer with I use as "Integer A"?

[EDIT]:
Additional testinformation:
1) The loopmessage is displayed 3 times, just like it should, so the loop runs 3 times.
2) If I do "from source: center of playble map area" "to source: center of playable map area offset by 500 tow 0 degrees", still nothing happens. --> conclusion: "casting unit" isn't the problem.

I've heared of some 2nd type of loop, is it something like that?
[/EDIT]

Anyone can find the problem?
[/del]
frozenwind.
 

Frozenwind

System maker
Reaction score
99
Dun know, in fact the loop runs, but there isn't a lightning created at all,
the lightning is GUI, so its a bit both..

frozenwind.
 

turok255

New Member
Reaction score
30
You got so many custom scripts... Wouldn't it be easier just to do it in JASS and be done with it...?
 

Frozenwind

System maker
Reaction score
99
Nop, cos I'm making a spellpack which should be able to be implenteble by people that know 0% JASS, so later on I add global variables which they can set to implent it.

Example:
Code:
If ability being cast is equal to (WHATEVER)
is easyer to understnad as
JASS:
if spellbeingcast == 'A000'


frozenwind.

EDIT:
Hero said:
GetTriggerUnit()
frozenwind said:
the problem isn't that I dont got a Casting Uni
won't work, cos if I do "from source: center of playble map area" "to source: center of playable map area offset by 500 tow 0 degrees", still nothing happens.
So it's something else that is corrupted.
 

Hero

─║╣ero─
Reaction score
250
JASS:
Custom script:   local location array loc
    Custom script:   local unit cast = GetSpellAbilityUnit ()
    Custom script:   local real array angle
    Custom script:   local real offset = 0.00
    Custom script:   local integer array A
    Custom script:   local integer array B
    Custom script:   local lightning array light
    Custom script:   set udg_Temp_point1 = GetUnitLoc (cast)
    Set Temp_point2 = (Temp_point1 offset by 50.00 towards 0.00 degrees)


Well ofc it won't work

JASS:
Custom script:   set udg_Temp_point1 = GetUnitLoc (cast)


You get the Location of a unit that doesn't exist..You said that you don't have a unit casting..right?

Then you can't do it that way
 

Frozenwind

System maker
Reaction score
99
I got this trigger...
When I store my lightning effect into a global with:
Code:
Set Temp_Lightning = (Last created lightning effect)
The lightning is just created / displayed.
However when I store it into a local like this:
JASS:
set light[A[0]] = udg_Temp_Lightning

The lightning doesn't get created / dissapears. (dun know which).

This is the full part which has this problem:
Code:
Events
    Unit - A unit Starts the effect of an ability
Conditions
    (Ability being cast) Equal to Triangle Beam 
Actions
    Custom script:   local location array loc
    Custom script:   local unit cast = GetSpellAbilityUnit ()
    Custom script:   local real array angle
    Custom script:   local real offset = 0.00
    Custom script:   local integer array A
    Custom script:   local integer array B
[COLOR="Red"]    Custom script:   local lightning array light[/COLOR]
    Custom script:   set udg_Temp_point1 = GetUnitLoc (cast)
    Set Temp_point2 = (Temp_point1 offset by 50.00 towards 0.00 degrees)
    Custom script:   set A[0] = 0
    Custom script:   set A[1] = 2
    Custom script:   loop
    Custom script:       exitwhen A[0]>A[1]
[COLOR="SeaGreen"]    Game - Display to (All players) the text: loop1[/COLOR] // this is displayed so I know my loop runs 3 times just like I want it to.
    Custom script:       set angle[A[0]] = I2R( A[0] * 120)
    Custom script:       set loc[A[0]] = GetUnitLoc (cast)
[COLOR="Red"]    Lightning - Create a Healing Wave - Primary lightning effect from source Temp_point1 to target Temp_point2
    Set Temp_Lightning = (Last created lightning effect)
    Custom script:       set light[A[0]] = udg_Temp_Lightning[/COLOR]
    Custom script:       set A[0] = A[0] + 1
    Custom script:   endloop
    Custom script:   call RemoveLocation (udg_Temp_point1)
    Custom script:   call RemoveLocation (udg_Temp_point2)

Anyone know why my lightning isn't visible when I store it into a local?

I've figured out something additional:
When I use a lightning local WITHOUT array it works.
JASS:
Custom script:       set light = udg_Temp_Lightning

Code:
Without lightning array
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Triangle Beam 
    Actions
        Custom script:   local location array loc
        Custom script:   local unit cast = GetSpellAbilityUnit ()
        Custom script:   local real array angle
        Custom script:   local real offset = 0.00
        Custom script:   local integer array A
        Custom script:   local integer array B
        Custom script:   local lightning light
        Custom script:   set udg_Temp_point1 = GetUnitLoc (cast)
        Set Temp_point2 = (Temp_point1 offset by 50.00 towards 0.00 degrees)
        Custom script:   set A[0] = 0
        Custom script:   set A[1] = 2
        Custom script:   loop
        Custom script:       exitwhen A[0]>A[1]
        Game - Display to (All players) the text: loop1
        Custom script:       set angle[A[0]] = I2R( A[0] * 120)
        Custom script:       set loc[A[0]] = GetUnitLoc (cast)
        Lightning - Create a Healing Wave - Primary lightning effect from source Temp_point1 to target Temp_point2
        Set Temp_Lightning = (Last created lightning effect)
[COLOR="Red"]        Custom script:       set light = udg_Temp_Lightning[/COLOR]
        Custom script:       set A[0] = A[0] + 1
        Custom script:   endloop
        Custom script:   call RemoveLocation (udg_Temp_point1)
        Custom script:   call RemoveLocation (udg_Temp_point2)
I've also got another trigger where I use lightnings too...
However I create them OUTSIDE a loop, WITH using "local lightning array", there it works though...

Is it the combination? Loop + lightning[array] = bug?

frozenwind.
 

chobibo

Level 1 Crypt Lord
Reaction score
48
Don't set the lightning variable to "Last Created Lightning Effect" instead store it this way: set light[index] = Create Lightning Sfx. I dunno if you could do it in GUI though.
 

Frozenwind

System maker
Reaction score
99
Nop, you can't do it like that in GUI,
but I allready know the problem,
due I did "call RemoveLocation", the lightning lost his source and target and just vanished.

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