Page 1 of 3
Gun Capture Removal
Posted: Sat Jun 27, 2015 6:42 pm
by Marching Thru Georgia
The actual artillery capture code is not actually in the AI code. Where would the best place be to bypass this 'feature'? I want to replace this with a dead gun, or no gun at all.
Re: Gun Capture Removal
Posted: Sat Jun 27, 2015 7:39 pm
by mitra76
Is all in the hardcoded part; you can try, but I'm not sure if it works, to trigger the event eEvtDeath for the gun with TriggerEvent function when the cavalry is very near to the gun.
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 4:46 am
by Marching Thru Georgia
What are the values for evtid parameter in TriggerEvent?
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 9:39 am
by mitra76
set it to -1, it is not relevant in this case
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 6:05 pm
by Marching Thru Georgia
Assuming base.GetID() gives me the gun ID, this method does not seem to work. I even tried placing the TriggerEvent call at the top of CheckAllTargets. Suicide is not allowed? I can make the guns rout if the enemy comes within a certain distance but this is not an optimal solution. Any other ideas?
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 9:50 pm
by mitra76
You can try to use ModMorale ( int pts ) to set the zero the morale points, probably it will not avoid the capture but perhaps the gun will run away from the field also after the capture
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 9:58 pm
by Saddletank
I can make the guns rout if the enemy comes within a certain distance
How close can you make that? If its as little as 10 yards would that be good enough?
I'm thinking though that the gamedump then won't differentiate between routed guns and those 'routed' by capture.
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 10:23 pm
by mitra76
It depends from when the loop call the unit AI; you can check the getcharger to be sure to being charged but the aggressor can be at various distances and you cannot know how far it will be when the next check is done (the gun could be already captured).
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 11:15 pm
by Marching Thru Georgia
It depends from when the loop call the unit AI; you can check the getcharger to be sure to being charged but the aggressor can be at various distances and you cannot know how far it will be when the next check is done (the gun could be already captured).
Yes, this is what I have found. Setting the distance to 20 yds results in the guns being captured at least 50% of the time. That is not nearly good enough. It would be far better for NSD to just remove this ludicrous feature all together.
Re: Gun Capture Removal
Posted: Thu Jul 09, 2015 11:50 pm
by RebBugler
The actual artillery capture code is not actually in the AI code. Where would the best place be to bypass this 'feature'? I want to replace this with a dead gun, or no gun at all.
So, your request is to have guns 'surrender' and disappear rather than be 'captured' and manned, regardless of OOB structure?