Making a spell MPI (GUI)

whoopwhoop

Cool Member
Reaction score
1
EDIT: ok, last problem got fixed but now I have a new problem with a spell.

One of the heroes in the map has an ability that's based on Aerial Shackles, but I made a trigger so that it also pulls the targeted unit towards the caster.

When I cast it on a unit it works fine and it's MPI too now, but when I cast it on a unit and then cast it with another hero (owned by a different player) on that same unit it pulls the unit towards the location of the previous caster. And I don't understand why...

These are the triggers:
Trigger:
  • Soul Extraction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Soul Extraction (Demon Lord)
    • Actions
      • Set Unit_SE[(Player number of (Triggering player))] = (Triggering unit)
      • Set TUnit_SE[(Player number of (Triggering player))] = (Target unit of ability being cast)
      • Set Point1_SE[(Player number of (Triggering player))] = (Position of (Triggering unit))
      • Set Point2_SE[(Player number of (Triggering player))] = (Position of (Target unit of ability being cast))
      • Set Real2_SE[(Player number of (Triggering player))] = ((Distance between Point1_SE[(Player number of (Triggering player))] and Point2_SE[(Player number of (Triggering player))]) x -0.03)
      • Set Boolean_SE[(Player number of (Triggering player))] = False
      • Unit - Turn collision for TUnit_SE[(Player number of (Triggering player))] Off
      • Trigger - Turn on OO Soul Extraction Pull <gen>

Trigger:
  • OO Soul Extraction Pull
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • Set Integer[1] = 0
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Multiple ConditionsAnd - All (Conditions) are true
                  • Conditions
                    • (TUnit_SE[(Integer A)] has buff Soul Extraction ) Equal to (==) True
                    • Boolean_SE[(Integer A)] Equal to (==) False
                    • (Unit_SE[(Integer A)] is alive) Equal to (==) True
                    • (TUnit_SE[(Integer A)] is alive) Equal to (==) True
              • Then - Actions
                • Set Point[1] = (Position of Unit_SE[(Integer A)])
                • Set Point[2] = (Position of TUnit_SE[(Integer A)])
                • Set Real[1] = (Angle from Point1_SE[(Integer A)] to Point[2])
                • Set Point[3] = (Point[2] offset by Real2_SE[(Integer A)] towards Real[1] degrees)
                • Unit - Move TUnit_SE[(Integer A)] instantly to Point[3]
                • Set Point[2] = (Position of TUnit_SE[(Integer A)])
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between Point[1] and Point[2]) Less than (<) 120.00
                    • Then - Actions
                      • Set Boolean_SE[(Integer A)] = True
                    • Else - Actions
                • Set Point[1] = (Position of No unit)
                • Custom script: call RemoveLocation (udg_Point[1])
                • Custom script: call RemoveLocation (udg_Point[2])
                • Custom script: call RemoveLocation (udg_Point[3])
              • Else - Actions
                • Unit - Turn collision for TUnit_SE[(Integer A)] On
                • Set Integer[1] = (Integer[1] + 1)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer[1] Equal to (==) 12
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions

Anyone know what it is that cause the unit to move to the location of the previous caster?
 

Imp Midna

Active Member
Reaction score
52
Trigger:
  • Set Integer_GP[(Player number of (Triggering player))] = (2 + (2 x (Level of (Ability being cast) for (Triggering unit))))

Trigger:
  • Integer2_GP[(Integer A)] Less than or equal to (<=) Integer1_GP[(Integer A)]


Asuming Integer_GP is supposed to be what Integer1_GP is asumed to be, as i can not see any occurence of Integer1_GP in the triggers.
 

whoopwhoop

Cool Member
Reaction score
1
Trigger:
  • Set Integer_GP[(Player number of (Triggering player))] = (2 + (2 x (Level of (Ability being cast) for (Triggering unit))))

Trigger:
  • Integer2_GP[(Integer A)] Less than or equal to (<=) Integer1_GP[(Integer A)]


Asuming Integer_GP is supposed to be what Integer1_GP is asumed to be, as i can not see any occurence of Integer1_GP in the triggers.
What... How did that even happen? I just checked the variables and there's no integer_GP variable, only integer1_GP and integer2_GP.. I fixed it and it works now. Thanks!
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
change all those triggering players to owner of triggering unit
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
a unit caused the event so there is no triggering player. All the parts calling for a triggering player are not working, simply change it over to player number owner of triggering unit and your spell should work,

This should make it easier to understand open up worldeditor and add 2 regions then make these triggers.
Trigger:
  • Untitled Trigger 003 Copy
    • Events
    • Map initialization
    • Conditions
    • Actions
    • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
    • Unit - Create 1 Paladin for (Player((Integer A))) at (Center of Region 012 <gen>) facing Default building facing degrees

Trigger:
  • Untitled Trigger 003
    • Events
    • Unit - A unit enters Region 012 <gen>
    • Unit - A unit enters Region 013 <gen>
    • Conditions
    • Actions
    • Game - Display to (All players) the text: (String((Player number of (Triggering player))))
    • Wait 1.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Region 012 <gen> contains (Triggering unit)) Equal to True
    • Then - Actions
    • Unit - Order (Entering unit) to Move To (Center of Region 013 <gen>)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Region 013 <gen> contains (Triggering unit)) Equal to True
    • Then - Actions
    • Unit - Order (Entering unit) to Move To (Center of Region 012 <gen>)
    • Else - Actions

The Only text you will receive is a bunch of ones, which will make the ability not MPI
 

whoopwhoop

Cool Member
Reaction score
1
a unit caused the event so there is no triggering player. All the parts calling for a triggering player are not working, simply change it over to player number owner of triggering unit and your spell should work,

This should make it easier to understand open up worldeditor and add 2 regions then make these triggers.
Trigger:
  • Untitled Trigger 003 Copy
    • Events
    • Map initialization
    • Conditions
    • Actions
    • For each (Integer A) from 1 to 8, do (Actions)
    • Loop - Actions
    • Unit - Create 1 Paladin for (Player((Integer A))) at (Center of Region 012 <gen>) facing Default building facing degrees

Trigger:
  • Untitled Trigger 003
    • Events
    • Unit - A unit enters Region 012 <gen>
    • Unit - A unit enters Region 013 <gen>
    • Conditions
    • Actions
    • Game - Display to (All players) the text: (String((Player number of (Triggering player))))
    • Wait 1.00 seconds
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Region 012 <gen> contains (Triggering unit)) Equal to True
    • Then - Actions
    • Unit - Order (Entering unit) to Move To (Center of Region 013 <gen>)
    • Else - Actions
    • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
    • If - Conditions
    • (Region 013 <gen> contains (Triggering unit)) Equal to True
    • Then - Actions
    • Unit - Order (Entering unit) to Move To (Center of Region 012 <gen>)
    • Else - Actions

The Only text you will receive is a bunch of ones, which will make the ability not MPI

Alright, so I just tested this trigger, and it doesn't work like you said it would.

But when I put
Trigger:
  • Game - Display to (All players) the text: (String((Player number of (Triggering player))))

in the trigger of my spell it does however give the right number, and when I force them to cast it at the same time it also works. I'm confused now.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
That trigger is just to show that triggering player wont work on a unit even, no matter what player owns the unit that enters the region it will give you a 1 [default value] cause the player number of triggering player is a player activated event and the unit enters region is a unit activated event.

The first trigger makes you 1 paladin for each player 1-8, the 2nd trigger makes them run back and forth between the regions then says what number player owns the unit, it should read out 1, 2 ,3 ,4, and so on, however it wont do this cause player number of triggering player was used in it. Since it is a unit even and not a player there is no triggering player so it will give you the default. However if you use player number owner of triggering/entering unit it will work fine since it is a unit event.

If you want it to be MUI instead of MPI you are going to have to go a step further and set custom values on the units. For that you are going to need to make a [integer variable array] and every time it casts a spell have it set unit custom value = IVA then set IVA [player number of triggering unit] = IVA [player number of triggering unit] + 1 then just call on the units custom value in the trigger.
 

whoopwhoop

Cool Member
Reaction score
1
That trigger is just to show that triggering player wont work on a unit even, no matter what player owns the unit that enters the region it will give you a 1 [default value] cause the player number of triggering player is a player activated event and the unit enters region is a unit activated event.

The first trigger makes you 1 paladin for each player 1-8, the 2nd trigger makes them run back and forth between the regions then says what number player owns the unit, it should read out 1, 2 ,3 ,4, and so on, however it wont do this cause player number of triggering player was used in it. Since it is a unit even and not a player there is no triggering player so it will give you the default. However if you use player number owner of triggering/entering unit it will work fine since it is a unit event.

If you want it to be MUI instead of MPI you are going to have to go a step further and set custom values on the units. For that you are going to need to make a [integer variable array] and every time it casts a spell have it set unit custom value = IVA then set IVA [player number of triggering unit] = IVA [player number of triggering unit] + 1 then just call on the units custom value trigger.

Ahh right.

I probably won't make it MUI, the map doesn't really allow people to have more than 1 hero.

Thanks for helping.
 

whoopwhoop

Cool Member
Reaction score
1
Alright, I have a new problem now, and it's kinda about the same thing but with a different spell:

One of the heroes in the map has an ability that's based on Aerial Shackles, but I made a trigger so that it also pulls the targeted unit towards the caster.

When I cast it on a unit it works fine and it's MPI too now, but when I cast it on a unit and then cast it with another hero (owned by a different player) on that same unit (afterwards) it pulls the unit towards the location of the previous caster. And I don't understand why...

These are the triggers:
Trigger:
  • O Soul Extraction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Soul Extraction (Demon Lord)
    • Actions
      • Set Unit_SE[(Player number of (Triggering player))] = (Triggering unit)
      • Set TUnit_SE[(Player number of (Triggering player))] = (Target unit of ability being cast)
      • Set Point1_SE[(Player number of (Triggering player))] = (Position of (Triggering unit))
      • Set Point2_SE[(Player number of (Triggering player))] = (Position of (Target unit of ability being cast))
      • Set Real2_SE[(Player number of (Triggering player))] = ((Distance between Point1_SE[(Player number of (Triggering player))] and Point2_SE[(Player number of (Triggering player))]) x -0.03)
      • Set Boolean_SE[(Player number of (Triggering player))] = False
      • Unit - Turn collision for TUnit_SE[(Player number of (Triggering player))] Off
      • Trigger - Turn on OO Soul Extraction Pull <gen>

Trigger:
  • OO Soul Extraction Pull
    • Events
      • Time - Every 0.06 seconds of game time
    • Conditions
    • Actions
      • Set Integer[1] = 0
        • Do Multiple ActionsFor each (Integer A) from 1 to 12, do (Actions)
          • Loop - Actions
            • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
              • If - Conditions
                • Multiple ConditionsAnd - All (Conditions) are true
                  • Conditions
                    • (TUnit_SE[(Integer A)] has buff Soul Extraction ) Equal to (==) True
                    • Boolean_SE[(Integer A)] Equal to (==) False
                    • (Unit_SE[(Integer A)] is alive) Equal to (==) True
                    • (TUnit_SE[(Integer A)] is alive) Equal to (==) True
              • Then - Actions
                • Set Point[1] = (Position of Unit_SE[(Integer A)])
                • Set Point[2] = (Position of TUnit_SE[(Integer A)])
                • Set Real[1] = (Angle from Point1_SE[(Integer A)] to Point[2])
                • Set Point[3] = (Point[2] offset by Real2_SE[(Integer A)] towards Real[1] degrees)
                • Unit - Move TUnit_SE[(Integer A)] instantly to Point[3]
                • Set Point[2] = (Position of TUnit_SE[(Integer A)])
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • (Distance between Point[1] and Point[2]) Less than (<) 120.00
                    • Then - Actions
                      • Set Boolean_SE[(Integer A)] = True
                    • Else - Actions
                • Set Point[1] = (Position of No unit)
                • Custom script: call RemoveLocation (udg_Point[1])
                • Custom script: call RemoveLocation (udg_Point[2])
                • Custom script: call RemoveLocation (udg_Point[3])
              • Else - Actions
                • Unit - Turn collision for TUnit_SE[(Integer A)] On
                • Set Integer[1] = (Integer[1] + 1)
                  • Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
                    • If - Conditions
                      • Integer[1] Equal to (==) 12
                    • Then - Actions
                      • Trigger - Turn off (This trigger)
                    • Else - Actions

Anyone know what it is that cause the unit to move to the location of the previous caster?

I know Point1_SE and Point2_SE leak, but I just added those to see if it would fix it, but it didn't.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
you are using triggering player on a unit event again. :p
 

whoopwhoop

Cool Member
Reaction score
1
you are using triggering player on a unit event again. :p

Alright, I changed that now, but it still doesn't work correctly.

Trigger:
  • O Soul Extraction
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to (==) Soul Extraction (Demon Lord)
    • Actions
      • Set Unit_SE[(Player number of (Owner of (Triggering unit)))] = (Triggering unit)
      • Set TUnit_SE[(Player number of (Owner of (Triggering unit)))] = (Target unit of ability being cast)
      • Set Point1_SE[(Player number of (Owner of (Triggering unit)))] = (Position of (Triggering unit))
      • Set Point2_SE[(Player number of (Owner of (Triggering unit)))] = (Position of (Target unit of ability being cast))
      • Set Real2_SE[(Player number of (Owner of (Triggering unit)))] = ((Distance between Point1_SE[(Player number of (Owner of (Triggering unit)))] and Point2_SE[(Player number of (Owner of (Triggering unit)))]) x -0.03)
      • Set Boolean_SE[(Player number of (Owner of (Triggering unit)))] = False
      • Unit - Turn collision for TUnit_SE[(Player number of (Owner of (Triggering unit)))] Off
      • Trigger - Turn on OO Soul Extraction Pull <gen>
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Point2_SE[(Player number of (Owner of (Triggering unit)))]) x -0.03)
I am not sure but the * -0.03 might be the problem :p
When using negatives in multiples it you have 1 negative and 1 positive then the results will always be a negative.
 

whoopwhoop

Cool Member
Reaction score
1
Point2_SE[(Player number of (Owner of (Triggering unit)))]) x -0.03)
I am not sure but the * -0.03 might be the problem :p
When using negatives in multiples it you have 1 negative and 1 positive then the results will always be a negative.

If the minus isn't there it pushes the unit away instead of pulling it towards the caster.

I think the problem is with the point[3] variable and the real2_SE variable, but I can't figure out what's wrong with it.

EDIT: Well I guess I could always just make a separate trigger for each player...
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
just noticed some thing.
Event unit starts the effect of an ability.
triggering unit = the unit being effected by the ability hence being the target.
Targeted unit = the target of the ability.
so unit_se and tunit_se are being set to the same unit.
 

whoopwhoop

Cool Member
Reaction score
1
just noticed some thing.
Event unit starts the effect of an ability.
triggering unit = the unit being effected by the ability hence being the target.
Targeted unit = the target of the ability.
so unit_se and tunit_se are being set to the same unit.
Nope, doesn't fix it. :/

The ability works, but when I use it on an unit that has already been hit by the ability by an other player it moves to the location of the hero that other player has.
 

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
can you post the trigger how you have it set right now?
 

whoopwhoop

Cool Member
Reaction score
1
can you post the trigger how you have it set right now?

I'll just post the map:

I think I figured out what causes it.
If you stop casting the spell, while its still being pushed it goes wrong.

So in order to recreate it what you do is:
1. cast aerial shackles with paladin 1
2. break the shackles while its being pulled
3. cast aerial shackles with paladin 2


It seems to actually work sometimes though, so you might have to give it a couple of tries.
 

Attachments

  • spell.w3x
    22.6 KB · Views: 231

Dameon

"All the power in the world resides in the eyes"
Reaction score
127
Try this out and tell me what you think.
This one was a little tricky cause a single trigger can only run so many actions before it kills it's self.
 

Attachments

  • spell altered.w3x
    22.2 KB · Views: 232

whoopwhoop

Cool Member
Reaction score
1
Try this out and tell me what you think.
This one was a little tricky cause a single trigger can only run so many actions before it kills it's self.

Wow, thanks this works really well! Too bad it's not as smooth as the other triggers, but this makes it looks like it's more of a struggle for the hero to pull them in. :p

Thank you!
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top