Variables between two triggers.

FMAlchemist

New Member
Reaction score
4
Ok ok here is my trigger.

Code:
Spell
    Events
        Unit - A unit Starts the effect of an ability
    Conditions
        (Ability being cast) Equal to Fireball 
    Actions
        Unit - Create 1 Wisp for Neutral Passive at (Position of (Triggering unit)) facing Default building facing degrees
        Unit - Make (Last created unit) Invulnerable
        Set main_attack[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
        Unit - Create 1 Ex Wisp for Neutral Passive at (Target point of ability being cast) facing Default building facing degrees
        Unit - Make (Last created unit) Invulnerable
        Unit - Add a 1.50 second Generic expiration timer to (Last created unit)
        Set main_attack_target[(Player number of (Owner of (Triggering unit)))] = (Last created unit)
        Unit - Order main_attack[(Player number of (Owner of (Triggering unit)))] to Move To (Position of main_attack_target[(Player number of (Owner of (Triggering unit)))])
        Trigger - Add to Spell Ex <gen> the event (Unit - A unit comes within 50.00 of main_attack[(Player number of (Owner of (Triggering unit)))])

Code:
Spell Ex
    Events
    Conditions
        (Triggering unit) Not equal to Player_Hero[1]
        (Triggering unit) Not equal to Player_Hero[2]
        (Triggering unit) Not equal to Player_Hero[3]
        (Triggering unit) Not equal to Player_Hero[4]
        (Triggering unit) Not equal to Player_Hero[5]
        (Triggering unit) Not equal to Player_Hero[6]
    Actions
        Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Triggering unit)), dealing 100.00 damage of attack type Spells and damage type Fire
        Special Effect - Create a special effect at (Position of (Triggering unit)) using Abilities\Spells\Human\ThunderClap\ThunderClapCaster.mdl


This spell, shoots out a dummy unit as a spell (wisp), and it travells towards the Wisp Ex, and if it encounters a unit while this is happening, then it will cause damange in a small area.

The problem~ i set the variable of the wisp`s with "[(Player number of (Owner of (Triggering unit)))])", so in the 2nd trigger, this is not valiable, therefor i cannot remove the 2 dummy units.

~~
 

FMAlchemist

New Member
Reaction score
4
sorry~

i should of been more clear on the problem,

when the dummy unit (wisp) comes within 100 range of a unit, it blows up dealing 100 dmg.

i got that to work, BUT i cant remove the wisp, because the variable for the wisp was "[(Player number of (Owner of (Triggering unit)))])" and its in another trigger. the "triggering unit" is not the same. u get it?

"[(Player number of (Owner of (Triggering unit)))])", in trigger 1 = the player

"[(Player number of (Owner of (Triggering unit)))])", in trigger 2 = the unit im attacking, or the unit that came withing 150 range of the dummy spell unit.

so in the first trigger i can remove the wisp fine... but in the 2nd trigger, i cant... is there a way to reffer to another variable from a different trigger? (eg. trigger 2 actions = remove triggering unit of trigger 1)

~~ thats as fine as i can explain my problem :S

thank you though.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Not expiration timers, he may want to remove the unit after it comes within 50.00 range of main_attack[]

What I don't get is the problem.
Don't "Remove Unit" or "Kill Unit" work?

EDIT:
If I remember correctly, if you add an Event with a unit to another trigger, that unit is still carried over.
Like "Add Unit Takes Damage event to Trigger", even though it says Picked Unit (usually) it actually 'brings' the unit to the trigger, not the actual event of "Picked Unit Takes Damage"

For example,
Unit Enters Map
Set LOL = Triggering Unit
Add the event "LOL takes damage" to Trigger2

Since there are lots of units that 'enters the map' so many units are added to Trigger2,
but Trigger2 will fire whenever those unit (who was referred by LOL) takes damage, not just the current LOL.

(yeah, I know, I'm bad at explaining things)
 

FMAlchemist

New Member
Reaction score
4
hahaha. i kind of get what u mean, but the problem in those 2 triggers, is...
Code:
Set main_attack[(Player number of (Owner of (Triggering unit)))] = (Last created unit)

"owner of triggering unit" beauce if i place
Code:
Unit - Kill main_attack[(Player number of (Owner of (Triggering unit)))]

intot he second trigger, the "triggering unit" changes therefor the variable is lost. and i dont know how to select that spercific wisp, without that variable...

-i need the "ownder of triggering unit" because its a 6 player trigger, so if 2 people shoot it at once, they would both have different variables.

[edit -- so beacuse of "Trigger - Add to Spell Ex <gen> the event (Unit - A unit comes within 50.00 of main_attack[(Player number of (Owner of (Triggering unit)))])" the "triggering unit" becomes the unit that comes within range. -- edit]


(if people are finding it hard to picture what im trying to do, examples are like POTM`s arrow in dota, or snipers shooting in elimination tourney, and alot alot mroe games)

~~ rahh this has spell has been bugging me for two days now.
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
Aaah... now I see what you meant :p
The 'entering unit' now becomes the Triggering Unit.

I dunno the solution for now, but if I were you I'd try reversing the whole detection stuff.
Instead of checking if a unit becomes in range of main_attack[],
check if main_attack[] is nearby a unit.

Every xxx second (preferrably 0.10 and under) do a For Loop (6 players, so make it run from 1 to 6)
Set UnitGroupVariable = all units owned by Player[Loop Integer] of type Wisp
Pick every units in UnitGroupVariable and do (actions) etc.

Worth a try.
 

denmax

You can change this now in User CP.
Reaction score
155
Firstly, set (Player Number (Owner of (Triggering Unit)) into a Integer Variable.

Now it woud look like this o_O

main_attack[IntVar] = ...

There you go! ^_^

I recommend setting IntVar at the last part of the first trigger, but main_attack in first trigger will still remain as (Player Number...)

EDIT:

There's no If/Then/Else but I think you can do something like this..

Place this at the very top of the first trigger (CUSTOM SCRIPT!)

local integer udg_IntVar

and put this in the second trigger at the very bottom

null udg_IntVar

PS: THIS THING IS UNTESTED!!!
 

R@i_no_Wyrm

New Member
Reaction score
43
Dang~ I think he works all day because he wants to make it available to any hero so even if he store it at intvar, the intvar is only one!
Maybe this worth a try (wait; you have pick the correct unit right? it's not in the trigger...)

Code:
Unit - Kill main_attack[(Player number of (Owner of (Picked unit)))]

Hey wait~ First I need the full trigger (who's being picked)? If you pick the wisp, so this one should work.
 

denmax

You can change this now in User CP.
Reaction score
155
Dang~ I think he works all day because he wants to make it available to any hero so even if he store it at intvar, the intvar is only one!
Maybe this worth a try (wait; you have pick the correct unit right? it's not in the trigger...)

Code:
Unit - Kill main_attack[(Player number of (Owner of (Picked unit)))]

Hey wait~ First I need the full trigger (who's being picked)? If you pick the wisp, so this one should work.

Then what's Picked Unit in the second trigger then?

Okay, firstly, I set intvar into a global local, making it possibly a MUI spell o_O.

Anyway, the usage of (Triggering Unit) makes "stuff" MUI.
 

R@i_no_Wyrm

New Member
Reaction score
43
Err... here. I think he wants this to be multi casted at the same time; but if you use your trigger, only 1 owner will be stored. He's going to make -sh I think. Read post #5.
 

Sooda

Diversity enchants
Reaction score
318
> (Ability being cast) Equal to Fireball

If your Fireball does constant damage (Isn' t hero ability). Get with math function distance between two points. Like between A and B where A is caster position and B is target position. Don' t forget to remove leaks with custom script:
Code:
custom script: call RemoveLocation(udg_yourPointVariableName)
Add 'udg_' suffix before your variable name. I assume your missile (dummy unit move speed is constant - max move speed). Do simple math to get expiration timer time: distance between points A and B / move speed of dummy unit = expiration timer time. From Object Editor add to dummy unit Immolation (Neutral Hostile) custom version what does 100 damage per second. Order your 'missile' to move where was target. Add to that 'missile' timer time as a expiration time. Store point of ability being cast to variable, afer unit ordering you can clean that variable to avoid memory leaks. You got now MUI ability with easy triggering.
 

R@i_no_Wyrm

New Member
Reaction score
43
wow, nice suggestion. But only mentioning 1 thing : Immolation with 1s damage time is too random and quite hard to damage! Should set it to 0.1 damage delay and 10 damage won't you think?
 

denmax

You can change this now in User CP.
Reaction score
155
wow, nice suggestion. But only mentioning 1 thing : Immolation with 1s damage time is too random and quite hard to damage! Should set it to 0.1 damage delay and 10 damage won't you think?

A stuck-up can really pwn the guy o_O. Maintain it just to be safe...
 

darkRae

Ueki Fan (Ueki is watching you)
Reaction score
173
o_O I'm confused.
Why are we using Immolation now?
He wanted a unit to move to target location and explode dealing damage around the exploding location.
If you use Immolation, it will damage every enemy unit the unit touches.

How about using 'AOE Damage On Death' or 'Kaboom' ability? (like the one Clockwerk Goblin has)
And give it expiration timer with (Distance/Speed) seconds.
So it'll die and deal damage.

Have another trigger that fires when a unit dies.
Check if the Dying Unit is a Wisp, then create SFX (and destroy it)
 

denmax

You can change this now in User CP.
Reaction score
155
Why not just cast Kaboom! to the unit than dividing Distance and Speed? There's a possibility that the target will move farther or nearer..
 

FMAlchemist

New Member
Reaction score
4
hahas, good ideas, i was about go to test it out.

but then i relized what my main problem was.

how to trigger a spercific wisp dye`ing (or using KABOOM), if i cant get the variable that i made the wisp as. u know?

there, is one way around all this, which is to make a variable for each player, and a trigger for each player, but there has got to be an easier way.

::refresh u guys on my what i want::
- units summon, unit made into a variable of the player number.
- unit moves from casting unit, to were ability was being casted at.
- any unit comes within 150 range of this unit, will cause the unit to explode dealing 100 damage in a small area.

::refresh on my problem::
- in the 2nd trigger, i cannot select the spercific unit that was being made

the problem is the dam variable. is there another way to set a unique variable for the same thing? rather then "var(player number of triggering unit)".

~~ thanks for all your ideas

edit:

by the way
Code:
Unit - Cause (Picked unit) to damage circular area after 0.00 seconds of radius 200.00 at (Position of (Triggering unit)), dealing 100.00 damage of attack type Spells and damage type Fire

"picked unit" is my attempt to pick the spercific wisp, but giving up, and clicked that ranodmly. ... has nothing to do with anything.
 

FMAlchemist

New Member
Reaction score
4
i did post my two triggers in post #1.

i was just saying my problem again, because people seemed to forget what my problem was, and that is the variable i had made my wisp in the first trigger that i cannot get to in the seconds trigger, because the "owner of triggering unit" has changed. :. leaving a complete lost in that variable.

and because that, i cannot make a trigger for it to die, in collision with another unit, and exploding if theres any other unit behind it. you see? i can get everything to work, except for the wisp dyeing on impact.

so far, the wisp just walks through the unit, explode, and keeps walking pass the unit. when i want it to die when it first collides with another unit.

you get it... ?

thats why KABOOM wont work, because it will just explode where its ordered to explode, not when it comes in contact with another unit.

its not the damage thats the problem, dont worry about that, its the fact that i cannot kill my own wisp when it comes in contact with another unit.

~~
 

denmax

You can change this now in User CP.
Reaction score
155
As I said, set an integer to a local and make that local integer into (Player Number (Owner of (Triggering Unit) in the first trigger and use that local integer to the second trigger, also to null it.

There was an AI tut made by Andrewgosu(?) and has locals and MUI in it, you should look for it..
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • 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 The Helper:
    Happy Thursday!
    +1
  • Varine Varine:
    Crazy how much 3d printing has come in the last few years. Sad that it's not as easily modifiable though
  • Varine Varine:
    I bought an Ender 3 during the pandemic and tinkered with it all the time. Just bought a Sovol, not as easy. I'm trying to make it use a different nozzle because I have a fuck ton of Volcanos, and they use what is basically a modified volcano that is just a smidge longer, and almost every part on this thing needs to be redone to make it work
  • Varine Varine:
    Luckily I have a 3d printer for that, I guess. But it's ridiculous. The regular volcanos are 21mm, these Sovol versions are about 23.5mm
  • Varine Varine:
    So, 2.5mm longer. But the thing that measures the bed is about 1.5mm above the nozzle, so if I swap it with a volcano then I'm 1mm behind it. So cool, new bracket to swap that, but THEN the fan shroud to direct air at the part is ALSO going to be .5mm to low, and so I need to redo that, but by doing that it is a little bit off where it should be blowing and it's throwing it at the heating block instead of the part, and fuck man
  • Varine Varine:
    I didn't realize they designed this entire thing to NOT be modded. I would have just got a fucking Bambu if I knew that, the whole point was I could fuck with this. And no one else makes shit for Sovol so I have to go through them, and they have... interesting pricing models. So I have a new extruder altogether that I'm taking apart and going to just design a whole new one to use my nozzles. Dumb design.
  • Varine Varine:
    Can't just buy a new heatblock, you need to get a whole hotend - so block, heater cartridge, thermistor, heatbreak, and nozzle. And they put this fucking paste in there so I can't take the thermistor or cartridge out with any ease, that's 30 dollars. Or you can get the whole extrudor with the direct driver AND that heatblock for like 50, but you still can't get any of it to come apart
  • Varine Varine:
    Partsbuilt has individual parts I found but they're expensive. I think I can get bits swapped around and make this work with generic shit though
  • Ghan Ghan:
    Heard Houston got hit pretty bad by storms last night. Hope all is well with TH.
  • The Helper The Helper:
    Power back on finally - all is good here no damage
    +2
  • V-SNES V-SNES:
    Happy Friday!
    +1
  • The Helper The Helper:
    New recipe is another summer dessert Berry and Peach Cheesecake - https://www.thehelper.net/threads/recipe-berry-and-peach-cheesecake.194169/

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top