Some annoying problems with a spell

shinami

Redirect your complaints to the nearest wall
Reaction score
47
So here are the 3 triggers with a spell that are making me confused.

Code:
Illusion cast
    Events
        Unit - A unit Begins channeling an ability
    Conditions
        (Ability being cast) Equal to (==) Illusions 
    Actions
        Set TriggeringUnit = (Triggering unit)
        Set UnitPointVariable[0] = (Position of (Triggering unit))
        Set OwnedUnit = (Owner of (Triggering unit))
        Trigger - Turn on Periodic Illusion <gen>
        Wait 10.00 seconds
        Trigger - Turn off Periodic Illusion <gen>

Code:
Periodic Illusion
    Events
        Time - Every 1.00 seconds of game time
    Conditions
    Actions
        Unit - Create 1 Dummy for OwnedUnit at UnitPointVariable[0] facing UnitPointVariable[0]
        Unit - Add Item Illusions to (Last created unit)
        Unit - Set mana of TriggeringUnit to ((Mana of TriggeringUnit) - 300.00)
        Custom script:   call IssueTargetOrderById(bj_lastCreatedUnit, 852274, udg_TriggeringUnit)
         Multiple FunctionsIf (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Mana of TriggeringUnit) Less than (<) 300.00
            Then - Actions
                Trigger - Turn off (This trigger)
                Unit - Order TriggeringUnit to Stop
            Else - Actions
        Custom script:   call RemoveLocation(udg_UnitPointVariable[0])

Code:
Stop Illusion
    Events
        Unit - A unit Stops casting an ability
    Conditions
        (Ability being cast) Equal to (==) Illusions 
    Actions
        Trigger - Turn off Periodic Illusion <gen>

So what this spell does is creates illusions every second for the cost of 300 mp. So first problem. My hero has 750 mp, and somehow he is only able to produce just one illusion, before his mp goes down to 150. How can i fix this?

Second problem.

Even if the hero has 1 mp, it will still produce an illusion, so all you have to do to abuse this is keep clicking the spell and you've got a billion of clones. My guess is i have to put on a condition somewhere that checkes if the unit has more or equal to 300, and if he doesn't cancel the effect, but i'm not sure so i want some advice.

I think thats it for the problems, i might encounter some more. +rep for help.

P.S Thanks to AceHart for the custom script that casts item illusions.
 

Exide

I am amazingly focused right now!
Reaction score
448
Add a condition to your Periodic trigger:
Code:
(Mana of TriggeringUnit) Greater than or equal to 300.00

-If the Hero has less mana, the trigger won't run, and no illusions will be spawned.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
Add a condition to your Periodic trigger:
Code:
(Mana of TriggeringUnit) Greater than or equal to 300.00

-If the Hero has less mana, the trigger won't run, and no illusions will be spawned.

Well that was simple, thanks, +rep. Anyone has ideas about the first problem?
 

Exide

I am amazingly focused right now!
Reaction score
448
Your first problem doesn't make sense. -Since the trigger states that only 300 mana is drained per second.
Unless, somehow, your Hero is stuck in the trigger twice..

Also, this seems pretty useless:
Code:
    Set OwnedUnit = (Owner of (Triggering unit))
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
Your first problem doesn't make sense. -Since the trigger states that only 300 mana is drained per second.
Unless, somehow, your Hero is stuck in the trigger twice..

Also, this seems pretty useless:
Code:
    Set OwnedUnit = (Owner of (Triggering unit))

Yes, it was, i did it because before doing the spell, i thought of an "imaginary" problem.

Anyway. I attached the map so You, or someone else who is experienced could take a look at this strange problem. ( Requires NewGen ^_^ )
 

Attachments

  • Map of Tests.w3x
    273.1 KB · Views: 85

emootootoo

Top Banana
Reaction score
51
You are setting a point variable when you cast the spell.

Then after the first time the periodic trigger goes off, you remove it. So next time it runs, there is no point. So it is not creating the dummy where you desire it to be.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
You are setting a point variable when you cast the spell.

Then after the first time the periodic trigger goes off, you remove it. So next time it runs, there is no point. So it is not creating the dummy where you desire it to be.

The second time it runs, the Illusion cast goes off which once again sets the variable... Well atleast i think thats how it is.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> The second time it runs, the Illusion cast goes off

Why would it?
That would mean the dummy casts the very same ability as your Hero... which 1. isn't possible here, 2. would lead to much bigger problems.


> making me confused

Understandable.
You have a variable with "variable" in the name... it's an array for no good reason.
There's a variable called "OwnedUnit" that is actually a player...

> Trigger - Turn off (This trigger)

The "stop" is already doing that.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
Not sure, maybe i said it wrong that you misunderstood it, but this is what i meant.

First time casting, runs the illusion cast trigger and setting the variable and then activates periodic trigger, removing the variable.

So in my logic, the second time i cast it the it goes into the same cycle. Illusion cast goes off, variable setted, periodic goes off , variable removed.

EDIT: There is a reason for the array.

One of your point is right, not sure why did i do the turning off. Ah yes i remember, the time i did the turn off trigger, i still haven't done the stop illusion trigger, so i did it for testing purposes, but when i did the stop trigger, i just forgot to remove it ^_^

Also the variable in the name doesn't do any harm.. Its just a name.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
> the second time i cast it the it goes into the same cycle

Well, yes.
Assuming you actually cast it.

Channeling, which this seems to be doing, only happens once though.
It's not continuously re-casting the spell while channeling. Otherwise this would fail miserably...
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
> the second time i cast it the it goes into the same cycle

Well, yes.
Assuming you actually cast it.

Channeling, which this seems to be doing, only happens once though.
It's not continuously re-casting the spell while channeling. Otherwise this would fail miserably...

Logical, yet the only failure so far i have here, or see here is my first problem of the spell. Also this spell is still not finished.

Also: OwnedUnit, well i know that its a player, this is not a spell for submission, OwnedUnit might not make sense to some people, but for me it does ^_^
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
Well, we could sit around here and argue about the weather or so, or you simply go and try to see what happens if you don't remove the point on every cast but only in the end instead.
Your going to try is presumably more productive.
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
Well, we could sit around here and argue about the weather or so, or you simply go and try to see what happens if you don't remove the point on every cast but only in the end instead.
Your going to try is presumably more productive.


The weather sucks. Anyway, that helped and the reason i didn't do it earlier because i didn't quite understand what you meant by in the end. Anyway i tried removing the variable removing and it works..

So now, by the end do you mean on the triggers Illusion Cast end?
 

emootootoo

Top Banana
Reaction score
51
You've had the answer to your problem since post #6... and then AceHart further explained it, and you still don't understand?

The reason it did not work is you were only creating the point once, when you began casting your heroe's ability.

So don't destroy the point until the ability is completely finished.

At the moment you are destroying it after the first illusion is created, and continue channeling.

(if you understood it, why would you need to ask that question?)
 

shinami

Redirect your complaints to the nearest wall
Reaction score
47
You've had the answer to your problem since post #6... and then AceHart further explained it, and you still don't understand?

The reason it did not work is you were only creating the point once, when you began casting your heroe's ability.

So don't destroy the point until the ability is completely finished.

At the moment you are destroying it after the first illusion is created, and continue channeling.

I understand it...

"At the end of illusion cast" was what i said. It was just a question to make sure, not other words to say " duuhhh i still not knows"
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • Ghan Ghan:
    Still lurking
    +3
  • 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

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top