[Data editor] Charge item with item

Eimtr

Member
Reaction score
1
[SOLVED] Charge item with item

I made an item that is Effects-based (the item data that allows you to set charges, Effect, etc), I set it to have say 5 starting out of 10 charges and pickable in inventory. I have another unit/item (the charger/ammo) also Effect-based with 1 charge. I want this charger item that also in inventory to be able to add 1 charge to the main item when the charger is used. It is ok this charger to be inventory item too and not a Powerup (Auto) because, it would be wasted if it were picked and auto-used without the weapon.

I read about Vulture Replenish Mine but it adds charge to an ability right? Not to an Effect as in my case, actually it should add to the Unit that is the pickable item. So how do I do that?

[SOLVED]
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
if you wanted to make it undroppable but give them ammo, you could create a behavior with no effects and no tooltip that is added 5 times whenever they pick the item up, and remove it every time they fire, that way it wouldnt even take an item slot, then you could display it with a progress bar dialog item displaying ammos
 

Eimtr

Member
Reaction score
1
Both the weapon and the charger are inventory items. Either dropping the weapon on the ground and targeting it with the charger item giving it +1 charge or even better - using the item in the inventory and giving the +1 charge to the weapon also in inventory, without having to target it. So a way to do that in data editor?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
sorry i dont think i can be of much help here unless you would like a dialog system displaying ammo
 

Eimtr

Member
Reaction score
1
I guess I will be forced to use triggers, others also couldn't help with that, like the Vulture Mine Replenish acts as a dummy ability, does nothing when you target another item, I could set charges after this ability is used through triggers. Thanks for trying to help.
 

Eimtr

Member
Reaction score
1
Umm no, but if it were an auto (powerup) would be pointless to auto use if the hero doesnt have the weapon in his inventory ^^ But if you mean picking the Ammo in the inventory then not being able to drop it and just use it within the inventory, im fine with that. But is there a way for that or you meant something else?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
i mean the ammo not being in your inventory at all, but saved as a variable displayed in a dialog
 

Eimtr

Member
Reaction score
1
You mean triggers or stored values? Either way if it will require the use of some non-data stuff I would go with the triggers, since Vulture replenish mine does nothing and with trigger I can make it add a charge to the target unit of the ability. Thanks anyway
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
tonight ill make a system and post it with what i was meaning...
 

Eimtr

Member
Reaction score
1
Ok but I decided to go with triggers, but unlike war3 I dont see a trigger that can set the charges of a unit, wow.. Is there an Action to do that?
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
sc2 can do every single thing that wc3 can do but more, a lot of times actions are burried in other actions, IE: instead of game text, you use dialog labels attached to the screen image
 

Siretu

Starcraft 2 Editor Moderator
Reaction score
293
Ok but I decided to go with triggers, but unlike war3 I dont see a trigger that can set the charges of a unit, wow.. Is there an Action to do that?

I haven't answered to this thread earlier because I personally find item charges and such to be very confusing. I've got it to work in Cruiser command now but it took a while. I wanted an automatic stacking system and some other functionality which was pretty hard to find. I found a library called "Item utility Library" that does a lot of nice stuff.

Link: http://www.sc2mapster.com/forums/re...ies/5636-library-galaxy-item-utility-library/

Exuvo(One of the other creators of Cruiser Command) then modified it to allow for different max charges on different item-types as well. I also had to add some special code so it adds charges directly if the inventory is full.

Have a look and see if it helps you.
 

Eimtr

Member
Reaction score
1
@Suretu
The library and the map has 2 triggers and nothing else, I didnt know how to use that library.Well I dont know how to use that library the creator said it is on GUI as well but do I need both? The map has almpst nothing I didnt see any instructions and what to do etc

UPDATE: SOLVED. So simple (because no one could find how to set charges with triggers too or didn't answer me...). So as I said I have inventory effect-based weapon and I want with effect-based inventory charges/ammo to add charges to the inventory weapon. The Charger item uses effect Vulture - Replenish Mines, which does nothing but with triggers, it does.

Since it is effect-based items, I use effect triggers:

Code:
Chrono Rift Charge
    Events
        Environment - Player Any Player uses Effect Vulture - Replenish Mines (Modify Mines charge count)
    Local Variables
    Conditions
        (Triggering Effect Unit Type(Target)) == Pickup - Chrono Rift Device
    Actions
        Unit - Add -1.0 charges used for charge "Item/PickupChronoRiftDevice" on unit (Triggering Effect Unit(Target))

Negative number adds charge DUH, positive removes it, since this action is to remove charge and there is no action to add one. You just take the charge "STRING" from the Link in Data Editor>Item tab>your item, see link under charge.

Because I wanted with my inventory item to target the inventory weapon on the ground, here is how. One can use any other Events, Items to add a charge to Unit. For example you may want to use powerup ammo not inventory item like me that adds instantly to the inventory weapon. The problem was - Is there a trigger that adds/takes out charges from unit not ability, and this is: Add Charge Used For Unit

That's what I wanted to do... I'm sure some are aware of the Action that increases charge but I thought I posted clear enough on Mapster, Hive, here. Thank you here for trying to help.
 

GFreak45

I didnt slap you, i high 5'd your face.
Reaction score
130
LOL of course... epic fail... pretty sure everyone here was looking at the big picture and not even looking at the minor details, which are important to the big picture
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top