• 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.
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!
  • ✅ The POLL for Hive's Texturing Contest #34 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!
  • ✅ The POLL for Hive's Techtree Contest #20 is OPEN! Vote for the TOP 3 FACTIONS! 🔗Click here to cast your vote!

[Trigger] Ability has some Problems 3

Status
Not open for further replies.
Level 6
Joined
Aug 19, 2007
Messages
109
I'm workng on another ability for my castle map(again) and this ability seems to work in odd ways... heres what it's meant to do:
1:Create dummy unit at position of the hero(WM=unit variable which stays the same throughout entire game)
2:give dummy unit an ability based on carrion swarm and order dummy to cast it on a point using an angle designated in the 2nd trigger.(angle is set to 0 by default)
3:Loop the action 7 times, each with 1 sec. intervals.

Note:the point variables are ONLY used in this trigger, so they wont change within the trigg.(cept if the unit moves).
  • Strafe Guns
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Ordered unit) Equal to WM
      • (Issued order) Equal to (Order(taunt))
    • Actions
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set Special_Point_WM1 = (Position of (Ordered unit))
          • Set Special_Point_WM2 = (Special_Point_WM1 offset by 500.00 towards Special_Real_WM degrees)
          • Unit - Create 1 Dummy for (Owner of WM) at Special_Point_WM1 facing Special_Real_WM degrees
          • Unit - Add DMG for Strafe Guns to (Last created unit)
          • Unit - Set level of DMG for Strafe Guns for (Last created unit) to (Level of Strafe Guns (Dummy Taunt) for WM)
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm Special_Point_WM2
          • Custom script: call RemoveLocation (udg_Special_Point_WM1)
          • Custom script: call RemoveLocation (udg_Special_Point_WM2)
          • Wait 1.00 game-time seconds
^^^Main trigg
  • Set Angle Strafe Guns
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - Player 6 (Orange) types a chat message containing - as A substring
    • Conditions
      • (Triggering player) Equal to (Owner of WM)
    • Actions
      • For each (Integer A) from 1 to 360, do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Entered chat string) Equal to (- + (String((Integer A))))
            • Then - Actions
              • Set Special_Real_WM = (Real((Integer((Substring((Entered chat string), 2, 4))))))
              • Game - Display to (Player group((Owner of WM))) for 5.00 seconds the text: (Strafe Angle set to: + ((String(Special_Real_WM)) + Degrees.))
            • Else - Actions
              • Do nothing
Setting the Angle ^^^
Problems:When i cast the ability(Dmmy based on Taunt) sometimes i get 5 shots, sometimes 2 if i change the angle to something other than 0. And also sometimes none, or just 1 shot.
Eveything works fine cept the irregular number of shots fired lol.
Plz tell me:
1:Whats wrong
2:If theres a better way to make the "Set angle" trigger instead of looping 360 times lol.

Plz help i need urgent :D :razz::cry::eekani:
 
No need for Integer A loop and the if/then/else as well, just put the actions out and it'll work the same or even better.

And to the irregularity of shots... I have no idea what could be wrong. Maybe the dummies have not enough time to cast the spell, or the range of the ability is too short.
 
Then how do i do the "(- +(string((Integer A))))" eh? i dunno how to do
"(- +(string((A number between 0-360))))" so thats y i use loop. Unless u can tell me a way of doing that.

Also:casting time is 0...they have 2 sec.s lol and also is based off carrion swarm which we know doesnt normall take too long either. Range is 700... The point is 500 from position of unit lol. o.O but ill try increase the difference anyway:grin:. Need other ideas though..

Thanks for your help. More options?

Edit:Nope i test it on 400 range(Ability=700 casting range) still only shoots 5 times -_- lol.
 
Substring itself will work fine, getting the number entered. The Integer A loop and if/then/else just checks if the number is between 1 and 360, which will be one of those either... And there is no problem if a guy enters a number greater than 360, cause 400 for example is 40 (400 - 360) and so on. You could just put an if/then/else statement to check if the number entered is not greater than 999.

Oh, and if everything still works bad, then i have no idea what could be wrong. The only thing i think could cause the problem are the point variables (again, lol), but im not sure what exactly is causing it.

EDIT:
I think i got it, just the wait action i didnt notice. Any trigger event-referring actions (like ordered unit, casting, attacking etc, excluding the triggering unit) are reset back to no unit after any wait action. Just set the position or the caster to a variable, and everything should work.
 
Lol? but why is it 400-360 wtf lol? If entered chat string equal to "-295" then get the substring 2,4 which is 295---then convert to real=295.00 what do you mean by Number-360??? lol. Oh and can you please put the whole set real trigger in GUI format :P i not gud at understanding text words much lol.
TY if answered the 2nd point and first=+rep

Edit:No Go mate, i tried this: still wouldnt work lol:
  • Strafe Guns
    • Events
      • Unit - A unit Is issued an order with no target
    • Conditions
      • (Ordered unit) Equal to WM
      • (Issued order) Equal to (Order(taunt))
    • Actions
      • For each (Integer A) from 1 to 7, do (Actions)
        • Loop - Actions
          • Set Special_Point_WM1 = (Position of WM)
          • Set Special_Point_WM2 = (Special_Point_WM1 offset by 400.00 towards Special_Real_WM degrees)
          • Unit - Create 1 Dummy for (Owner of WM) at Special_Point_WM1 facing Special_Real_WM degrees
          • Unit - Add DMG for Strafe Guns to (Last created unit)
          • Unit - Set level of DMG for Strafe Guns for (Last created unit) to (Level of Strafe Guns (Dummy Taunt) for WM)
          • Unit - Add a 2.00 second Generic expiration timer to (Last created unit)
          • Unit - Order (Last created unit) to Undead Dreadlord - Carrion Swarm Special_Point_WM2
          • Custom script: call RemoveLocation (udg_Special_Point_WM1)
          • Custom script: call RemoveLocation (udg_Special_Point_WM2)
          • Wait 1.00 game-time seconds
You see WM is a fixed variable throughout entire game so by adding that instead of ordered unit it would've solved the problem by what your saying. But the same 5 shots r being fired at 0.00 degrees lol. D::cry:

Edit of an Edit:lol i tried restarting again and again da map to see if ther wuza pattern in the no. of shots fired. :
If (angle)real is untouched its 5 shots.
If its 200 degrees it fires 2 shots
If its 100 degrees it fires 3 shots
If its 50 degrees it fires 3 shots...

Wtf lol there is no pattern except when i DONT touch the angle of fire, it starts off as 5 then goes to 0. shots
 
WOW But why does it work when i do that? TYTYTY for idea :D +rep staberfire...now whoever can help me on my 2nd point gets the 2nd rep lol.:grin::thumbs_up:

And also if you can tell me why it works when i do what staberfire said...instead of the loop it would be welcome :D.:thumbs_up:
 
I think i got it what you wanted to do. You wanted to check if the entered chat string contains a number.
Well, there is another solution:
  • Conditions:
    • Or - Any (Conditions) are true
      • Warunki
        • (Integer((Substring((Entered chat string), 2, 4)))) Greater than or Equal to 1 // Integer Comparison
        • (Substring((Entered chat string), 2, 2)) Equal to (String(0)) // String Comparison
Put this in your trigger conditions, it wont launch the trigger if entered message does not contain any number.
 
Erm just a Q before i give rep, what does the
"(Substring((Entered chat string), 2, 2)) Equal to (String(0)) // String Comparison" do? (the 2nd condition)
Why if its 0 does it detect? what if i typed "-256"? the 2,2 string would be 2 not 0 so it wont work? i wanted it to be between 0-360 and it detects if i type -hello and if i do type that then it wont work.:razz: lol
 
AH but i could do this:
  • Set Angle Strafe Guns
    • Events
      • Player - Player 1 (Red) types a chat message containing - as A substring
      • Player - Player 2 (Blue) types a chat message containing - as A substring
      • Player - Player 3 (Teal) types a chat message containing - as A substring
      • Player - Player 4 (Purple) types a chat message containing - as A substring
      • Player - Player 5 (Yellow) types a chat message containing - as A substring
      • Player - Player 6 (Orange) types a chat message containing - as A substring
    • Conditions
      • (Triggering player) Equal to (Owner of WM)
      • (Integer((Substring((Entered chat string), 2, 4)))) Greater than or equal to 0
      • (Integer((Substring((Entered chat string), 2, 4)))) Less than or equal to 360
    • Actions
      • Set Special_Real_WM = (Real((Integer((Substring((Entered chat string), 2, 4))))))
      • Game - Display to (Player group((Owner of WM))) for 5.00 seconds the text: (Strafe Angle set to: + ((String(Special_Real_WM)) + Degrees.))
Because i need the limit to be 360 remember. And here comes the problem i've been saying all along: what happens if you type "-hello".(I know what hapens) The real sets to 0.00. i need it to detect if theres words instead of numbers and if so cancel triggr. coz i have another trigger with -cam1 and camera functions.
 
Status
Not open for further replies.
Back
Top