Hero has items in slots, create new item.

Husky

Local Lurker
Reaction score
120
I haven't mapped in years and I was playing around with the editor a bit for the first time, so bear with me.

What I want is; "If a unit has item X in slot 1, and item Y in slot 2 and then USES item X (in slot 1) it adds item Z to the hero's inventory"

Code:
    Events
        Unit - A unit Uses an item
    Conditions
        (Item being manipulated) Equal to (Item carried by (Hero manipulating item) of type |cffffcc00Bundle of Sticks|r)
        |cffffcc00Bundle of Sticks|r 0000 <gen> Equal to (Item carried by (Hero manipulating item) in slot 1)
        |cffffcc00Tinder|r 0004 <gen> Equal to (Item carried by (Hero manipulating item) in slot 2)
    Actions
        Hero - Give (Item carried by (Hero manipulating item) of type Fireplace) to (Hero manipulating item)

That was what I had, but it didn't work. Re-familiarise me! :p
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Event:
- A unit uses an item
Conditions:
- Item type of (Item being manipulated) equal to "item 1"
- ((Triggering unit) has item of type "item 1") equal to true (optional, given you just now used it...)
- ((Triggering unit) has item of type "item 2") equal to true
Actions:
- Hero - Create "item 3" for (Triggering unit)

You probably also want to remove items 1 and 2.
And, why limit people to one particular slot? That's annoying at best.
 

Husky

Local Lurker
Reaction score
120
Thanks Ace.

And the slot thing was to avoid collisions, otherwise players would be getting items they didn't want... or is there a way around that?
 

Husky

Local Lurker
Reaction score
120
What kind of "collisions"?

For example:

Wood + Stone = Building 1
Wood + Stone + Clay = Building 2

Say if the player had all 3 of those items in their inventory and used "wood", it may create building 1 instead of building 2 (but that player wanted building 2, not 1) for the reason that both buildings use Wood and Stone.

I may be wrong, but this was the assumption I got.


EDIT: Hmm, your trigger didn't work either. Hold on, let me fiddle.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> but that player wanted building 2, not 1

And, what if he wanted 1 and got 2 instead?
Seems like there's some need for a better plan here...

> Hold on ...

While waiting for you to post yours?
 

Husky

Local Lurker
Reaction score
120
Code:
    Events
        Unit - A unit Uses an item
    Conditions
        (Item-type of (Item being manipulated)) Equal to |cffffcc00Bundle of Sticks|r
        ((Triggering unit) has an item of type |cffffcc00Bundle of Sticks|r) Equal to True
        ((Triggering unit) has an item of type |cffffcc00Tinder|r) Equal to True
    Actions
        Hero - Create Fireplace and give it to (Triggering unit)

That was my version.

AceHart said:
Seems like there's some need for a better plan here...

It's a bit hard to explain, but the system does work. There may be an alternative, better system but I've yet to discover it. Feel free to shoot ideas.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
> That was my version.

Ok...
And, what exactly is "it doesn't work"? Nothing? Wrong item? Crash? A random cat died? Your food started moving on its own?
 

Husky

Local Lurker
Reaction score
120
> That was my version.

Ok...
And, what exactly is "it doesn't work"? Nothing? Wrong item? Crash? A random cat died? Your food started moving on its own?

As in, nothing happened. I used the item and... nada. No '3rd' item.
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,494
Hm...

You made sure the unit actually has those items?
You can use "item 1"? As in, it does have some active ability?
It's not charged and removed because it's now out of charges?
No cats hurt? Damn... well, better luck next time.
 

Husky

Local Lurker
Reaction score
120
You made sure the unit actually has those items? - Yeah, placed them right in front of him.

You can use "item 1"? As in, it does have some active ability? - This is probably it. You can 'click' the item, but nothing active happens. I thought all you needed was the 'click' and you'd be good to go. Seems not.

It's not charged and removed because it's now out of charges? - No.

No cats hurt? Damn... well, better luck next time. - No cats ;) . Dogs though? Well...
 
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