I'm making an ammo system and I wanted to know what kinds of things I needed linked in Data for it to work and if I should also be using triggers and not just all in data.
You could probably do it in Data, but I used triggers. Just make a trigger that removes the ammo every time the unit attacks, and checks if the clip they have is empty. If it is then disable their attack for X seconds as a reload, then restore their clip (if they have any left).
Pretty sure I've seen Reload time in the data weapons as well as magazine data assets. So there should be a way to do it all in data editor to speed up performance. But if not triggering would be fine if not every unit on your map has an ammo using weapon.
You would need to set the arm magazine Infor - Manage field to destroy then. Charges on the weapon which is replenished using a Modify Unit effect to replenish the charges would be simpler.
Well I was trying to make it for like a marine has 1 magazine with 50 bullets in it and I wanted it to reload 1 magazine but use the bullets for the actual need to reload, like I fire 50 shots then it has to reload and then gets the 50 bullets back and I wanted to run it fully in data because of the speed and reliability of data, but if I can't I guess I could use triggers as well.
I'm making an ammo system and I wanted to know what kinds of things I needed linked in Data for it to work and if I should also be using triggers and not just all in data.
@x0oo0: Go
You could probably do it in Data, but I used triggers. Just make a trigger that removes the ammo every time the unit attacks, and checks if the clip they have is empty. If it is then disable their attack for X seconds as a reload, then restore their clip (if they have any left).
Could always use charges and a spidermine replenish like ability to reload.
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
Pretty sure I've seen Reload time in the data weapons as well as magazine data assets. So there should be a way to do it all in data editor to speed up performance. But if not triggering would be fine if not every unit on your map has an ammo using weapon.
To see how ammo works in data, look at the Carrier. Instead of making interceptors then make the unit that's your missile.
You would need to set the arm magazine Infor - Manage field to destroy then. Charges on the weapon which is replenished using a Modify Unit effect to replenish the charges would be simpler.
eg. Vulture - Replenish Mines (Modify Mines charge count)
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
Well I was trying to make it for like a marine has 1 magazine with 50 bullets in it and I wanted it to reload 1 magazine but use the bullets for the actual need to reload, like I fire 50 shots then it has to reload and then gets the 50 bullets back and I wanted to run it fully in data because of the speed and reliability of data, but if I can't I guess I could use triggers as well.
Simple enough 50 charges and a requirement/validator that needs it to have none left to recharge.
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