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.
  • WildTurkey WildTurkey:
    is there a stephen green in the house?
    +1
  • The Helper The Helper:
    What is up WildTurkey?
  • The Helper The Helper:
    Looks like Google fixed whatever mistake that made the recipes on the site go crazy and we are no longer trending towards a recipe site lol - I don't care though because it motivated me to spend alot of time on the site improving it and at least now the content people are looking at is not stupid and embarrassing like it was when I first got back into this like 5 years ago.
  • The Helper The Helper:
    Plus - I have a pretty bad ass recipe collection now! That section of the site is 10 thousand times better than it was before
  • The Helper The Helper:
    We now have a web designer at my job. A legit talented professional! I am going to get him to redesign the site theme. It is time.
  • Varine Varine:
    I got one more day of community service and then I'm free from this nonsense! I polished a cop car today for a funeral or something I guess
  • Varine Varine:
    They also were digging threw old shit at the sheriff's office and I tried to get them to give me the old electronic stuff, but they said no. They can't give it to people because they might use it to impersonate a cop or break into their network or some shit? idk but it was a shame to see them take a whole bunch of radios and shit to get shredded and landfilled
  • The Helper The Helper:
    whatever at least you are free
  • Monovertex Monovertex:
    How are you all? :D
    +1
  • Ghan Ghan:
    Howdy
  • Ghan Ghan:
    Still lurking
    +3
  • The Helper The Helper:
    I am great and it is fantastic to see you my friend!
    +1
  • The Helper The Helper:
    If you are new to the site please check out the Recipe and Food Forum https://www.thehelper.net/forums/recipes-and-food.220/
  • Monovertex Monovertex:
    How come you're so into recipes lately? Never saw this much interest in this topic in the old days of TH.net
  • Monovertex Monovertex:
    Hmm, how do I change my signature?
  • tom_mai78101 tom_mai78101:
    Signatures can be edit in your account profile. As for the old stuffs, I'm thinking it's because Blizzard is now under Microsoft, and because of Microsoft Xbox going the way it is, it's dreadful.
  • The Helper The Helper:
    I am not big on the recipes I am just promoting them - I use the site as a practice place promoting stuff
    +2
  • Monovertex Monovertex:
    @tom_mai78101 I must be blind. If I go on my profile I don't see any area to edit the signature; If I go to account details (settings) I don't see any signature area either.
  • The Helper The Helper:
    You can get there if you click the bell icon (alerts) and choose preferences from the bottom, signature will be in the menu on the left there https://www.thehelper.net/account/preferences
  • The Helper The Helper:
    I think I need to split the Sci/Tech news forum into 2 one for Science and one for Tech but I am hating all the moving of posts I would have to do
  • The Helper The Helper:
    What is up Old Mountain Shadow?

      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