[Data editor] Charge item with item

Eimtr

Member
[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.
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
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.
sorry i dont think i can be of much help here unless you would like a dialog system displaying ammo
 

Eimtr

Member
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
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.
i mean the ammo not being in your inventory at all, but saved as a variable displayed in a dialog
 

Eimtr

Member
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
 

Eimtr

Member
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.
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
Staff member
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
@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.
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.
  • Ghan Ghan:
    Test!
  • tom_mai78101 tom_mai78101:
    I must be in a test server.
  • tom_mai78101 tom_mai78101:
    Nice, Twitter tweets embedding now works
  • Wizard Wizard:
    Yup.
  • Ghan Ghan:
    Excellent.
  • Ghan Ghan:
    @tom_mai78101 Hello there.
  • Ghan Ghan:
    Tagging works in the chat too.
  • tom_mai78101 tom_mai78101:
    @Ghan Missed it.
  • Wizard Wizard:
    Still fixing things here and there. Added widgets to the portal, will make it match the ones here on the forum index tomorrow.
  • Ghan Ghan:
    The venerable World Editor Tutorials site has been converted to HTTPS at last.
  • jonas jonas:
    cool
  • jonas jonas:
    and I can even edit my messages, nice
  • seph ir oth seph ir oth:
    GENERAL CHIT CHAT, YOU ARE A BOLD ONE
  • Ghan Ghan:
    Hello there
  • The Helper The Helper:
    this new chatbox is great and the forum software update is great too
    +1
  • The Helper The Helper:
    upgrade has fixed forum registration spam problem
  • tom_mai78101 tom_mai78101:
    Something tells me we might be able to customize the chatbox a bit, considering that there's a gap under every message.
  • Wizard Wizard:
    Going to deploy a fix soon, just had to take some time for myself this weekend.
  • Varine Varine:
    Unbelievable. Time for yourself? How dare you!
  • Wizard Wizard:
    xD
  • tom_mai78101 tom_mai78101:
    Hm, it is now harder to type anything on an Android phone. Pressing Backspace or Enter keys will dismiss the Android keyboard for some reasons.
  • tom_mai78101 tom_mai78101:
    Just noticed there's a delay of at least 2 minutes before each post. Guess I can't post Headline News quickly as I used to.
  • tom_mai78101 tom_mai78101:
    As far as I can tell, there are definitely things I need to get accustomed to first.
  • Varine Varine:
    FCC is cracking down recently

    Members online

    No members online now.

    Affiliates

    Hive Workshop
    Top