Problems with items

Kildare

New Member
Reaction score
7
Hey guys, i'm having a little problem with Item usage here. I've managed to get everything done(item Containers, classes, etc) but i can't seem to get the item to use its ability.

Basically what i want to do here is that when the player clicks on the item, it will make the item's holder use an ability. Can someone help me with this? Thanks.
 

Kildare

New Member
Reaction score
7
Actually, to be honest i'm not entirely sure whether i did the right thing. How exactly does one attach an ability to an item anyway? I can only see Effects and Behaviours in the Item data but nothing about actors or abilities.
 

XxMayhemxX

New Member
Reaction score
6
How are you wanting it to work..
use the ability when you click on the item in the inventory?
or
when the item is in the inventory, then add a command button for its ability?

if you use the command card, then you could maybe make an ability for it, and a command button, then have a trigger so when you have item in inventory, then it shows up on your command card? idk .. just brainstormin
 

Kildare

New Member
Reaction score
7
No i just want it to like cast a spell when i click/use the item in the inventory.

EDIT: Think Warcraft III Spell Items.

EDIT2: To be precise, what i actually want to do is to detect the ability cast from the item via triggers.(Example: Unit starts the effects of an Ability - (Item Ability), then Do Actions) The problem now is no matter what i do the ability won't trigger. I'm not sure where the ability is supposed to be "placed" in the item data.
 

Dave312

Censored for your safe viewing
Reaction score
269
Under behaviors there is a type called 'Click Response'. I reckon you will need to attach that behavior type to the item and then attach the ability's effect to the behavior. I was trying to test whether I was right however I seem to be stuck in creating an item that I can actually place.
 

Kildare

New Member
Reaction score
7
OK, but how would triggers DETECT that behaviour/effect? As far as i can see there's no Event that detects whether a behaviour or effect is triggered.
 

Dave312

Censored for your safe viewing
Reaction score
269
Why do you need to use triggers? The whole idea behind this Data Editor is so you don't need to use triggers.
 

XxMayhemxX

New Member
Reaction score
6
ummm probably because he wants to set up a trigger so something else happens when ability is used

you realize how trigs work right? they are powerful ways to make stuff happen...
stuff that couldnt possibly otherwise happen on their own...

Could you make a powerful, multiple, if then else statement in data editor? no...

you can set up all the correct data fields for the item and the ability all you want...

...but your not gonna get the effect he want thru any data field...
you cant script in the data editor tho

of course he hasnt told us exactly what he wants to do other then detect WHEN its being used... that has trigger written all over it...
 

XxMayhemxX

New Member
Reaction score
6
i made a new item.. with equip behavior of cloak...

now i made a trigger...

Untitled Trigger 001
Events
Unit - (Item carried by (Triggering unit) in slot 3) uses Ghost - Cloak (Ghost) at Generic1 - Any stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Transmission - Send transmission to (All players) from (Unit with Flash (Do Not override portrait) playing Talk) playing No Sound Link with name Name and message "Ahh the item works perfectly" using (Cinematic portrait (Center Left)) playing Talk (Add 0.0 seconds, Don't Wait until it finishes)


what this will do is whenever the item in item slot 3 uses toggle Cloak(which i can toggle by clicking on the item) i'll get the transmission "Ahh, the item works perfectly..."

I placed the Event in bold and in Events, it's called Unit Uses Ability, then you double click on Any Unit, and select Item Carried In Slot



You can set up what the item does thru Data.. but to do what he wants to do, which is an action when the item does what it does, he's gonna need a trigger...
 

Kildare

New Member
Reaction score
7
So, correct me if i'm wrong, i"ll need to put a separate event(within the same trigger of course) to detect the item from each available slot? hmm...


Well, actually the original problem i had is that the item won't trigger the ability it contains, no matter what i did with the data values. So the problem here isn't so much the triggers, but getting the item to cast the spell i want it to. That's why i asked how you put abilities into an item, because i don't know how to exactly. So how did put the ability into the item?(Let's say a spell/ability that targets self, meaning it won't require you to choose a target and casts instantly)

I know this may be slightly confusing but please bear with me. =/

EDIT: Ok to avoid further confusion i should just tell you a general idea of what i want to do. Basically i want a trigger to detect whenever a certain item is being "used" so that i can give certain attributes or perform a certain action. Think of it as something like when a player chooses what equipment he wants to equip, and i give the "effects" via triggers instead of through item data.
 

XxMayhemxX

New Member
Reaction score
6
yeah i get it.. like say your wearing a robe of invisibility.. and whenever you have the item.. your always cloaked.. like an aura...

Except you want it to work when you click on it, instead of just having it..
 
Reaction score
54
So, correct me if i'm wrong, i"ll need to put a separate event(within the same trigger of course) to detect the item from each available slot? hmm...


Well, actually the original problem i had is that the item won't trigger the ability it contains, no matter what i did with the data values. So the problem here isn't so much the triggers, but getting the item to cast the spell i want it to. That's why i asked how you put abilities into an item, because i don't know how to exactly. So how did put the ability into the item?(Let's say a spell/ability that targets self, meaning it won't require you to choose a target and casts instantly)

I know this may be slightly confusing but please bear with me. =/

EDIT: Ok to avoid further confusion i should just tell you a general idea of what i want to do. Basically i want a trigger to detect whenever a certain item is being "used" so that i can give certain attributes or perform a certain action. Think of it as something like when a player chooses what equipment he wants to equip, and i give the "effects" via triggers instead of through item data.

If you are going use these events a lot, you may want to create a new event definition.

What do you want the item to do? Basically, you just have to put the desired effect under the effect field of the item. (You did base the item on Default Effect Item, right?)

Abilities cause effects. Items cause effects. Items do not cause abilities.
 

Kildare

New Member
Reaction score
7
Well, basically for me the item itself doesn't actually do anything(effects-wise). I just want the trigger to detect if a certain item is used, then it will trigger a certain action. Basically this has something to do with "equipping". For instance, i have an item titled "Machine Guns". When i "use"(or equip) that item, my unit will now have equipped a "Machine Gun".

The problem here is that the item data values only registers Effects, and not abilities. And the triggers don't detect effects, but abilities. So you must understand my confusion here. ><
 

Kildare

New Member
Reaction score
7
No! I don't want weapons! Don't misunderstand me about the "equipping" part. That was just an example. Basically this is what i want to do in simple trigger format:

Event: Unit uses an ability/item
Condition: If item/ability used == Machine Guns
Action:
Set WeaponEquipped = "Machine Guns"

I'm not actually giving the unit a Machine Gun attack. i just want to set it so that a variable keeps track of the unit as a unit armed with a machine gun. This will obviously lead on to other triggers that make use of that.
 
Reaction score
54
Kildy,

you can give your units a dummy Machine Guns weapon and later check if they have it with Unit Weapon condition check.

All this is doing is moving your data from your global variables to the actual units, please don't get mad.

Edit: You could also apply a Buff, Machine Guns Enabled, if the idea of adding more weapons to the unit irritates you.
 

XxMayhemxX

New Member
Reaction score
6
i made a new item.. with equip behavior of cloak...

now i made a trigger...

Untitled Trigger 001
Events
Unit - (Item carried by (Triggering unit) in slot 3) uses Ghost - Cloak (Ghost) at Generic1 - Any stage (Ignore shared abilities)
Local Variables
Conditions
Actions
Transmission - Send transmission to (All players) from (Unit with Flash (Do Not override portrait) playing Talk) playing No Sound Link with name Name and message "Ahh the item works perfectly" using (Cinematic portrait (Center Left)) playing Talk (Add 0.0 seconds, Don't Wait until it finishes)


what this will do is whenever the item in item slot 3 uses toggle Cloak(which i can toggle by clicking on the item) i'll get the transmission "Ahh, the item works perfectly..."

I placed the Event in bold and in Events, it's called Unit Uses Ability, then you double click on Any Unit, and select Item Carried In Slot



You can set up what the item does thru Data.. but to do what he wants to do, which is an action when the item does what it does, he's gonna need a trigger...

I still would use this trigger and add another action in it which sets a global(not local)variable... Gun equipped
you can make another trigger which changes the variable -1 or whatever when you toggle the item off(unequip gun) so depending on what the variable is, other triggers will be able to look at the variable Gun Equipped and see if its 0 or 1 (equiped or unequiped)
 

Kildare

New Member
Reaction score
7
Ancanus: I'm not mad lol, just slightly flustered. ><

Well, i did thought of that after you told me about the solution but it still doesn't solve the problem that i can't use triggers to detect when an item is used(if i'm not doing it for an "equip" detect trigger).

Mayhem: I'll play around with your solution and i'll see what i can get out of it.

Thanks for the help guys. ><
 
Reaction score
54
I'll try to elaborate.

You give your item Machine Guns, an Apply Buff effect. This will apply a buff called Machine Guns Enabled.

When an unit uses your item, you can detect this with the event: Unit Attribute Points Change, with the condition Triggering Behaviour == Machine Guns Enabled.

Edit: Just a sec, producing a test map.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      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