• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.
  • Create a faction for Warcraft 3 and enter Hive's 19th Techtree Contest: Co-Op Commanders! Click here to enter!
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 21st Texturing Contest: Upgrade is now concluded, time to vote for your favourite set of icons! Click here to vote!

Merging lightnings upon trying to move them

Status
Not open for further replies.

Ardenian

A

Ardenian

Hello, I would like to add an update for my lightning effects in my Power System.

For some reasons, my approaches to do so heavily bug my system though.
Is it a general Blizzard problem or did I do something wrong ?

This is what I did:


  • Set PS_TempUnitType = (Unit-type of PS_Generator[PS_TempInteger2])
  • Custom script: set udg_PS_TempInteger = udg_PS_TempUnitType
  • -------- ... --------
  • Custom script: set udg_PS_TempLightningType = LoadStr(udg_Hash_PowerSystem, udg_PS_TempInteger, 0)
  • Blitz - Create a PS_TempLightningType lightning effect from source PS_TempLocOrigin to target PS_TempLocAim
  • Set PS_LightningIndex[PS_TargetMaxIndex] = (Last created lightning effect)
  • Custom script: set udg_PS_X = GetLocationX(udg_PS_TempLocOrigin)
  • Custom script: set udg_PS_Y = GetLocationY(udg_PS_TempLocOrigin)
  • Custom script: set udg_PS_Z = GetLocationZ(udg_PS_TempLocOrigin)
  • Custom script: set udg_PS_X_2 = GetLocationX(udg_PS_TempLocAim)
  • Custom script: set udg_PS_Y_2 = GetLocationY(udg_PS_TempLocAim)
  • Custom script: set udg_PS_Z_2 = GetLocationZ(udg_PS_TempLocAim)
  • Custom script: call MoveLightningEx(udg_PS_LightningIndex[udg_PS_TargetMaxIndex], true, udg_PS_X, udg_PS_Y, udg_PS_Z + 70, udg_PS_X_2, udg_PS_Y_2, udg_PS_Z_2 + 70)
The basic creation is fine, but once I try to update it in the loop, as first action, before anything else:


  • For each (Integer PS_TempInteger2) from 1 to PS_SupplierMaxIndex, do (Actions)
    • Loop - Actions
      • For each (Integer PS_TempInteger3) from 1 to PS_TargetMaxIndex, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • 'IF'-Conditions
              • (PS_Suppliedtarget[PS_TempInteger3] is in PS_SupplyGroup[PS_TempInteger2]) Equal True
            • 'THEN'-Actions
              • Set PS_TempLocAim = (Position of PS_Suppliedtarget[PS_TempInteger3])
              • Set PS_TempLocOrigin = (Position of PS_Generator[PS_TempInteger2])
              • Custom script: set udg_PS_X = GetLocationX(udg_PS_TempLocOrigin)
              • Custom script: set udg_PS_Y = GetLocationY(udg_PS_TempLocOrigin)
              • Custom script: set udg_PS_Z = GetLocationZ(udg_PS_TempLocOrigin)
              • Custom script: set udg_PS_X_2 = GetLocationX(udg_PS_TempLocAim)
              • Custom script: set udg_PS_Y_2 = GetLocationY(udg_PS_TempLocAim)
              • Custom script: set udg_PS_Z_2 = GetLocationZ(udg_PS_TempLocAim)
              • Custom script: call MoveLightningEx(udg_PS_LightningIndex[udg_PS_TempInteger3], true, udg_PS_X, udg_PS_Y, udg_PS_Z + 70, udg_PS_X_2, udg_PS_Y_2, udg_PS_Z_2 + 70)
            • 'ELSE'-Aktionen


I did some tests, it is the loop causing the lightning effects to merge.

Basically, once I cast with one generator on a target that already has a generator whit a special effect, the special effect from the first generator merges with the new one in the loop.

What is wrong with it ? I hope the information is sufficient.
 
Last edited by a moderator:
Level 25
Joined
May 11, 2007
Messages
4,648
You're creating each lighting and setting them to
"Set PS_LightningIndex[PS_TargetMaxIndex] = (Last created lightning effect)"
I don't see you increasing PS_TargetMaxIndex or changing it, so all the lightings do share the same index?

Shouldn't it be like
Set PS_LightningIndex[PS_CurrentIndex+=1] = (Last created lightning effect)"
 

Ardenian

A

Ardenian

Yes, that's true, done before the Basic Creation, when indexing the target. Each target shares an array with a lightning, the corresponding one.

I am sorry, I excluded this one in the posted triggers, but it is done in the map and works appropriate, as far as I know.
 
Status
Not open for further replies.
Top