i want to make a trigger so that when some one buys a item from a shop it will give them the ability
but they can keep the item in case they want to sell the item and don't click me a different item that also uses the same spell adding trigger.
Add ability
Moderator: Cheaters
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Add ability
Alright..forgive me if im not understanding fully, but basically you want a trigger, that makes it so when a unit acquires an item, they get a spell. And you want the same trigger to work with multiple items and abilities..If not, then please clarify.
Anyways, what i got, i did on a whim, which took no longer than 5 minutes..Its not the most compact..and i dont know if it even works..dont see why it shouldn't though..
Well, basically your looking at two triggers, the first one to give the spell, the second to take it away. It will all be running on one variable array. So first you should create a variable, name it whatever you want, in my case i chose items. Make the type integer, and the size should be however many items your gonna use.
Now, just make one if/than/else and copy it for the rest of your items, ive shown it done for two. The variable is to determine if you already have the spell or not. Wouldn't want you to get the same spell twice, or remove something that you dont even have.
The integer between brackets should be changed for every item, 0 to start with and to whatever number of items you end with, and the 1 and 0 are for determining if you have it or not. Im probably making this sound much harder than it really is..just follow the examples below.
First trigger.
Second Trigger.
Like i said, i made it fast and didn't test it..So i'd appreciate feedback to whether it works or not. If it doesn't work ill tweak it or even remake it if it comes to that.
Anyways, what i got, i did on a whim, which took no longer than 5 minutes..Its not the most compact..and i dont know if it even works..dont see why it shouldn't though..
Well, basically your looking at two triggers, the first one to give the spell, the second to take it away. It will all be running on one variable array. So first you should create a variable, name it whatever you want, in my case i chose items. Make the type integer, and the size should be however many items your gonna use.
Now, just make one if/than/else and copy it for the rest of your items, ive shown it done for two. The variable is to determine if you already have the spell or not. Wouldn't want you to get the same spell twice, or remove something that you dont even have.
The integer between brackets should be changed for every item, 0 to start with and to whatever number of items you end with, and the 1 and 0 are for determining if you have it or not. Im probably making this sound much harder than it really is..just follow the examples below.
First trigger.
Spoiler:
Spoiler:
-
- Junior Member
- Posts: 34
- Joined: August 12th, 2008, 9:35 pm
Re: Add ability
Sorry for bad explanation.
k i tried it and it did work
but i made some changes.
(don't click me or pick up)
(sell or drop)
I had changed it a little and it worked but i was wondering if there was a way to stop it from resetting the cool down when a person drops the item and picks it up.
k i tried it and it did work
but i made some changes.
(don't click me or pick up)
Spoiler:
Spoiler:
-
- Forum Staff
- Posts: 506
- Joined: November 17th, 2008, 3:49 pm
Re: Add ability
I..hadent thought of that..lol err..wonder if its possible to make the item undroppable for a short time after the spell is used...well unless your using spells with a reallyyy long cooldown...but i dont think most people would use a spell, then immediately drop the item besides getting out of the cooldown...ill see if i can figure something out.
Btw, did the trigger not work with the variable or was it just easier to make this way? Cause without that, if you pick up two items of the same type, dont they give you two spells?
Edit : Just after i posted, i opened WE and took a look..it should be easy to do..but it will mean one more trigger to manage lol ill post it after im done with it.
Edit 2 : So..that was quite easy..sorry as i know really no other way for the cooldown to stick. This..should work..it will just be a little inconvienent if your using buffing spells since you cant switch items quickly.
Btw, did the trigger not work with the variable or was it just easier to make this way? Cause without that, if you pick up two items of the same type, dont they give you two spells?
Edit : Just after i posted, i opened WE and took a look..it should be easy to do..but it will mean one more trigger to manage lol ill post it after im done with it.
Edit 2 : So..that was quite easy..sorry as i know really no other way for the cooldown to stick. This..should work..it will just be a little inconvienent if your using buffing spells since you cant switch items quickly.
Spoiler:
-
- Junior Member
- Posts: 34
- Joined: August 12th, 2008, 9:35 pm
Re: Add ability
i took the variable out because i thought it would be fine with out
yes it worked you just have to set the wait time to spell cooldown
just changed the wait time to the spell cool down
thanks for the help works fine now.
yes it worked you just have to set the wait time to spell cooldown
Spoiler:
thanks for the help works fine now.