Jump to content
Sign in to follow this  
Tanelorn

Using internal scripts for ammo replenishment

Recommended Posts

Hey there. As you may already know by reading my other post (multiple scripts in event handlers), I am trying to link my unit's weapons to an energy pool. This pool loses energy when weapons are fired, and equally replenishes weapons every time they fire. This is for high-energy weapons such as gun towers, artillery, etc.

I am doing this by using event handlers to call internal scripts that handle the behaviors. It works great! Except...

1. You must manually reload magazines as they are given to you.

2. The AI won't reload their replacement magazines. They sit there and never fire.

Wierd eh? I've done alot of research and I can't seem to overcome this problem. I use the "unit" ammo "magazinename" command to detect when the ammunition runs out. At that time I issue a new magazine if the energy pool has enough energy for it. But then I hit the problems listed above.

I have tried using the command :

myunit action ["MAGAZINE", "magazinename"]

This is supposed to make a unit reload his weapon, but it does nothing for AI or for live players. My magazine names are the same as my weapon names, so it's not a naming problem.

So close, but so far away...

Any ideas? Your help will be greatly appreciated.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×