What I need is items that have charges for ammo. Each time the weapon is fired the charge decreases. This charge has to be consistent for the item even if it is drop, transfer to someone else, and what have you.
Can this be done through the data editor?
I'll also need to be able to transfer charged from “ammo” items to the players equipped weapon item but I'm guessing that will have to be done through triggers.
I mean for the weapon itself I guess. I want the items charge to indicate how much ammo is left and for the weapon to stop fireing if it is depleated. So far as I know whether or not the weapon has the charges to fire has to be based on the items charges, because players in my map need to be able to drop their weapon item to let other people use it.
I’ve done alittle bit of experimenting and if I give the weapon a limited charge, it sticks with that unit even if a different gun item is picked up. Also, since the weapon’s charge is decreasing and not the items, there is no visual indication of how much ammo left. While I might could fix that with triggers, it doesn’t let me have multiple of the same gun item, each with its own individual ammo amount.
All I need is for the items charge to decrease AS IF the weapon was an ability. I noticed some sort of “link” function thing in the same area as were charges are set. I haven’t figured out how it works but I might could use it to link the items charges with the weapons charges? Anyone know anything about that?
This would be a lot easier to do using triggers, since 'stacking' inventory items is hard enough to achieve in itself. I would imagine that 1 bullet does not take up an entire inventory slot, and that you can stack maybe 60 of them at once. In this scenario, you should use the Unit Custom Value as a variable (either on the weapon item itself, since it is a unit) or on the hero unit himself. When he attacks, you subtract 1 from the custom value, when it's at 0, you disable the attack, and when he uses his reload ability, you remove 60 of the item from his inventory, and add 60 to the custom value of the weapon. Alternatively, you subtract 1 'magazine' item from his inventory, and add 60 to the custom value of the weapon, after reloading the 'disable attack' behaviour should be removed also.
If he were to shoot a bit, then drop the weapon, it would have the custom value (ie: number of bullets left in the magazine) stored dependently to the weapon.
I am trying to do basically the same thing. I want an item to act as "ammo" and every time the hero with it equipped attacks a charge gets depleted. For now i'm going to try and do it with triggers, but i really want to do it with the data editor so i don't have dozens of triggers getting fired every second.
Could you not do it by simply giving the weapon a chain of two modify unit effects? Have the one cost 1 charge from your item and on impact do like the vulture spider mine replenish and increase the charge of your gun by 1. The items also could give a behavior that has an initial effect of transfering one charge.
Rollback Post to RevisionRollBack
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
Attack is an ability just like any other, many abilities have costs....Why not modify the attack ability for each unit and give them an individual cost (Such as a charge)? that part should be easy,
You can have items that restore charges...they exist in the campaign (The hybrid mission), you can copy them for the attack ability you've given your unit.
Dropping the charges for someone else to pick up...I don't know.
@ DrSuperEvil Thanks for the quick response, Unfortunately i cannot see how to lower an items charge through modify unit, if i could do that i would be set.
I guess using a behavior to transfer item charges to a weapon would be a less direct approach but i don't know what kind of behavior that is either.
sorry for being such a noob I'm still pretty new to the data editor.
I don't care about magazines or weapon charges, what i really want to do is make a weapon attack deplete an items charges.
@Quirriff I'm ok with the idea of using weapon charges but i want to be able to reflect the remaining charges to an item. This isnt for standard ammunition its a unique idea for an rpg where you can equip one item wich allows you to use that item specific ability until the charges run out, after that you've learned the ability permanantly. Theres more to it than that but right now i'm so confused if this is going to work i'm thinking of writing the whole thing with triggers. bye bye optimized game performance.
Also does anyone know how to set item charges with triggers?
Many thanks again for the quick responses.
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
What I need is items that have charges for ammo. Each time the weapon is fired the charge decreases. This charge has to be consistent for the item even if it is drop, transfer to someone else, and what have you.
Can this be done through the data editor? I'll also need to be able to transfer charged from “ammo” items to the players equipped weapon item but I'm guessing that will have to be done through triggers.
@LeinadNightSky: Go
TBH it would just be easier to do the whole thing via triggers
@LeinadNightSky: Go
The weapon itself has charges or do you mean an ability on the item?
If its ability on the item you can can make the item of type ability, and then on the ability set the charges to be used
If its weapon charges then you can just make a generic type item, set its equip weapon to your weapon, and in that weapon set the
charges used and max charges in weapon costs
I mean for the weapon itself I guess. I want the items charge to indicate how much ammo is left and for the weapon to stop fireing if it is depleated. So far as I know whether or not the weapon has the charges to fire has to be based on the items charges, because players in my map need to be able to drop their weapon item to let other people use it.
I’ve done alittle bit of experimenting and if I give the weapon a limited charge, it sticks with that unit even if a different gun item is picked up. Also, since the weapon’s charge is decreasing and not the items, there is no visual indication of how much ammo left. While I might could fix that with triggers, it doesn’t let me have multiple of the same gun item, each with its own individual ammo amount.
All I need is for the items charge to decrease AS IF the weapon was an ability. I noticed some sort of “link” function thing in the same area as were charges are set. I haven’t figured out how it works but I might could use it to link the items charges with the weapons charges? Anyone know anything about that?
Thanks
Bump
This would be a lot easier to do using triggers, since 'stacking' inventory items is hard enough to achieve in itself. I would imagine that 1 bullet does not take up an entire inventory slot, and that you can stack maybe 60 of them at once. In this scenario, you should use the Unit Custom Value as a variable (either on the weapon item itself, since it is a unit) or on the hero unit himself. When he attacks, you subtract 1 from the custom value, when it's at 0, you disable the attack, and when he uses his reload ability, you remove 60 of the item from his inventory, and add 60 to the custom value of the weapon. Alternatively, you subtract 1 'magazine' item from his inventory, and add 60 to the custom value of the weapon, after reloading the 'disable attack' behaviour should be removed also.
If he were to shoot a bit, then drop the weapon, it would have the custom value (ie: number of bullets left in the magazine) stored dependently to the weapon.
Bump.
I am trying to do basically the same thing. I want an item to act as "ammo" and every time the hero with it equipped attacks a charge gets depleted. For now i'm going to try and do it with triggers, but i really want to do it with the data editor so i don't have dozens of triggers getting fired every second.
Could you not do it by simply giving the weapon a chain of two modify unit effects? Have the one cost 1 charge from your item and on impact do like the vulture spider mine replenish and increase the charge of your gun by 1. The items also could give a behavior that has an initial effect of transfering one charge.
Contribute to the wiki (Wiki button at top of page) Considered easy altering of the unit textures?
https://www.sc2mapster.com/forums/resources/tutorials/179654-data-actor-events-message-texture-select-by-id
https://media.forgecdn.net/attachments/187/40/Screenshot2011-04-17_09_16_21.jpg
Attack is an ability just like any other, many abilities have costs....Why not modify the attack ability for each unit and give them an individual cost (Such as a charge)? that part should be easy,
You can have items that restore charges...they exist in the campaign (The hybrid mission), you can copy them for the attack ability you've given your unit.
Dropping the charges for someone else to pick up...I don't know.
@ DrSuperEvil Thanks for the quick response, Unfortunately i cannot see how to lower an items charge through modify unit, if i could do that i would be set. I guess using a behavior to transfer item charges to a weapon would be a less direct approach but i don't know what kind of behavior that is either. sorry for being such a noob I'm still pretty new to the data editor. I don't care about magazines or weapon charges, what i really want to do is make a weapon attack deplete an items charges.
@Quirriff I'm ok with the idea of using weapon charges but i want to be able to reflect the remaining charges to an item. This isnt for standard ammunition its a unique idea for an rpg where you can equip one item wich allows you to use that item specific ability until the charges run out, after that you've learned the ability permanantly. Theres more to it than that but right now i'm so confused if this is going to work i'm thinking of writing the whole thing with triggers. bye bye optimized game performance.
Also does anyone know how to set item charges with triggers? Many thanks again for the quick responses.