• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] First Cast Trouble

Status
Not open for further replies.
So, I manage to create this spell based on my previous work yet it fails on the first cast. Any subsequent cast works properly as it should. The code uses a combination of Dynamic Indexing and Unit Indexer since the old base uses Unit Indexer and I don't wanna to recode that portion from scratch. This is developed using 1.31 patch, so either that or Reforged to open the test map.

I can confirm the issue is related to the arrays not being initialized on first cast (it is initialized on second cast) after some small debugging (the array values are either 0 or null, which is not suppose to be the case).

EDIT:

Tried adding this at end of config (run at map init) and doesn't work:
  • -------- First Cast Initializer --------
  • Set PsyDom_IndexMax = (PsyDom_IndexMax + 1)
  • Set PsyDom_IndexCaster[PsyDom_IndexMax] = No unit
  • Set PsyDom_IndexLevel[PsyDom_IndexMax] = 0
  • Set PsyDom_IndexPoint[PsyDom_IndexMax] = (Center of (Playable map area))
  • Set PsyDom_IndexActivationDelay[PsyDom_IndexMax] = 0.00
  • Set PsyDom_InActivationSpcEffect[PsyDom_IndexMax] = (Last created special effect)
  • Set PsyDom_IndexMax = (PsyDom_IndexMax - 1)
EDIT 2:
Seems to be not array related, but this specific function being weird:
  • Set PsyDom_IndexLevel[PsyDom_IndexMax] = (Level of PsyDom_Ability for PsyDom_Caster)
On first cast, it becomes 0. On the subsequent cast, it properly refers the level of ability.

EDIT:
Figured it out. Damn, I switched variables between Index and non-index caster and screw myself over.
 
Last edited:
Status
Not open for further replies.
Top