Truble wit Triggers

  • Thread starter Thread starter Ninja_J
  • Start date Start date
N

Ninja_J

Guest
k... so i'm trying to modify "Charm" so it has a time limit. I did this:


E : Unit - A unit begins casting an ability

C : Soul Dictation Equal to Charm

A : Set targetedunit = (Target unit of ability being cast)
Set owneroftargetedunit = (Owner of targetedunit)
Set ownerofcaster = (Owner of (Casting unit))
Unit - Change ownership of targetedunit to ownerofcaster and Change color
Wait 15.00 seconds
Unit - Change ownership of targetedunit to owneroftargetedunit and Change color


i did this exactly and it wont work. Ownership doesnt change back... any tips?
 
Will you PLEASE stop making multiple topics?

:)

I mean it. I'll answer your question if you stick to the original topic.
 
It's alright.

Anyhow, I don't know what the issue is, but if you try running that trigger many times you'll overwrite the units because there is a friggin 15 minute wait. I'll see if I can come up with anything better.

BUT, for starters, can't you just use one variable?

E : Unit - A unit begins casting an ability

C : (ability being casted) Equal to Charm

A :
Set owneroftargetedunit = (Owner of (target unit of ability being cast))
Unit - Change ownership of (target unit of ability being cast) to (Owner of (casting unit)) and Change color
Wait 15.00 seconds
Unit - Change ownership of (target unit of ability being cast) to owneroftargetedunit and Change color

------

Probably won't fix the issue, but it will simplify your messy trigger.
 
You know, there should be an Event Response - Previous Owner.

You'd need a second trigger that upon unit changing owner and unit is a part of a unit group (to make sure that it doesn't ruin upon seeing another unit changing owner not via charm), you'd wait 15 minutes and then set it back to previous owner :)

(The other trigger stops at the action "add target unit of ability being cast to CharmedUnits" which would be after the conversion to the owner of casting unit. The second one, after taking 15 seconds, would take the unit off of CharmedUnits, just to be clean)

------

The other thing you can do is use custom values.

Unit - Set the custom value of (Target unit of ability being cast) to (Player number of (Owner of (Target unit of ability being cast)))

Then you would wait your time.

Unit - Change ownership of (Target unit of ability being cast) to (Player((Custom value of (Target unit of ability being cast)))) and Change color

And that would work. The only problem with this go is that then you can't use unit custom values for anything else.
 
Debug people comon put some thought into it. Whenever you have a problem .. debug.


Create some "Game - Display to all players the text (owneroftargetedunit)"
etc.. for each variable before AND after the 15 second wait.

This will allow you too see whats going on and figure out why its not working. Put some effort into it - its usally silly little mistakes like the wrong type of variable that make simple things not work.
 
right now it is

E : Unit begins casting spell

C : -spell- = charm

A : Change ownership of (target of ability being cast) to (Owner of (Casting unit)) and change color
Wait 15 sec
Change ownership of (target of ability being cast) to (Previous owner) and change color

still dont work
 
well, this is something i would use local variables just to be sure, but what you do is create a variable specifically for the owners of the units. Make it an array if you want.
Instead of previous owner, such and such, just use the variables. For example, for the second line, don't use target unit of ability being cast...use a variable that you set earlier. Now, theoretically you don't need the variable. However, its better to be on the safe side.
 
but when i had it on the variable thing, it didnt work... i dont see any diff this time
 
Did you do any debugging? Put some effort in if you want people to help you..

You will HAVE to use either variables or local variables for this too work, generally when you use a wait triggering unit and all that stuff are kindof reset, and its difficult to use them reliably.

Go back to the variables you were using, do some debugging and let us know what happens.

This will allow you to make sure that each variable is set to something, they probably are not for some reason which is probably why its not working.
 
yeah u probably think i'm frickin stupid but i dont know how/what debuggin is. explanation plz.
 
I did tell above in my other post :)

Use the text messages to debug. So after you have set your 3 variables, do 3 actions too see whats in the variables

Game - Display text to all players (variablename)

Do that for each variable, you will have to play with the text and note that the text you are writing must be of STRING type, so you may have to use things like Convert Real to String, Unit Name, Player Name etc.

Once you have 3 of these set up, copy and paste them to the position after your wait.

Now when you test the map and the spell you will get a text message when you cast it of whats in each variable, and again after the wait is up.

If any of these variables doesnt contain what units/players you think it should then you can narrow down what the problem is and try different things until it works, or at least we will be able to better help you out.

This is a good thing to do whenever you are having trouble too narrow the problem down, often you find a silly mistake like you used picked unit instead of matching unit, and all that.

Try that and let us know how you go.
 
i did something wrong because it doesnt display anything...


i used the trigger Game - Text Message (Auto-Timed)
Display to (All PLayers) the text : ownerofcaster-->(in value field)

did this for all variables.
copied and pasted after wait.

help plz.
 
Well if you're basing it off of charm, then you have some redundancy, as you said:
Code:
E : Unit begins casting spell

C : -spell- = charm

A : Change ownership of (target of ability being cast) to (Owner of (Casting unit)) and change color
Wait 15 sec
Change ownership of (target of ability being cast) to (Previous owner) and change color

If its based off of charm, then it will change ownership/color automatically. I suggest you base it off of some other spell, maybe channel, if you want it to work. At least take out first part ;) :P

And that " -spell- " means ability being cast right?
 
my question is how do u make it change back after a certain time limit?
 
General chit-chat
Help Users
  • No one is chatting at the moment.
  • The Helper The Helper:
    LOL! A tweak job!
  • The Helper The Helper:
    this is the fix I get from that yeah this is hard to control. disabling bots is pretty much necessary as ai and other bots would push really old threads to the top. reduce weight of view count. disable guest view tracking if you really want to push active threads to the top. a bit of tinkering for a few days with the weights and other settings should get you a decent trending widget box.
  • Ghan Ghan:
    I changed the settings a bit.
  • Ghan Ghan:
    Narrowed it to 7 days for the half-life and set views to 0 weight.
  • The Helper The Helper:
    I dont think Trending would work for this forum it would be better to just have the last 5 posts from anywhere
  • Ghan Ghan:
    Probably will have to give it some time to update.
  • Ghan Ghan:
    I'm guessing it is not retroactive.
  • Ghan Ghan:
    Next on the punch list: Update the server to Ubuntu 24.04.
  • The Helper The Helper:
    Mad Lads is new I see it displays original post date
  • The Helper The Helper:
    as long as it changes it is good - it is good now it updated and its new stuff
  • The Helper The Helper:
    One thing I have noticed and I dont know if it is by design but like 1 out of 3 times I come to the site the Anubis screen just hangs open, if I refresh it will go away but sometimes it hangs
  • Ghan Ghan:
    I've seen that as well.
  • The Helper The Helper:
    Wow - the change in the stats are major. I kind of knew it was all bots but wow, to see the effect. Why the social media sites cant do something like this I have no idea.
  • Ghan Ghan:
    Probably inflates their numbers so they look better to advertisers.
  • The Helper The Helper:
    Yeah google does not filter those bots. I remember when Apex was doing Google ads I saw the same IPs in there as I was seeing here - google is totally tracking all those bots as traffic and most google traffic, at least ours, was all bots
  • The Helper The Helper:
    oh wow, i bet i can post x links now and do the webp pics now giggity
  • The Helper The Helper:
    ahh anubis blocks anyone that has javascript turned off
  • The Helper The Helper:
    Robot: HTTP client library - i love the new robot :)
  • The Helper The Helper:
    New Science News Forum and it starts out with 420 threads :)
  • The Helper The Helper:
    Technical Support forum name changed To Technology News, there is now a Tech, sci/tech and science forums now :)
  • The Helper The Helper:
    Happy Saturday! Hope everyone has a fantastic weekend!
  • Ghan Ghan:
    We are now on Ubuntu 24.04. Had some issues with the style after the OS/PHP upgrade but now resolved.
    +1
  • Ghan Ghan:
    PHP 8.3 now live
    +1
  • The Helper The Helper:
    Weekend went by too fast. Next weekend I am going to try to do a nature thing - buddy of mine lives by the Colorado river and has some kayaks and invited me to do some kayaking from a place he knows to get on the river.
  • Ghan Ghan:
    That sounds like an adventure.

The Helper Discord

Members online

No members online now.

Affiliates

Hive Workshop NUON Dome World Editor Tutorials
Back
Top