IPB

Welcome Guest ( Log In | Register )

weapons.ai code value for aiming binoculars, Does anyone know what they are named in the .con file
mapbear
post Apr 21 2017, 06:31 AM
Post #1


Captain
***

Group: Soldiers
Posts: 38
Joined: 30-August 16
From: Denmark
Member No.: 11,762



I am trying to locate a .con file for the temperature data for the aiming-binoculars used by the assault-class.
I have realized that this item is the reason for the 'rotating-bot' bug, and need to disable it for bot-use, but i cant find the weapons.ai file, because i dont know what they are called
does anyone know?
Does a list of Object's internal variable names exists?


--------------------
Best Regards!
Go to the top of the page
 
+Quote Post
 
Start new topic
Replies (1 - 12)
MasterChiefRulZ
post Apr 21 2017, 01:41 PM
Post #2


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,421
Joined: 31-December 03
From: Home
Member No.: 48



I fixed rotating bot bug in my personal AIX mod by changing temperature values in the weapons specific AI files. Do the binoculars have an AI file in it's own folders?

If you're interested in a thorough explanation of what I did, I discussed it here ...

(from the "List of Important Modding Threads" Sticky)...

My infantry bots sometimes spin, is there a fix?


--------------------
Go to the top of the page
 
+Quote Post
mapbear
post Apr 22 2017, 08:44 AM
Post #3


Captain
***

Group: Soldiers
Posts: 38
Joined: 30-August 16
From: Denmark
Member No.: 11,762



Thanks for link -Appreciated

QUOTE (MasterChiefRulZ @ Apr 21 2017, 01:41 PM) *
Do the binoculars have an AI file in it's own folders?

That is exactly the problem!
I cant find a folder for the aiming-binoculars, so i suspect they are called something weird, but i have NO idea what that could be smile.gif


--------------------
Best Regards!
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Apr 22 2017, 01:20 PM
Post #4


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,421
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE (mapbear @ Apr 22 2017, 10:44 AM) *
Thanks for link -Appreciated

QUOTE (MasterChiefRulZ @ Apr 21 2017, 01:41 PM) *
Do the binoculars have an AI file in it's own folders?

That is exactly the problem!
I cant find a folder for the aiming-binoculars, so i suspect they are called something weird, but i have NO idea what that could be smile.gif

If you can't find the binoculars because they are named something else, check the kit's TWEAK files in the kits folder of Objects_server.zip. Go to a kit that you know has the binoculars and check to see what all is assigned in the kit. Easy process of elimination. Once you figure out what it's named...


Open the Binocular's TWEAK file with notepad...


Hit "Ctrl + h" on your keyboard (without the quotations)


Type "AI" in the search field (without the quotations)


Should take you directly to the AI if it has one.


If it doesn't have one, assign your own by examining binoculars TWEAK file from another mod (like AIX) and copy/paste the necessary line of code. Then of course add your own AI folder complete with AI file (again using AIX or another working binocular folder as an example).


--------------------
Go to the top of the page
 
+Quote Post
mapbear
post Apr 24 2017, 11:00 AM
Post #5


Captain
***

Group: Soldiers
Posts: 38
Joined: 30-August 16
From: Denmark
Member No.: 11,762



QUOTE (MasterChiefRulZ @ Apr 22 2017, 01:20 PM) *
If you can't find the binoculars because they are named something else, check the kit's TWEAK files in the kits folder of Objects_server.zip. Go to a kit that you know has the binoculars and check to see what all is assigned in the kit. Easy process of elimination. Once you figure out what it's named...


Objects_server.zip does not exists in p4f
I have the folder in bf2

but..

This is strange..
I can find a file named us_binocular.con
That file content
CODE
GeometryTemplate.create BundledMesh us_binocular
      CollisionManager.createTemplate us_binocular
      
      ObjectTemplate.create GenericFireArm us_binocular
      ObjectTemplate.saveInSeparateFile 1
      ObjectTemplate.creator "SatNav"
      ObjectTemplate.collisionMesh us_binocular
      ObjectTemplate.mapMaterial 0 Rubber 0
      ObjectTemplate.hasCollisionPhysics 1
      ObjectTemplate.physicsType 3
      ObjectTemplate.geometry us_binocular
      
      include us_binocular.tweak


I can also find a file named us_binocular.tweak
That file content
CODE
rem *** Generated with Bf2Editor.exe [created: 2006/1/4 7:47]
      GeometryTemplate.setSpecularStaticGloss 0 0 0 5
      GeometryTemplate.setSpecularStaticGloss 1 0 0 0.15
      GeometryTemplate.compressVertexData 1
      GeometryTemplate.maxTextureRepeat 16
      ObjectTemplate.setNetworkableInfo HandFireArmsInfo
      ObjectTemplate.saveInSeparateFile 1
      ObjectTemplate.preCacheObject 1
      ObjectTemplate.activeSafe GenericFireArm us_binocular
      ObjectTemplate.creator DSU-1:dsu
      ObjectTemplate.modifiedByUser "SatNav"
      ObjectTemplate.saveInSeparateFile 1
      rem ---BeginComp:WeaponHud ---
      ObjectTemplate.createComponent WeaponHud
      ObjectTemplate.weaponHud.weaponIcon Ingame\Weapons\Icons\Hud\USLMG_M249SAW.tga
      rem ObjectTemplate.weaponHud.altWeaponIcon Ingame\Weapons\Icons\Hud\USLMG_M249SAW_mini.tga
      ObjectTemplate.weaponHud.specialAbilityIcon Ingame\Weapons\Icons\Hud\SpecialKitIcons\laserpainter.tga
      ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\us_binocs.tga
      ObjectTemplate.weaponHud.guiIndex 0
      ObjectTemplate.weaponHud.altGuiIndex 216
      ObjectTemplate.weaponHud.hasRangeFinder 1
      rem ---EndComp ---
      rem ---BeginComp:SingleFireComp ---
      ObjectTemplate.createComponent SingleFireComp
      ObjectTemplate.fire.addFireRate 2
      ObjectTemplate.fire.addFireRate 0
      ObjectTemplate.fire.fireInCameraDof 1
      rem ---EndComp ---
      rem ---BeginComp:SoldierDeviationComp ---
      rem ---EndComp ---
      rem ---BeginComp:DefaultSoundComp ---
      ObjectTemplate.createComponent DefaultSoundComp
      rem ---EndComp ---
      rem ---BeginComp:DefaultAnimationComp ---
      ObjectTemplate.createComponent DefaultAnimationComp
      rem ---EndComp ---
      rem ---BeginComp:DefaultZoomComp ---
      ObjectTemplate.createComponent DefaultZoomComp
      ObjectTemplate.zoom.zoomDelay 0.08
      ObjectTemplate.zoom.zoomLod 1
      ObjectTemplate.zoom.addZoomFactor 0
      ObjectTemplate.zoom.addZoomFactor 0.4
      ObjectTemplate.zoom.addZoomFactor 0.2
      ObjectTemplate.zoom.disableMuzzleWhenZoomed 1
      rem ObjectTemplate.zoom.changeFovDelay 0.1
      rem ---EndComp ---
      rem ---EndComp ---
      ObjectTemplate.geometry us_binocular
      ObjectTemplate.setCollisionMesh us_binocular
      ObjectTemplate.mapMaterial 0 Rubber 102
      ObjectTemplate.floaterMod 0
      ObjectTemplate.hasMobilePhysics 0
      ObjectTemplate.hasCollisionPhysics 1
      ObjectTemplate.physicsType Mesh
      rem -------------------------------------
      ObjectTemplate.addTemplate S_us_binocular_Fire1P
      ObjectTemplate.addTemplate S_us_binocular_Fire1P_Outdoor
      ObjectTemplate.addTemplate S_us_binocular_Fire3P
      ObjectTemplate.addTemplate S_us_binocular_BoltClick
      ObjectTemplate.addTemplate S_us_binocular_TriggerClick
      ObjectTemplate.addTemplate S_us_binocular_SwitchFireRate
      ObjectTemplate.addTemplate S_us_binocular_Reload1P
      ObjectTemplate.addTemplate S_us_binocular_Reload3P
      ObjectTemplate.addTemplate S_us_binocular_Deploy1P
      ObjectTemplate.addTemplate S_us_binocular_Deploy3P
      ObjectTemplate.addTemplate S_us_binocular_Zoom
      rem -------------------------------------
      ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/simrad/AnimationSystem1p.inc
      ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/simrad/AnimationSystem3p.inc
      ObjectTemplate.keepProjectiles 5
      ObjectTemplate.velocity 1000
      ObjectTemplate.itemIndex 7
      ObjectTemplate.delayToUse 0.958
      
      
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Fire1P
      ObjectTemplate.modifiedByUser "SatNav"
      
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Fire1P_Outdoor
      ObjectTemplate.modifiedByUser "SatNav"
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Fire3P
      ObjectTemplate.modifiedByUser "SatNav"
      
      
      ObjectTemplate.activeSafe Sound S_us_binocular_BoltClick
      ObjectTemplate.modifiedByUser "SatNav"
      
      ObjectTemplate.activeSafe Sound S_us_binocular_TriggerClick
      ObjectTemplate.modifiedByUser "SatNav"
      
      ObjectTemplate.activeSafe Sound S_us_binocular_SwitchFireRate
      ObjectTemplate.modifiedByUser "SatNav"
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Reload1P
      ObjectTemplate.modifiedByUser "SatNav"
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Reload3P
      ObjectTemplate.modifiedByUser "SatNav"
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Deploy1P
      ObjectTemplate.modifiedByUser "SatNav"
      
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Deploy3P
      ObjectTemplate.modifiedByUser "SatNav"
      
      
      ObjectTemplate.activeSafe Sound S_us_binocular_Zoom
      ObjectTemplate.modifiedByUser nfe


However there is no ai folder for us-binoculars, and then ofcause no weapons.ai file either



I can open a different file inside the weapons.ai folder. f.i.
weapons/stationary/usass_stinger/ai

Here i find exactly what i wants for the binoculars, but for the stinger ..ofcause:
CODE
rem *** coaxial Browning Machine Gun ***
      weaponTemplate.create StingerWeapon
      weaponTemplate.indirect 0
      weaponTemplate.minRange 10.0
      weaponTemplate.maxRange 250.0
      weaponTemplate.weaponActivate PINone
      weaponTemplate.weaponFire PIAltFire
      weaponTemplate.setStrength Infantry     0.0
      weaponTemplate.setStrength LightArmour  0.0
      weaponTemplate.setStrength HeavyArmour  0.0
      weaponTemplate.setStrength NavalArmour  0.0
      weaponTemplate.setStrength Helicopter  20.0
      weaponTemplate.setStrength AirPlane    15.0
      weaponTemplate.allowedDeviation 3.0
      weaponTemplate.setFiresThroughTransparent 0


My question now is:
Do i have to write a new weapons.ai file for binoculars?
Like:

CODE
rem *** aiming binoculars ***
      weaponTemplate.create aimingBinocularsWeapon
      weaponTemplate.indirect 0
      weaponTemplate.minRange 100.0
      weaponTemplate.maxRange 1250.0
      weaponTemplate.weaponActivate PINone
      weaponTemplate.weaponFire PIAltFire
      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
    
    rem all usage disabled for all bots
    
      weaponTemplate.allowedDeviation 3.0
      weaponTemplate.setFiresThroughTransparent 0


If so, what should i call this file in order to make p4f 'see' it, and use the settings?
I am quite baffled that there is no existing file for the existing weapon defened in the .con file


Shouldent there be a perfect match, and that weapons.ai file would be the one that actually works inside the game.
eg, The .con file-name isent that the internal variable used by the game?

OR!
Can i add the block with .setStrength directly in the .tweak-file ?

Sorry, this now is a long post.. I cant grasp how this 'works'







This post has been edited by mapbear: Apr 24 2017, 11:10 AM


--------------------
Best Regards!
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Apr 24 2017, 04:16 PM
Post #6


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,421
Joined: 31-December 03
From: Home
Member No.: 48



Seeing that these binoculars have no AI file then the AI shouldn't even use it. To the AI the binocus essentially don't even exist.

What reasoning brought you to the conclusion that the binoculars were the source of AI spinning? headscratch.gif

At this point I wouldn't attempt to add AI to it, unless of course you just want AI look at enemies through binoculars instead of shooting at them. tongue.gif


--------------------
Go to the top of the page
 
+Quote Post
mapbear
post Apr 27 2017, 10:18 AM
Post #7


Captain
***

Group: Soldiers
Posts: 38
Joined: 30-August 16
From: Denmark
Member No.: 11,762



QUOTE (MasterChiefRulZ @ Apr 24 2017, 04:16 PM) *
Seeing that these binoculars have no AI file then the AI shouldn't even use it. To the AI the binocus essentially don't even exist.

Exactly! But they apparently still open slot 6, and access the item inside this slot, but have NO 'idea' of using it, so they freeze and go into spin. I think that is the error.
QUOTE
What reasoning brought you to the conclusion that the binoculars were the source of AI spinning? headscratch.gif

Observation of a bot spinning with the item in hands
(For now i have seen spinning bots with binocular and claymore)

QUOTE
At this point I wouldn't attempt to add AI to it, unless of course you just want AI look at enemies through binoculars instead of shooting at them. tongue.gif

Here i think you misunderstand my intend. I want to set the use-possibility to 0.0 for all classes, so picking the binocular, should be emediately followed by picking a new item, they should never try to use it.

The actual flow in the descission tree for the AI is 'likely' to be sumthing like
CODE
repeat
* Thread observed
* is item in hand useable against this thread?
** y) Use item
** n) switch to next item
until 1

The bot would then get to an item that could inflict damage on the thread, or be killed, but opening slot 6 (binoculars) is a dead end

I will experiment -look at some .ai files and see if i can come up with something, but any pointers is highly appreciated.


--------------------
Best Regards!
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post Apr 27 2017, 09:24 PM
Post #8


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,421
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE
Observation of a bot spinning with the item in hands
(For now i have seen spinning bots with binocular and claymore)

From what information I've been presented it's my understanding that it's impossible for a bot to use an item with no AI attached. For example if a bot enters a vehicle not prepared for AI the game instantly crashes (documented). With this in mind an item in inventory should either be completely ignored by AI or cause the game to crash.

My theory is that this item is something else with AI attached and the AI is causing the spinning behavior. I don't have the latest BFP4Free mod version so I'm shooting in the dark here.. I don't have the bandwidth to use to get it either so.. uhm.gif

Question... Is there a "SIMRAD" in the mod? That's a device that looks like binoculars. It's been used in several BF2 mods and allows for different uses (like calling in airstrikes and what not).


I see you're poking around in the core AI code... Careful, things can really get messy if code is tweaked in poor ways. The slightest turn could induce a ripple effect that can complicate matters exponentially. I've seen some weird bot behaviors with core AI tweaks that I don't normally see in vanilla (default) BF2 with unaltered core AI. ph34r.gif


--------------------
Go to the top of the page
 
+Quote Post
mapbear
post May 3 2017, 08:31 AM
Post #9


Captain
***

Group: Soldiers
Posts: 38
Joined: 30-August 16
From: Denmark
Member No.: 11,762



QUOTE (MasterChiefRulZ @ Apr 27 2017, 09:24 PM) *
Question... Is there a "SIMRAD" in the mod? That's a device that looks like binoculars. It's been used in several BF2 mods and allows for different uses (like calling in airstrikes and what not).


ahhh.. SIMRAD..
What i call aiming-bonculars IS used to call airstrike!
I have managed to get screenie of what i believe is the aiming-binoculars in the hand of spinning hunchbacked bots.
Is that gadget in-game named a SIMRAD?


If that is a SIMRAD then i have been calling it a binocular, and it is this item in this screenie, that bots should be prevented to use, because they just spin with it smile.gif

QUOTE
I see you're poking around in the core AI code... Careful, things can really get messy if code is tweaked in poor ways.

I always keep a version-controlled roll-back series, so i can get back to functional copy of the file, but big thank you for the heads-up!


--------------------
Best Regards!
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post May 4 2017, 07:44 AM
Post #10


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,421
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE
Is that gadget in-game named a SIMRAD?

Yes. Look in the files for simrad. smile.gif


--------------------
Go to the top of the page
 
+Quote Post
mapbear
post May 5 2017, 07:34 AM
Post #11


Captain
***

Group: Soldiers
Posts: 38
Joined: 30-August 16
From: Denmark
Member No.: 11,762



QUOTE (MasterChiefRulZ @ May 4 2017, 07:44 AM) *
Yes. Look in the files for simrad. smile.gif

-Thanks..
Would you believe it
SIMRAD has no AI folder either..
Wierd blink.gif
So what i think happens is that bots can access slot 6, but bots cant use content in slot 6, so they spin

_______________

So i added a new folder 'ai', and i wrote a Weapons.ai for this SIMRAD
Fired p4f up and expected a hollow hush crash.
No crash smile.gif
I also only saw one bot spinning, but that was with a phosphor-granade.
Overall i would say i saw less bot spinning when i looked at the map, but seing 'less' is a very dubious observation..
anywhich here is the script i use as Weapons.ai

CODE
rem ***SIMRAD bot logic added By MK_Miday ***
weaponTemplate.create SIMRAD_dsr
weaponTemplate.indirect 0
weaponTemplate.minRange 30.0
weaponTemplate.maxRange 1500.0
weaponTemplate.optimalRangePercentage 90
weaponTemplate.setFiringPose Lying
rem pos is rubish cause they are not suppose to use it at all:
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


This post has been edited by mapbear: May 5 2017, 11:14 AM


--------------------
Best Regards!
Go to the top of the page
 
+Quote Post
kano
post May 5 2017, 09:14 AM
Post #12


Major
Group Icon

Group: BFSP Team
Posts: 252
Joined: 20-April 06
From: Belmont, New Hampshire, USA.
Member No.: 1,704



CODE
rem *** Add SIMRAD ***
weaponTemplate.create SIMRADAI
weaponTemplate.indirect 0
weaponTemplate.minRange 20.0
weaponTemplate.maxRange 80.0
weaponTemplate.optimalRangePercentage 80
weaponTemplate.setFiringPose Lying
weaponTemplate.setStrength Infantry    0.0
weaponTemplate.setStrength LightArmour 1.0
weaponTemplate.setStrength HeavyArmour 2.0
weaponTemplate.setStrength NavalArmour 0.0
weaponTemplate.setStrength Helicopter  0.0
weaponTemplate.setStrength AirPlane    0.5
weaponTemplate.setSoundSphereRadius   60.0
weaponTemplate.allowedDeviation 0.1


--------------------
Go to the top of the page
 
+Quote Post
MasterChiefRulZ
post May 5 2017, 10:40 AM
Post #13


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,421
Joined: 31-December 03
From: Home
Member No.: 48



QUOTE (mapbear @ May 5 2017, 09:34 AM) *
QUOTE (MasterChiefRulZ @ May 4 2017, 07:44 AM) *
Yes. Look in the files for simrad. smile.gif

-Thanks..
Would you believe it
SIMRAD has no AI folder either..
Wierd blink.gif
So what i think happens is that bots can access slot 6, but bots cant use content in slot 6, so they spin

So it's indeed Simrad in slot 6 of the spec ops soldier? The item would have to be listed in the kit file of the bot in that pic you posted. We do have the correct item here?

QUOTE
no AI folder either

Is the Simrad using a different AI folder, the AI of something else? What is the AI assignment in the TWEAK file of the Simrad? Is there any?

An option for a fix:

Kano has kindly offered you a custom AI you can use yourself. Just create an AI folder, using the default BF2 AI weapon folders as a guide, and copy/paste what Kano has provided into the custom AI file you make. Then Assign this AI to the Simrad(?) in it's TWEAK file.


--------------------
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 19th October 2017 - 11:10 PM