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


Private
**

Group: Soldiers
Posts: 32
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 - 6)
MasterChiefRulZ
post Apr 21 2017, 01:41 PM
Post #2


You know the drill...
Group Icon

Group: Mr. Admin
Posts: 10,278
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


Private
**

Group: Soldiers
Posts: 32
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,278
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


Private
**

Group: Soldiers
Posts: 32
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,278
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 Today, 10:18 AM
Post #7


Private
**

Group: Soldiers
Posts: 32
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

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: 27th April 2017 - 10:52 AM