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: 83

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,494
> 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,494
> 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,494
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
  • The Helper The Helper:
    Actually I was just playing with having some kind of mention of the food forum and recipes on the main page to test and see if it would engage some of those people to post something. It is just weird to get so much traffic and no engagement
  • The Helper The Helper:
    So what it really is me trying to implement some kind of better site navigation not change the whole theme of the site
  • Varine Varine:
    How can you tell the difference between real traffic and indexing or AI generation bots?
  • The Helper The Helper:
    The bots will show up as users online in the forum software but they do not show up in my stats tracking. I am sure there are bots in the stats but the way alot of the bots treat the site do not show up on the stats
  • Varine Varine:
    I want to build a filtration system for my 3d printer, and that shit is so much more complicated than I thought it would be
  • Varine Varine:
    Apparently ABS emits styrene particulates which can be like .2 micrometers, which idk if the VOC detectors I have can even catch that
  • Varine Varine:
    Anyway I need to get some of those sensors and two air pressure sensors installed before an after the filters, which I need to figure out how to calculate the necessary pressure for and I have yet to find anything that tells me how to actually do that, just the cfm ratings
  • Varine Varine:
    And then I have to set up an arduino board to read those sensors, which I also don't know very much about but I have a whole bunch of crash course things for that
  • Varine Varine:
    These sensors are also a lot more than I thought they would be. Like 5 to 10 each, idk why but I assumed they would be like 2 dollars
  • Varine Varine:
    Another issue I'm learning is that a lot of the air quality sensors don't work at very high ambient temperatures. I'm planning on heating this enclosure to like 60C or so, and that's the upper limit of their functionality
  • Varine Varine:
    Although I don't know if I need to actually actively heat it or just let the plate and hotend bring the ambient temp to whatever it will, but even then I need to figure out an exfiltration for hot air. I think I kind of know what to do but it's still fucking confusing
  • The Helper The Helper:
    Maybe you could find some of that information from AC tech - like how they detect freon and such
  • Varine Varine:
    That's mostly what I've been looking at
  • Varine Varine:
    I don't think I'm dealing with quite the same pressures though, at the very least its a significantly smaller system. For the time being I'm just going to put together a quick scrubby box though and hope it works good enough to not make my house toxic
  • Varine Varine:
    I mean I don't use this enough to pose any significant danger I don't think, but I would still rather not be throwing styrene all over the air
  • The Helper The Helper:
    New dessert added to recipes Southern Pecan Praline Cake https://www.thehelper.net/threads/recipe-southern-pecan-praline-cake.193555/
  • The Helper The Helper:
    Another bot invasion 493 members online most of them bots that do not show up on stats
  • Varine Varine:
    I'm looking at a solid 378 guests, but 3 members. Of which two are me and VSNES. The third is unlisted, which makes me think its a ghost.
    +1
  • The Helper The Helper:
    Some members choose invisibility mode
    +1
  • The Helper The Helper:
    I bitch about Xenforo sometimes but it really is full featured you just have to really know what you are doing to get the most out of it.
  • The Helper The Helper:
    It is just not easy to fix styles and customize but it definitely can be done
  • The Helper The Helper:
    I do know this - xenforo dropped the ball by not keeping the vbulletin reputation comments as a feature. The loss of the Reputation comments data when we switched to Xenforo really was the death knell for the site when it came to all the users that left. I know I missed it so much and I got way less interested in the site when that feature was gone and I run the site.
  • Blackveiled Blackveiled:
    People love rep, lol

      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