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

[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