Error upon multiple units using the same spell

keychup

Active Member
Reaction score
34
Error upon multiple units using the same spell [SOLVED]

SOLVED
Acknowledgements : NeuroToxin for introducing Hashtables (So that's what a Hashtable does)
If it's possible to shorten the triggers, or if any corrections need to be made to them let me know.

End Result: View attachment Sprite.w3x (May 22nd, 2011)

-------------------------------------------------------------------------------------------------------
So here's the deal.
The ability works fine when only one hero uses the ability. But for some reason when another unit uses that same ability the game either crashes or the ability won't work at all.

The solution would probably be to not let multiple units with that same ability be on the map.

I'd like someone to help me fix up this skill so that it does allow multiple units with the same ability on the map.

(I'm also looking for leaks and perhaps some tips on posting)

Here's the skill I need help with:
225367_10150304764333574_770333573_9741495_7633204_n.jpg


Union

Unite yourself to an allied unit. You cannot separate from your target while united. Increases both units' ATK, DEX and SPD. This effect can be cancelled and lasts for up to 15 seconds or until negated.

Level 1 - +10% ATK, +20% DEX, +5% SPD.
Level 2 - +20% ATK, +40% DEX, +10% SPD.
Level 3 - +30% ATK, +60% DEX, +15% SPD.
Level 4 - +40% ATK, +80% DEX, +20% SPD.
Level 5 - +50% ATK, +100% DEX, +25% SPD.

Cooldown: 15.0 seconds

Visual Effects:
225253_10150304764818574_770333573_9741500_8302776_n.jpg

Error Message:
227799_10150304775163574_770333573_9741521_1715542_n.jpg
 

SanKakU

Member
Reaction score
21
so its kinda like dota's tether. i think the code should be rewritten using vjass/cjass.

i've not tried to make this exact ability. but it might be fun to try. i think there may have been made a lightningutils library at wc3c.net that would be very handy.

i think bump rule is wait 1-2 days but i forget.
 

death_knight

Dark is the heart of a corrupted man.
Reaction score
24
I didn't read your code, I just read the problem. Assuming each player can only get one unit which casts the ability (e.g. can only get 1 hero which can cast this), then what you need to do is make it unit-specific. So if it's cast by a player's hero, then you can set the hero to a unit variable called 'PlayerHero' or something like that. All other variables which are affected by different players casting this ability need to be changed to arrays to account for this.

- When the ability does work the game sometimes crashes when caster uses ability on another unit that was previously targeted by the ability.

For this, you need to make sure, at either the end or the beginning of the trigger relating to the actual effects of the ability, that all variables that need to be are set/reset properly.
 

keychup

Active Member
Reaction score
34
so its kinda like dota's tether. i think the code should be rewritten using vjass/cjass.

i've not tried to make this exact ability. but it might be fun to try. i think there may have been made a lightningutils library at wc3c.net that would be very handy.

i think bump rule is wait 1-2 days but i forget.

Thanks. Perhaps one day when you've made your own version that works you could tell me about it. ^_^
 

keychup

Active Member
Reaction score
34
I didn't read your code, I just read the problem. Assuming each player can only get one unit which casts the ability (e.g. can only get 1 hero which can cast this), then what you need to do is make it unit-specific. So if it's cast by a player's hero, then you can set the hero to a unit variable called 'PlayerHero' or something like that. All other variables which are affected by different players casting this ability need to be changed to arrays to account for this.



For this, you need to make sure, at either the end or the beginning of the trigger relating to the actual effects of the ability, that all variables that need to be are set/reset properly.

Yep. I already thought of that. When a player casts Union the caster and target are tagged into their specific roles (caster and target respectively). Arrays are already implemented.
Variables:
ab_union_bool_yn: Boolean Array (12) : Checks when the ability is active.
ab_union_ligtng_eff: Lightning Effect Array (12) : Visual Effects for Ability
ab_union_speff_cas: Special Effect Array (12) : Special Effect on Caster
ab_union_speff_tar: Special Effect Array (12) : Special Effect on CasterTarget
ab_union_timr_int: Timer Array (12) : Time interval which checks when Caster is too far from Target or when one of them loses buff.
ab_union_unit_cas: Unit Array (12) : Casting Unit
ab_union_unit_tar: Unit Array (12) : Target Unit of Ability being cast

In the end of the effect I have already tried cleaning up the variables in this manner:

Trigger:
  • Else - Actions
    • Countdown Timer - Pause ab_union_timr_int[(Integer A)]
    • Special Effect - Destroy ab_union_speff_cas[(Integer A)]
    • Special Effect - Destroy ab_union_speff_tar[(Integer A)]
    • Player - Enable Union (icon) for (Player((Integer A)))
    • Unit - Remove Union (cancel) from ab_union_unit_cas[(Integer A)]
    • Unit - Remove Union buff from ab_union_unit_cas[(Integer A)]
    • Unit - Remove Union buff from ab_union_unit_tar[(Integer A)]
    • Lightning - Destroy ab_union_ligtng_eff[(Integer A)]
    • Set ab_union_unit_cas[(Integer A)] = No unit
    • Set ab_union_unit_tar[(Integer A)] = No unit
    • Set ab_union_bool_yn[(Integer A)] = False
 

KaerfNomekop

Swim, fishies. Swim through the veil of steel.
Reaction score
613
Why do you use arrays, when hashtables give sufficient MUIness? (My turn to make up words) Arrays are quite limited in this case.
 

keychup

Active Member
Reaction score
34
Why do you use arrays, when hashtables give sufficient MUIness? (My turn to make up words) Arrays are quite limited in this case.

Do tell. I'd like to see what you can teach me about these hashtables. I'm not really sure how you use them. And I can't really try them out to see how they work because I can't even tell if something's happening.
 
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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top