• 🏆 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!

Same order string problem

Status
Not open for further replies.
Level 2
Joined
Dec 18, 2005
Messages
28
L8tly I've been workin' on a map where I used a lot of spells and after a while I just had no more basic spells to customize. So I thought I'll just use a spell with the same order string to create a new one. The problem about it is, that as soon as a unit has 2 spells with the same order string and begins casting one of them, it automatically uses the last one learned instead of the one casted. I tried by:
Code:
Events
    Unit - A unit Begins casting an ability
Conditions
    (Ability being cast) Equal to Spellconflict1 
Actions
    Unit - Order (Triggering unit) to Stop
    If - Conditions
            (Level of Spellconflict2 for (Triggering unit)) Not equal to 0
    Then - Actions
            Set levelofskill = (Level of Spellconflict2 for (Triggering unit))
            Set Skill = (Spellconflict2)
            Unit - Remove Spellconflict2 from (Triggering unit)
    Else - Actions
            Do nothing
    Unit - Order (Triggering unit) to (Convert (Name of (Ability being cast)) to unit targeted order) (Target unit of ability being cast)
    Wait 0.05 game-time seconds
    If - Conditions
        Skill Not equal to none
    Then - Actions
        Unit - Add Spellconflict2 to (Triggering unit)
        Unit - Set Level of Spellconflict2 for (Triggering unit) to levelofskill
        Set Skill = none
    Else - Actions
        Do nothing

My idea was to remove all spells that are in conflict with the spell casted and as soon as the unit has casted his ability he will regain his spells.
The problem is, like I alreadz said, that the unit casts the last learned skill with that order as soon as he gets an order, so the trigger never will be triggered, because the condition: (Ability being cast) Equal to Spellconflict1 isnt't true.

I would appreciate any kind of help. :cry:
 
Level 11
Joined
Jul 20, 2004
Messages
2,760
Well, the thing is that even though you change the OrderID field for the spell, it won't do anything. Leave the original one, cuz changing the field's value with not change the order string itself. The only spell which allows this is channel. So practically base all your dummy spells off channel, give different order IDs for each, and you have no more conflicts. :)

~Daelin
 
Level 2
Joined
Dec 18, 2005
Messages
28
Well, the thing about it is that I have already used all order strings from spells that target a unit and I could need some more... The spells will be added to heros by triggers like in The Great Strategy, so I have to calculate all posibilities and that's why i have to solve this conflict problem with the order strings... If you have a solution in JASS, like just a spell with 10 levels, that only has an typical icon, name and description and targets a unit, so I can add the ability to a hero and tweak it to get a new spell, so a hero can use both in same time.
 
Status
Not open for further replies.
Top