• 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] I'm very confused

Status
Not open for further replies.
Level 28
Joined
Sep 26, 2009
Messages
2,520
I don't really know where the problem is, however there are a few things I'd like to point out:

The initial loop in your first trigger clears unused units, right? Why don't you have it in separate trigger that fires when unit stops casting an ability?

Also, Loop (Integer A/B) is apparently buggy, you should create your own integer variable that you will use instead.
So Loop (YourIntegerVariable) from 1 to X. And instead of Unit[Integer A] you will call to that unit as Unit[YourIntegerVariable].

The last thing - why do you have loop always from 1 to 10? As I understand it, a maximum of 10 units may cast this spell at a time. However won't it be more efficient to use a loop from 1 to LINK_NumberOfUnits. If I understood that part of trigger correctly, LINK_NumberOfUnits means how many units are currently casting the spell.
This way you could have more than 10 units at a time to cast it, but if fewer cast it you won't loop 10 times for nothing.

Oh and "By Maker's bones, you don't null points!" :)

------------
Edit:
So, basically
LINK_TriggeringUnitINDEX = caster
LINK_TargetUnitINDEX = Target of the ability
LINK_NumberOfLinksINDEX = checks if ability is active or not
LINK_NumberOfUnits = Index number
am I correct?
 
Level 2
Joined
Mar 29, 2013
Messages
11
I don't really know where the problem is, however there are a few things I'd like to point out:

The initial loop in your first trigger clears unused units, right? Why don't you have it in separate trigger that fires when unit stops casting an ability?

Also, Loop (Integer A/B) is apparently buggy, you should create your own integer variable that you will use instead.
So Loop (YourIntegerVariable) from 1 to X. And instead of Unit[Integer A] you will call to that unit as Unit[YourIntegerVariable].

The last thing - why do you have loop always from 1 to 10? As I understand it, a maximum of 10 units may cast this spell at a time. However won't it be more efficient to use a loop from 1 to LINK_NumberOfUnits. If I understood that part of trigger correctly, LINK_NumberOfUnits means how many units are currently casting the spell.
This way you could have more than 10 units at a time to cast it, but if fewer cast it you won't loop 10 times for nothing.

Oh and "By Maker's bones, you don't null points!" :)

1st part - There isn't any ability that would stop casting, as it is non-channeling and I forgot to mention that in my edit :D

2nd part - It works now, so no need

Last part - Originally I was using that, but then I was unsure of if it would cause problems such as if there were [2] indexed, and then [1] ended and it subtracted 1, so then the loops would stop the effect on [2]? Hard to explain, but I feel like it would cause problems. There would never be more then 10 units casting this skill the way my map works.

Also the final part, I actually didn't catch that I never nulled those points and I added that in right before I saw your post! The problem ended up being, that, and I did not set a point before the action for the Lightning to move. Derp :) Thanks for the help though, I'll keep your suggestions in mind.


EDIT: @ your edit
You have that all correct except for NumberOfLinksINDEX. That actually checks to make sure you cannot link with more then 1 unit at a time.
 
Level 28
Joined
Sep 26, 2009
Messages
2,520
ah I see, so basically this spell gives buff to both caster and target and as long as they both have those buffs, they will be connected by beam and the target will be periodically healed, right?

-----
I think it was Deathismyfriend, who run tests on the Integer A loop. Apparently it sometimes is slower or causes bugs, which is why he advices to use our own integers instead. But it doesn't happen all the time, only sometimes.
 
Level 2
Joined
Mar 29, 2013
Messages
11
ah I see, so basically this spell gives buff to both caster and target and as long as they both have those buffs, they will be connected by beam and the target will be periodically healed, right?

Exactly. It looks nice in game, this is my first actually complicated spell so far and I'm happy with it :D
Still have to work on the buff sharing part and the max range part though.

EDIT: Good to know, I'll have to replace them then. Thanks for the help by the way.
 
ah I see, so basically this spell gives buff to both caster and target and as long as they both have those buffs, they will be connected by beam and the target will be periodically healed, right?

-----
I think it was Deathismyfriend, who run tests on the Integer A loop. Apparently it sometimes is slower or causes bugs, which is why he advices to use our own integers instead. But it doesn't happen all the time, only sometimes.

it causes bugs but it doesnt happen a lot and yes integer A is always slower than using ur own integer. Also you can check out this it has plenty of useful info for GUIers http://www.hiveworkshop.com/forums/tutorial-submission-283/things-gui-user-should-know-233242/

Also this spell is not MUI and will be broken when more than one unit tries to use it. check out the indexing chapter in my tutorial
 
Level 7
Joined
Jan 22, 2013
Messages
293
You should listen to deathismyfriend, make a empty integer then use it instead of the integer A. It will take up less FPS in the game when the triggers are being used.

Your spell is not "Fixed" Its made to be a MUI spell but its not working like an MUI at all.

You have several more things to fix.
 
You should listen to deathismyfriend, make a empty integer then use it instead of the integer A. It will take up less FPS in the game when the triggers are being used.

Your spell is not "Fixed" Its made to be a MUI spell but its not working like an MUI at all.

You have several more things to fix.

thats y i suggested my tutorial lol it should help him a lot.

if u still have problems after fixing it ill be glad to help.
 
Level 7
Joined
Jan 22, 2013
Messages
293
You are also are not nulling any of your leak removals. That's not good...


Example:

  • Custom script: set udg_Pickingmynose = null
you should null every custom script leak removal directly after its removal.
 
Level 23
Joined
Apr 16, 2012
Messages
4,041
no you dont, yes its true that if you dont null variable, it will still have its reference count too high for Handle Id recyclation, but it doesnt mean it will not destroy the object itself, only the handle Id will not be freed
 
Status
Not open for further replies.
Top