• Check out the results of the Techtree Contest #19!
  • 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.
  • Create a void inspired texture for Warcraft 3 and enter Hive's 34th Texturing Contest: Void! Click here to enter!
  • The Hive's 22nd Icon Contest: Creep Abilities is now concluded, time to vote for your favourite set of icons! Click here to vote!

i need some help in triggering...

Status
Not open for further replies.
Level 4
Joined
Oct 23, 2013
Messages
92
I made a channeling spell a non-channeling and i successfully did it but the problem is when i try to increase the level of the spell that the dummy casts, the whole spell doesn't work. I'm a newbie so kindly give the most simplest solution. Thanks! ;)
 
what i'm trying to do is to set the level of the spell on the dummy unit equal to the level of the hero unit.
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Ability being cast) Equal to Blizzard (Dummy)
    • Actions
      • Unit - Create 1 Dummy (Caster) for (Owner of (Triggering unit)) at (Target point of ability being cast) facing Default building facing degrees
      • Unit - Add Blizzard Real to (Last created unit)
      • Unit - Add a 5.00 second Generic expiration timer to (Last created unit)
      • Unit - Order (Last created unit) to Human Archmage - Blizzard (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Blizzard (Dummy) for (Triggering unit)) Equal to 1
        • Then - Actions
          • Unit - Set level of Blizzard Real for (Last created unit) to 1
        • Else - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (Level of Blizzard (Dummy) for (Triggering unit)) Equal to 2
            • Then - Actions
              • Unit - Set level of Blizzard Real for (Last created unit) to 2
            • Else - Actions
              • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
                • If - Conditions
                  • (Level of Blizzard (Dummy) for (Triggering unit)) Equal to 3
                • Then - Actions
                  • Unit - Set level of Blizzard Real for (Last created unit) to 3
                • Else - Actions
                  • Do nothing
 
  • Event - a unit starts the effect of an ability
  • Condition - Ability being cast == Blizzard (non-channeling)
  • Actions -
  • Set TempPoint = Target point of Ability being Cast
  • Set TempUnit = Triggering Unit
  • Create 1 Dummy for Owner of TempUnit Facing whatever.
  • Set TempUnit2 = LastCreated Unit
  • Add Ability Blizzard (channeling) to TempUnit2
  • Set Level of Blizzard (channeling) for TempUnit2 to Level of Blizzard(non-channeling) for TempUnit
  • Order TempUnit2 to Human Archmage Blizz TempPoint.
  • Custom Script: call RemoveLocation(udg_TempPoint)
 
Depends, but I suggest you do, it makes it easier for the game to run when you use Temp variables. (TempUnit)
 
i already red a couple of tutorials but some of them i can't quite understand, too advanced i think.
 
it would be much better if the tutorials have sample spells so we newbies could use as a reference.
 
well i don't quite need to make spells atm coz im not yet done with the terrain of the map that i'm making. I'll worry about triggers later.
 
  • Unit - Order (Last created unit) to Human Archmage - Blizzard (Target point of ability being cast)
You'd let the dummy cast it's ability before setting the level of the dummy ability. 3 or 4 ITE Conditions is unneeded seems that there is integer action about Level of ability of the unit.
 
hey sir if you have knowledge at triggering could you make any corrections on the triggers that i made? Take a look at em and tell me what you think.
 
  • Untitled Trigger 001
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Blizzard (Fake)
    • Actions
      • Set Point = (Target point of ability being cast)
      • Unit - Create 1 Dummy for (Triggering player) at Point facing Default building facing (270.0) degrees
      • Set Unit = (Last created unit)
      • Unit - Add Blizzard (Real) to Unit
      • Unit - Set level of Blizzard (Real) for Unit to (Level of Blizzard (Fake) for (Triggering unit))
      • Unit - Order Unit to Human Archmage - Blizzard Point
      • Custom Script : call RemoveLocation(udg_Point)
 
^Well I don't know or I don't have knowledge about triggering because I'm only a mapper or terrainer :DDD.



but let me try this:

Create
Settle
Destroy

Create = Create a dummy to the triggering player at target point of ability being cast

Seems target point of ability being cast is leaking location, well you might store it to a point variable and later destroy it when unneeded
Seems triggering player is faster than GetOwningPlayer( udg_MY_CASTER )

Settle = Settle or Set the level of the dummy ability to the level of the caster ability.
level of the caster ability acts like integer then it detects the level of the ability of the caster, for example: The level of the caster ability to the caster is equal to 1 then it will show us a integer like this: Settle or Set the level of the dummy ability to the 1 and so on.. the level.

Destroy = Removing leaks or nullifying handle or agent variables.

You must read that Things that Leak because it will help u.
Custom script: call RemoveLocation ( udg_MY_POINT )

call is from the JASS script line, it calls a function with this key word.
RemoveLocation well it seems like Destroy Location or Remove, this function used as removing location or points, it removes the location that you used in the trigger so it is needed. Why do we need to remove locations? A: avoiding leaks, because it is horrible in the late game when you have 3000 or 2000 more than leaks.

udg_MY_POINT Q: What is this and why it has a udg_ thingy? A: Well the udg part stands for " User Defined Globals " mean that they are global variables, not local variables, because local variables does not requiring a prefixes unlike global variables. QWhat is MY_POINT? A: That is the POINT variable that causes leaks in game, you'd see that I'd set it to the execution so it must remove to the execution when you're not using it anymore, and as always ^^.

  • Untitled Trigger 001
  • Events
  • Unit - Starts the effect of an ability
  • Conditions
  • (Ability being cast) Equal to Blizzard (Dummy)
  • Actions
  • Set MY_CASTER = (Triggering unit)
  • Set MY_POINT = (Target point of ability being cast)
  • Set THE_LEVEL = Level of Blizzard (Dummy) for MY_CASTER
  • Unit - Create 1 Dummy (Caster) for (Triggering Player) at MY_POINT facing Default building facing degrees
  • Set MY_DUMMY = ( Last created unit )
  • Unit - Add a 5.00 second Generic expiration timer to MY_DUMMY
  • Unit - Add Blizzard Real to MY_DUMMY
  • Unit - Set level of Blizzard Real for MY_DUMMY to THE_LEVEL
  • Unit - Order MY_DUMMY to Human Archmage - Blizzard MY_POINT
  • Custom script: call RemoveLocation ( udg_MY_POINT )
EDIT: Daffa the Mage beat e to it.
 
Last edited:
^ It is just a demo code so it is showing how from the user.

"Also last created unit is already a global variable so storing the dummy is unneeded too ."

?? It is used 3 or more than times, so it must be stored.
I don't understand this part "Also last created unit is already a global variable"
Do you pointing in this?: bj_lastCreatedUnit
 
  • Set TempMissile = (Last created unit)
converted to jass is:
set udg_TempMissile = GetLastCreatedUnit()

It's not a variable.
 
ok i can't understand any of this stuff but thanks anyway, it might be useful to me in the future.
 
since custom scripts, variables and integers are involved, i'll put spell making on hold for a while and focus on the terrain of my map but thanks again for all the help.
 
is it necessary to use variables?

should i put the spell that the dummy cast's into the variable? in order to set the level of the spell that the dummy casts equal to the level of the hero triggering the dummy spell?

i made another spell based on mister Daffa's sample and it worked! thanks to those people who helped me!
 
Last edited by a moderator:
"i made another spell based on mister Daffa's sample and it worked! thanks to those people who helped me!"

Sorry, my bad xD! ( I forgot to change the Begins casting an ability to the Unit - Starts the effect of an ability ) but both of the triggers will work ^^.
 
I have another problem, im trying to use " pan camera with interpolated height" but when i test the map in doesn't seem to work. I made all the units and buildings on my map but it doesn't look quite good, i need a second opinion.
 
I have another problem, im trying to use " pan camera with interpolated height" but when i test the map in doesn't seem to work. I made all the units and buildings on my map but it doesn't look quite good, i need a second opinion.

"I made all the units and buildings real tiny" correction.
 
  • Camera Height
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Camera - Pan camera for Player 1 (Red) to (Center of (Playable map area)) with height 700.00 above the terrain over 0.00 seconds
here's the trigger.
 
^ Use Pan Camera Timed, anyway why do you want in interpolated height?
You can use SetCameraField or you can use this in height of the camera:
  • Camera - Set Player 1 (Red)'s camera Distance to target to 700.00 over 0.00 seconds
then use Pan Camera Timed
  • Camera - Pan camera for Player 1 (Red) to (Center of (Playable map area)) over 0.00 seconds
 
i wan't to see my map in a much farther point of view.

if i use a spell that targets a unit instead of point should i still put "point" on variable?
 
Last edited by a moderator:
"i wan't to see my map in a much farther point of view."

You can set the camera distance by higher value so that it will be higher farther view
  • Camera - Set Player 1 (Red)'s camera Distance to target to 3000.00 over 0.00 seconds
In the 3000 value it will make a farther view =).



"if i use a spell that targets a unit instead of point should i still put "point" on variable?"

it depends on the spell
 
so depends on the spell? because sometimes i see on the variables named "Target" and sometimes "Point" and some "Temp_Point"
 
oh i see...
i have another question, if i make a "Ability" variable, does it store all the ability in the map?
to make it clear, can i use just one variable for example on 100 spells that uses variable?
 
^ Yes of course like: TempPoints but it depends ( but it will collide to other spells that uses that variable on the Loop ) so it must be MUI,
but if you need by one by one then you will use prefixes on the variable like:
Impale_Point --> I_Point
 
oh i see... i'm working on a new spell please check for things that might leak or some sort.
 
oh i see...
i have another question, if i make a "Ability" variable, does it store all the ability in the map?
to make it clear, can i use just one variable for example on 100 spells that uses variable?

Arrays (Variables indexed with Numbers/Integer) is possible, but have 8190 limit amount of initialization.
In other hand, there's also a thing that is more or less like variables but support 2^31 amount of values and has 0.01% chance for collision with proper structure of saving! that is called Hashtables. Sadly, some Hashtables actions such as Save Ability, Widget and many others are broken (crashes WE upon selection), but can be gained via Custom Script.
Also, Variables can collide, where areas the last saved value will be the one saved, and the other values will be removed (this is also points out why destroying variables before reusing them is very necessary).

One of our valuable members have make a nice tutorial relevant to GUI.
https://www.hiveworkshop.com/forums...rials-279/things-gui-user-should-know-233242/

Also, you might look into this tutorial while involved in Camera using, especially if you use
  • Camera - Pan Camera as Necessary
https://www.hiveworkshop.com/forums...ls-279/fixing-smartcamerapanbj-desync-243334/
 
i can't seem to make this spell work, when the unit is attack there's a % to increase it's attack speed. Here's the trigger.

  • Panic Reload
    • Events
      • Unit - A unit Is attacked
    • Conditions
      • (Random integer number between 1 and 100) Less than or equal to (10 x (Level of Panic Reload for (Attacked unit)))
      • (Level of Panic Reload for (Attacked unit)) Greater than 0
      • Or - Any (Conditions) are true
        • Conditions
          • ((Random integer number between 1 and 100) Equal to 10) and ((Level of Panic Reload for (Attacked unit)) Equal to 1)
          • ((Random integer number between 1 and 100) Equal to 20) and ((Level of Panic Reload for (Attacked unit)) Equal to 2)
          • ((Random integer number between 1 and 100) Equal to 30) and ((Level of Panic Reload for (Attacked unit)) Equal to 3)
    • Actions
      • Set Point = (Position of PR_Unit)
      • Unit - Create 1 Dummy Caster for (Owner of (Attacked unit)) at (Position of PR_Unit) facing (Position of PR_Unit)
      • Set PR_Unit = (Attacked unit)
      • Set Unit = (Last created unit)
      • Unit - Add Panic Reloading (Reloaded) to Unit
      • Unit - Set level of Panic Reloading (Reloaded) for Unit to (Level of Panic Reload for PR_Unit)
      • Unit - Order Unit to Orc Shaman - Bloodlust PR_Unit
      • Unit - Add a 1.50 second Generic expiration timer to Unit
 
Status
Not open for further replies.
Back
Top