Hi there! Been around here for a bit and you guys really got some good tutorials that helped me cut down the time it took to get used to the GE! :D I've been messing around lots trying to learn the Data Editor in particular, and recently tried to create a weapon that needs to reload after the ammo count is used up.
I based of the design from the Ghost's Nuke Calldown ability, since that was the ability I've seen so far in-game with any usage of ammo. Everything works except for the fact that if I have more than one unit using the ability, they all share the same ammo count! This means that if I press the reload button on unit A, unit B will also have access to that same 10 ammo without reloading (both units are exactly the same). I realize this is likely the case since that's how Nukes work (all Ghosts share the same Nuke count), but how can I make it that each unit will have an individual ammo count?
Create:
Ammo variable
HaveAmmo Buff/Behavior
Shooting Skill
Set it up so that in order to use the shoot skill the character needs to have the HaveAmmo buff applied.
When ever you use the skill set up a trigger to decrease the Ammo variable by one.
When the Ammo variable reaches one, take the HaveAmmo buff off of the unit.
The issue with a global variable is that it seems like he may want this ammo limit to apply to multiple generic units, rather than specific ones. Unless he makes a huge array, with a parallel array of IDs and indexes, to keep track of every unit and its individual ammo count and ammo type...
Maybe this could use an individual unit's Custom Value somehow? If the units didn't use Energy, then having each attack decrement Energy (a la Point Defense Drone) might be a good solution.
Well, I quickly got it to work soon after I posted this :P I looked through at how the Carrier's Train Interceptor ability worked and compared it to the Nuke's and that did the trick. The thing I found the hard way after 12+ hours of experimenting is that the Attack ability ignores requirements if it's the AI that does the scanning. i.e. if the Attack button is greyed out, you can't attack any unit, but if you move within range of an enemy unit, it will start attacking by itself! This seems to be the only issue with the Attack ability though.
I wanted to use no triggers if possible for it, but it seems like I have to anyway at this rate. Thanks a lot guys! :D
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Hi there! Been around here for a bit and you guys really got some good tutorials that helped me cut down the time it took to get used to the GE! :D I've been messing around lots trying to learn the Data Editor in particular, and recently tried to create a weapon that needs to reload after the ammo count is used up.
I based of the design from the Ghost's Nuke Calldown ability, since that was the ability I've seen so far in-game with any usage of ammo. Everything works except for the fact that if I have more than one unit using the ability, they all share the same ammo count! This means that if I press the reload button on unit A, unit B will also have access to that same 10 ammo without reloading (both units are exactly the same). I realize this is likely the case since that's how Nukes work (all Ghosts share the same Nuke count), but how can I make it that each unit will have an individual ammo count?
Hope you guys understand my problem :P
Create:
Ammo variable
HaveAmmo Buff/Behavior
Shooting Skill
Set it up so that in order to use the shoot skill the character needs to have the HaveAmmo buff applied.
When ever you use the skill set up a trigger to decrease the Ammo variable by one.
When the Ammo variable reaches one, take the HaveAmmo buff off of the unit.
The issue with a global variable is that it seems like he may want this ammo limit to apply to multiple generic units, rather than specific ones. Unless he makes a huge array, with a parallel array of IDs and indexes, to keep track of every unit and its individual ammo count and ammo type...
Maybe this could use an individual unit's Custom Value somehow? If the units didn't use Energy, then having each attack decrement Energy (a la Point Defense Drone) might be a good solution.
Well, I quickly got it to work soon after I posted this :P I looked through at how the Carrier's Train Interceptor ability worked and compared it to the Nuke's and that did the trick. The thing I found the hard way after 12+ hours of experimenting is that the Attack ability ignores requirements if it's the AI that does the scanning. i.e. if the Attack button is greyed out, you can't attack any unit, but if you move within range of an enemy unit, it will start attacking by itself! This seems to be the only issue with the Attack ability though.
I wanted to use no triggers if possible for it, but it seems like I have to anyway at this rate. Thanks a lot guys! :D