blaschi / forgotten-hope-singleplayer

Automatically exported from code.google.com/p/forgotten-hope-singleplayer
0 stars 0 forks source link

AI cannot lay mines #80

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Never seen it anyway. I think the AI can do this in vanilla bf2, or at least in 
something like AIX2. The various mines do seem to have AI templates but I'm not 
seeing the behaviour.

Original issue reported on code.google.com by djbar...@djbarney.org on 5 Mar 2012 at 5:11

GoogleCodeExporter commented 9 years ago

Original comment by djbar...@djbarney.org on 6 Mar 2012 at 2:02

GoogleCodeExporter commented 9 years ago
FIX in progress: 

FH 2.4 does have templates for the GS Mk. V AT Mine ( 
http://forgottenhope.warumdarum.de/imagesfh2/weapons/GS%20Mk.%20V%20AT%20Mine/bi
g.jpg ) but the ai template ( 
mods\fh2\objects_weapons_server.zip\Weapons\Handheld\explosives\MarkVIMine\ai\ 
) has missing settings and zeroed out weighting values.

weaponTemplate.create Vi_Mine_AI
weaponTemplate.indirect 0
weaponTemplate.minRange 40.0
weaponTemplate.maxRange 50.0
weaponTemplate.optimalRangePercentage 100
weaponTemplate.setFiringPose Lying
weaponTemplate.setStrength Infantry 0.0
weaponTemplate.setStrength LightArmour  0.0
weaponTemplate.setStrength HeavyArmour  0.0
weaponTemplate.setStrength NavalArmour  0.0
weaponTemplate.setStrength Helicopter   0.0
weaponTemplate.setStrength AirPlane 0.0
weaponTemplate.setSoundSphereRadius 30.0

So I replaced with this template:

weaponTemplate.create Vi_Mine_AI
weaponTemplate.indirect 0
weaponTemplate.isThrown 1
weaponTemplate.minRange 10.0
weaponTemplate.maxRange 30.0
weaponTemplate.setStrength Infantry     0.0
weaponTemplate.setStrength LightArmour  5.0
weaponTemplate.setStrength HeavyArmour  5.0
weaponTemplate.setStrength NavalArmour  0.0
weaponTemplate.setStrength Helicopter   0.0
weaponTemplate.setStrength AirPlane     0.0
weaponTemplate.setSoundSphereRadius    30.0
weaponTemplate.setExplosionRadius 10.0
weaponTemplate.allowedDeviation 1.0
weaponTemplate.setFiresThroughTransparent 0
weaponTemplate.setFiresThroughTransparent 0

This appears to give the the Engineer class mine laying ability (see 
attachement) but I'm not sure if I just missed them doing this before (don't 
think I did) and I'm not so certain they are actually laying the mines. There 
is also a template at 
"mods\fh2\objects_weapons_server.zip\Weapons\Handheld\MarkVIMine\ai\" which may 
need adjusting.

Original comment by djbar...@djbarney.org on 6 Mar 2012 at 3:24

Attachments:

GoogleCodeExporter commented 9 years ago
If humans need to be prone to deploy these, so do bots.
Add back in 'weaponTemplate.setFiringPose Lying'
Don't think you should use this 'weaponTemplate.isThrown 1'.
This weapon uses SingleFireComp, not ThrownFireComp.

Original comment by evanthom...@gmail.com on 7 Mar 2012 at 6:53

GoogleCodeExporter commented 9 years ago
Cheers. Did that. Now bots seem to be laying mines. I can't confirm yet if they 
are actually exploding when a tank goes over them.

Original comment by djbar...@djbarney.org on 7 Mar 2012 at 1:28

GoogleCodeExporter commented 9 years ago
Nope. The above template may well work but it needs the correct kit name and ID 
index as this is hardcoded ...

"5 - at_mine - Cannot Be Changed Hard Coded to Engeneer -" ... Weapon/Kit Cheat 
Sheet - http://www.battlefieldsingleplayer.com/forum/index.php?showtopic=2279

So I need to try cloning the kit.

Original comment by djbar...@djbarney.org on 9 Mar 2012 at 7:35

GoogleCodeExporter commented 9 years ago
I don't quite understand.
The MarkVI is index 5, is being used by the Engineer class, and has it's own 
name.

Original comment by evanthom...@gmail.com on 10 Mar 2012 at 9:21

GoogleCodeExporter commented 9 years ago
Not sure I do either ATM. I misunderstood that forum post and thought it meant 
the "at_mine" name has to be in there because it's hardcoded, but AIX2 has a 
mine called "at4_mine" as well.

Comparing "objects_weapons_server.zip\Weapons\Handheld\" and 
"objects_weapons_server.zip\Weapons\Handheld\explosives\" most weapons in the 
explosives directory are not in the handheld directory. The MarkVIMine is in 
BOTH directories which I suspect has something to do with special FH behaviour 
on this weapon. The bots do use the Stick Bomb which has a SINGLE template in 
the explosives directory.

Can this be fixed by cloning the weapon for ai AND keeping the same 
functionality that is in MP and should be there for the single player ? I 
wonder if I'm facing the same decisions as present and former AI devs ? Some 
things have been left unfixed because fixing it would alter FH functionality 
too much in SP. Of course it may the case that a viable technical solution can 
still be worked out.

Original comment by djbar...@djbarney.org on 10 Mar 2012 at 1:01

GoogleCodeExporter commented 9 years ago
About the directory thing, somebody just forgot to delete the 'original' folder 
when they moved it.
Choose one and delete the whole folder.
It's just a f*ck up and does nothing to make the weapon special.
Make sure to back up your objects_weapons_server.zip beforehand for online 
purposes.

Original comment by evanthom...@gmail.com on 10 Mar 2012 at 11:45