1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still haven't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. Ride into the sunset with the 32nd Modeling Contest. The contest is optionally paired. Best of luck, people!
    Dismiss Notice
  4. This adventure has come to an end. Congratulate our heroes in the 16th Mini Mapping Contest Results.
    Dismiss Notice
  5. From the gates of hell, the 5th Special Effect Contest Results have emerged.
    Dismiss Notice
  6. Race against the odds and Reforge, Don't Refund. The 14th Techtree Contest has begun!
    Dismiss Notice
  7. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Trigger] Need Help [hidden=trigger][/hidden]

Discussion in 'Triggers & Scripts' started by yuganeigii, Jan 10, 2014.

  1. yuganeigii

    yuganeigii

    Joined:
    Feb 9, 2008
    Messages:
    63
    Resources:
    0
    Resources:
    0
    Need Help :C

    hello...
    im working on a spell for my map and i run into some sort of problems along the way and im hoping someone would help...the spell im working at is a passive spell that (supposedly) goes like multicast in dota (i know its probably been ask a lot of times)
    and for those who dont play dota-Multicast is a passive spell that gives your hero a certain chance to cast a spell again

    heres my trigger
    Init
    • Multicast Initialization
      • Events
        • Map initialization
      • Conditions
      • Actions
        • Set M_C_Spell = Bash awe
        • Set M_C_Dummy = Dummy Unit

    Cast
    • Multicast Cast
      • Events
        • Unit - A unit Starts the effect of an ability
      • Conditions
        • (Level of M_C_Spell for (Triggering unit)) Greater than 0
        • (Random integer number between 1 and 100) Less than or equal to (25 + (5 x (Level of M_C_Spell for (Triggering unit))))
      • Actions
        • Set M_C_Index = (M_C_Index + 1)
        • -------- --------
        • -------- --------
        • Set M_C_Caster[M_C_Index] = (Triggering unit)
        • Set M_C_Point[M_C_Index] = (Position of M_C_Caster[M_C_Index])
        • Set M_C_Target[M_C_Index] = (Target unit of ability being cast)
        • Set M_C_DummySpell[M_C_Index] = (Ability being cast)
        • Set M_C_Order[M_C_Index] = (Current order of M_C_Caster[M_C_Index])
        • -------- --------
        • Set M_C_Counter[M_C_Index] = 0
        • -------- --------
        • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
          • If - Conditions
            • M_C_Index Equal to 1
          • Then - Actions
            • Trigger - Turn on Multicast Loop <gen>
          • Else - Actions

    Loop
    • Multicast Loop
      • Events
        • Time - Every 0.30 seconds of game time
      • Conditions
      • Actions
        • For each (Integer M_C_Integer) from 1 to M_C_Index, do (Actions)
          • Loop - Actions
            • -------- --------
            • Set M_C_Counter[M_C_Integer] = (M_C_Counter[M_C_Integer] + 1)
            • -------- --------
            • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • M_C_Counter[M_C_Integer] Equal to 2
              • Then - Actions
                • Unit - Create 1 M_C_Dummy for (Owner of M_C_Caster[M_C_Integer]) at M_C_Point[M_C_Integer] facing Default building facing degrees
                • Set M_C_Dummy2[M_C_Integer] = (Last created unit)
                • Unit - Add a 2.00 second Generic expiration timer to M_C_Dummy2[M_C_Integer]
                • Unit - Add M_C_DummySpell[M_C_Integer] to M_C_Dummy2[M_C_Integer]
                • Unit - Set level of M_C_DummySpell[M_C_Integer] for M_C_Dummy2[M_C_Integer] to (Level of M_C_Spell for M_C_Caster[M_C_Integer])
                • Set M_C_Chance2 = (Random integer number between 1 and (Level of M_C_Spell for M_C_Caster[M_C_Integer]))
                • -------- Text to see if it works --------
                • Floating Text - Create floating text that reads (String((M_C_Chance2 + 1))) above M_C_Caster[M_C_Integer] with Z offset 0.00, using font size 10.00, color (100.00%, 0.00%, 0.00%), and 0.00% transparency
                • Floating Text - Change (Last created floating text): Disable permanence
                • Floating Text - Change the fading age of (Last created floating text) to 2.00 seconds
                • Floating Text - Change the lifespan of (Last created floating text) to 3.00 seconds
                • -------- Text to see if it works --------
                • For each (Integer A) from 1 to M_C_Chance2, do (Actions)
                  • Loop - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • ((Playable map area) contains M_C_Point[M_C_Integer]) Equal to True
                      • Then - Actions
                        • Custom script: call IssuePointOrderByIdLoc( udg_M_C_Dummy2[udg_M_C_Integer], udg_M_C_Order[udg_M_C_Integer], udg_M_C_Point[udg_M_C_Integer] )
                      • Else - Actions
                    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                      • If - Conditions
                        • M_C_Target[M_C_Integer] Not equal to No unit
                      • Then - Actions
                        • -------- --------
                        • Custom script: call IssueTargetOrderById( udg_M_C_Dummy2[udg_M_C_Integer], udg_M_C_Order[udg_M_C_Integer], udg_M_C_Target[udg_M_C_Integer] )
                        • Custom script: call IssueImmediateOrderById( udg_M_C_Dummy2[udg_M_C_Integer], udg_M_C_Order[udg_M_C_Integer] )
                      • Else - Actions
                • -------- --------
                • Custom script: call RemoveLocation(udg_M_C_Point[udg_M_C_Integer])
                • -------- --------
                • Set M_C_Point[M_C_Integer] = M_C_Point[M_C_Index]
                • Set M_C_Dummy2[M_C_Integer] = M_C_Dummy2[M_C_Index]
                • Set M_C_Caster[M_C_Integer] = M_C_Caster[M_C_Index]
                • Set M_C_Counter[M_C_Integer] = M_C_Counter[M_C_Index]
                • Set M_C_Index = (M_C_Index - 1)
                • Set M_C_Integer = (M_C_Integer - 1)
                • -------- --------
                • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                  • If - Conditions
                    • M_C_Index Equal to 0
                  • Then - Actions
                    • Trigger - Turn off (This trigger)
                  • Else - Actions
              • Else - Actions

    test
    • Testing Purposes
      • Events
        • Unit - A unit Finishes casting an ability
      • Conditions
        • (Unit-type of (Casting unit)) Equal to Dummy Unit
      • Actions
        • Game - Display to (All players) for 12.00 seconds the text: (String((Level of (Ability being cast) for (Casting unit))))


    little bit of explanation about my spell:
    if Bash is learned the and the unit cast a spell it should give a "x" chance to cast it again
    level 1 - x chance to cast a spell again
    level 2 - x chance to cast a spell once. x chance to cast a spell 2 times
    level 3 - x chance to cast a spell once. x chance to cast a spell 2 times. x chance to cast a spell 3 times


    so heres the problems:
    1.it works but win no interval between the spells example: i cast thunder clap and multicast gives a dummy unit chance to cast it again for 3 more times after i cast...the dummy cast thunder clap 3 times at one instance without interval...how do i solve this?

    2.whenever i cast a point targeted spell (shockwave for expample) the dummy cast it towards the center of the map (not sure on this one but as long as i doesn't cast it towards the direction the player intented its no go)

    ive attach my test map so that anyone could test it and see if there are more errors im not aware yet
    View attachment TESTING.w3x
     
    Last edited: Jan 10, 2014
  2. DysfunctionaI

    DysfunctionaI

    Joined:
    Mar 6, 2006
    Messages:
    281
    Resources:
    1
    Tutorials:
    1
    Resources:
    1
    1.) You need another timer for every interval. Maybe like a 1 shot timer and another trigger catches the expire, and continues with the indexed variables. The last trigger in the chain of timers would have to be the one to de-index a cast of Multicast.

    2.) You set your point to the position of your caster, so he's always casting point spells on himself:

    • Set M_C_Point[M_C_Index] = (Position of M_C_Caster[M_C_Index])


    I think you mean this:

    • Set M_C_Point[M_C_Index] = (Target point of ability being cast)
     
  3. yuganeigii

    yuganeigii

    Joined:
    Feb 9, 2008
    Messages:
    63
    Resources:
    0
    Resources:
    0
    how do i make one?

    • Set M_C_Point[M_C_Index] = (Position of M_C_Caster[M_C_Index])


    i really intended it to be like this to ensure that there will be no conflict in the casting range :D
     
  4. yuganeigii

    yuganeigii

    Joined:
    Feb 9, 2008
    Messages:
    63
    Resources:
    0
    Resources:
    0
  5. Adiktuz

    Adiktuz

    Joined:
    Oct 16, 2008
    Messages:
    9,674
    Resources:
    23
    Models:
    2
    Packs:
    1
    Maps:
    1
    Spells:
    16
    Tutorials:
    1
    JASS:
    2
    Resources:
    23
    or make three different thunder claps that has casting time... so like 1 is instant cast, another has 0.5 second cast and third has 1 second cast...