Page 1 of 1

[?] SIMRAD Missile?

Posted: 2010-08-08 09:40
by Meehow818
Hey guys Ive created a SIMRAD that when on a click a missile starts behind the player (making it look like it has been fired by a jet or any other vehicle (eg:UCAV) and comes down where is wanted. On fire an air raid siren sounds and about 6 seconds later a missile flies by and hits any target.

My question to the MODDING community is that i have to keep the simrad aimed at the target i cant click and let it hit where ive clicked I would really like it to hit where i hav clicked instead of me standing up and keeping the simrad "locked" on a target.

Any help would be appreciated.

Re: SIMRAD Missile

Posted: 2010-08-08 10:27
by Rhino
Check the vBF2 attack chopper, "TV missile" code, then do the same thing except dont have a camera on the missile.

Re: SIMRAD Missile

Posted: 2010-08-08 12:10
by Meehow818
do u hav a piece of tweak?

i found this..........

rem ---EndComp ---
rem ---BeginComp:LPTargetComp ---
ObjectTemplate.createComponent LPTargetComp
ObjectTemplate.target.maxDistance 9999
ObjectTemplate.target.setTargetAtMaxDistance 1
ObjectTemplate.target.targetSystem TSTVGuided
ObjectTemplate.target.useCameraDirectionToTarget 1
ObjectTemplate.target.targetObjectTemplate UniqueTarget
ObjectTemplate.target.disableFireWhenActiveMissile 1
ObjectTemplate.target.disableGuidanceOnReload 0
ObjectTemplate.target.disableGuidanceOnReload 0
rem ---EndComp ---

Re: SIMRAD Missile

Posted: 2010-08-08 18:35
by Sniperdog
Meehow818 wrote:do u hav a piece of tweak?

i found this..........

rem ---EndComp ---
rem ---BeginComp:LPTargetComp ---
ObjectTemplate.createComponent LPTargetComp
ObjectTemplate.target.maxDistance 9999
ObjectTemplate.target.setTargetAtMaxDistance 1
ObjectTemplate.target.targetSystem TSTVGuided
ObjectTemplate.target.useCameraDirectionToTarget 1
ObjectTemplate.target.targetObjectTemplate UniqueTarget
ObjectTemplate.target.disableFireWhenActiveMissile 1
ObjectTemplate.target.disableGuidanceOnReload 0
ObjectTemplate.target.disableGuidanceOnReload 0
rem ---EndComp ---
Try this. Sadly this method might not work for hand held weapons as I dont know if you can have a mouse enabled in a hand held weapon. Worth a try though.


add to the hud component of the weapon:

Code: Select all

ObjectTemplate.weaponHud.crosshairIcon Ingame\GeneralIcons\empty.dds
ObjectTemplate.weaponHud.crosshairIconSize 64
ObjectTemplate.weaponHud.enableMouse 1
the fire component of the weapon:

Code: Select all

rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.busyUntilButtonRelease 1
rem ---EndComp ---
The target component of the weapon:

Code: Select all

rem ---BeginComp:LPTargetComp ---
ObjectTemplate.createComponent LPTargetComp
ObjectTemplate.target.maxDistance 9999
ObjectTemplate.target.setTargetAtMaxDistance 1
ObjectTemplate.target.targetSystem TSTVGuided
ObjectTemplate.target.targetObjectTemplate UniqueTarget
ObjectTemplate.target.disableFireWhenActiveMissile 1
ObjectTemplate.target.disableGuidanceOnReload 0
rem ---EndComp ---
The seek component of the projectile:

Code: Select all

rem ---BeginComp:SeekClosestTargetComp ---
ObjectTemplate.createComponent SeekClosestTargetComp
ObjectTemplate.seek.targetType TTUnique
ObjectTemplate.seek.trackingDelay 0.01
ObjectTemplate.seek.maxAngleLock 360
ObjectTemplate.seek.maxDistLock 9999
ObjectTemplate.seek.reLockTime 0
rem ---EndComp ---
Add to the weapon hud:

Code: Select all

hudBuilder.createObjectSelectionNode             {Parent Node Name} {Child Name (you choose)} 368 268 64 64
hudBuilder.setObjectSelectionNodePointerSize     64 64 
hudBuilder.setNodeLogicShowVariable              EQUAL GuiIndex {GUI # here}
Also be aware that when the weapon loads a new magazine it will disable guidance unless you define a rate of fire which can hold off the mag reload until the ROF time for that bullet has passed.

Re: SIMRAD Missile

Posted: 2010-08-09 07:39
by Meehow818
mine looks like this:

GeometryTemplate.compressVertexData 1
GeometryTemplate.maxTextureRepeat 16
ObjectTemplate.activeSafe GenericFireArm simrad
ObjectTemplate.saveInSeparateFile 1
ObjectTemplate.castsDynamicShadow 1
ObjectTemplate.cullRadiusScale 10
ObjectTemplate.modifiedByUser M.Meehow
rem ---BeginComp:WeaponHud ---
ObjectTemplate.createComponent WeaponHud
ObjectTemplate.weaponHud.specialAbilityIcon Ingame\Weapons\Icons\Hud\SpecialKitIcons\laserpainter.tga
ObjectTemplate.weaponHud.selectIcon Ingame\Weapons\Icons\Hud\Selection\simrad.tga
ObjectTemplate.weaponHud.hudName "PredatorMissile"
ObjectTemplate.weaponHud.guiIndex 0
ObjectTemplate.weaponHud.altguiIndex 1
ObjectTemplate.weaponHud.hasFireRate 0
ObjectTemplate.weaponHud.showClips 1
ObjectTemplate.weaponHud.hasRangeFinder 1
ObjectTemplate.weaponHud.secondLockSound HUD_TargetLock1
rem ---EndComp ---
rem ---BeginComp:SingleFireComp ---
ObjectTemplate.createComponent SingleFireComp
ObjectTemplate.fire.addFireRate 0
ObjectTemplate.fire.fireInCameraDof 1
ObjectTemplate.fire.busyUntilButtonRelease 2
ObjectTemplate.fire.projectileStartPosition 500/400/-900
ObjectTemplate.fire.batchSize 1
rem ---EndComp ---
rem ---BeginComp:LPTargetComp ---
ObjectTemplate.createComponent LPTargetComp
ObjectTemplate.target.maxDistance 9999
ObjectTemplate.target.setTargetAtMaxDistance 1
ObjectTemplate.target.targetSystem TTUnique
ObjectTemplate.target.targetObjectTemplate UniqueTarget
ObjectTemplate.target.disableGuidanceOnReload 1
ObjectTemplate.target.connectionEffectOnlyWhenZoomed 1
rem ---EndComp ---
rem ---BeginComp :D efaultAmmoComp ---
ObjectTemplate.createComponent DefaultAmmoComp
ObjectTemplate.ammo.nrOfMags -1
ObjectTemplate.ammo.magSize 1
ObjectTemplate.ammo.reloadTime 18
rem ---EndComp ---
rem ---BeginComp:SoldierBasedRecoilComp ---
ObjectTemplate.createComponent SoldierBasedRecoilComp
rem ---EndComp ---
rem ---BeginComp:SoldierDeviationComp ---
ObjectTemplate.createComponent SoldierDeviationComp
ObjectTemplate.deviation.minDev .333
ObjectTemplate.deviation.subProjectileDev 0.8
ObjectTemplate.deviation.setFireDev .7 .7 .009
ObjectTemplate.deviation.setTurnDev 4 .3 .3 .1
ObjectTemplate.deviation.setSpeedDev 1 1 1 .005
ObjectTemplate.deviation.setMiscDev 20 20 .15
ObjectTemplate.deviation.devModStand 1.8
ObjectTemplate.deviation.devModCrouch 1.2
ObjectTemplate.deviation.devModLie 1.0
ObjectTemplate.deviation.devModZoom .3
rem ---EndComp ---
rem ---BeginComp :D efaultSoundComp ---
ObjectTemplate.createComponent DefaultSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultAnimationComp ---
ObjectTemplate.createComponent DefaultAnimationComp
rem ---EndComp ---
rem ---BeginComp :D efaultZoomComp ---
ObjectTemplate.createComponent DefaultZoomComp
ObjectTemplate.zoom.zoomDelay 0.6
ObjectTemplate.zoom.changeFovDelay 0.6
ObjectTemplate.zoom.zoomLod 1
ObjectTemplate.zoom.addZoomFactor 0.09
rem ---EndComp ---
ObjectTemplate.geometry simrad
ObjectTemplate.setCollisionMesh simrad
ObjectTemplate.mapMaterial 0 Rubber 0
ObjectTemplate.mapMaterial 1 lambert1 0
ObjectTemplate.floaterMod 0
ObjectTemplate.hasMobilePhysics 0
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Mesh
ObjectTemplate.material 38
rem -------------------------------------
ObjectTemplate.addTemplate S_simrad_Fire1P
ObjectTemplate.addTemplate S_simrad_Fire1P_Outdoor
ObjectTemplate.addTemplate S_simrad_Fire3P
ObjectTemplate.addTemplate S_simrad_BoltClick
ObjectTemplate.addTemplate S_simrad_TriggerClick
ObjectTemplate.addTemplate S_simrad_SwitchFireRate
ObjectTemplate.addTemplate S_simrad_Reload1P
ObjectTemplate.addTemplate S_simrad_Reload3P
ObjectTemplate.addTemplate S_simrad_Deploy1P
ObjectTemplate.addTemplate S_simrad_Deploy3P
ObjectTemplate.addTemplate S_simrad_Zoom
rem -------------------------------------
ObjectTemplate.animationSystem1P Objects/Weapons/Handheld/simrad/AnimationSystem1p.inc
ObjectTemplate.animationSystem3P Objects/Weapons/Handheld/simrad/AnimationSystem3p.inc
ObjectTemplate.projectileTemplate at_predator
ObjectTemplate.keepProjectiles 15
ObjectTemplate.velocity 60
ObjectTemplate.itemIndex 7
ObjectTemplate.delayToUse 1.5

ObjectTemplate.create GenericProjectile simrad_Projectile
ObjectTemplate.modifiedByUser M.Meehow
ObjectTemplate.setNetworkableInfo BasicInfo
ObjectTemplate.createNotInGrid 1
ObjectTemplate.createdInEditor 1
rem ---BeginComp:StickyCollisionComp ---
ObjectTemplate.createComponent StickyCollisionComp
ObjectTemplate.collision.bouncing 1
ObjectTemplate.collision.maxStickAngle 360
ObjectTemplate.collision.stickToStaticObjects 1
ObjectTemplate.collision.stickToVehicles 1
ObjectTemplate.collision.stickToTerrain 1
rem ---EndComp ---
rem ---BeginComp :D efaultProjSoundComp ---
ObjectTemplate.createComponent DefaultProjSoundComp
rem ---EndComp ---
rem ---BeginComp :D efaultPenetrateComp ---
ObjectTemplate.createComponent DefaultPenetrateComp
ObjectTemplate.penetrate.allowSolidPenetration 0
rem ---EndComp ---
ObjectTemplate.floaterMod 0
ObjectTemplate.drag 0
ObjectTemplate.gravityModifier 0
ObjectTemplate.hasMobilePhysics 1
ObjectTemplate.hasCollisionPhysics 1
ObjectTemplate.physicsType Point
ObjectTemplate.collisionGroups 8
ObjectTemplate.material 0
rem -------------------------------------
ObjectTemplate.addTemplate S_simrad_Projectile_Looping
ObjectTemplate.addTemplate LaserTarget_simrad
ObjectTemplate.addTemplate S_AirRaid_SIMRAD
rem -------------------------------------
ObjectTemplate.timeToLive CRD_NONE/30/0/0
ObjectTemplate.material 0
ObjectTemplate.hasOnTimeEffect 1
ObjectTemplate.damage 0

ObjectTemplate.activeSafe Sound S_simrad_Fire1P
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_Fire1P_Outdoor
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_Fire3P
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_BoltClick
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_TriggerClick
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_SwitchFireRate
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_Reload1P
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_Reload3P
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_Deploy1P
ObjectTemplate.modifiedByUser "dbzao"
ObjectTemplate.soundFilename "objects/weapons/handheld/medikit/sounds/medikit_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 0
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.21
ObjectTemplate.pitch 1
ObjectTemplate.pan 0.5
ObjectTemplate.reverbLevel 1

ObjectTemplate.activeSafe Sound S_simrad_Deploy3P
ObjectTemplate.modifiedByUser "dbzao"
ObjectTemplate.soundFilename "objects/weapons/handheld/medikit/sounds/medikit_deploy.wav"
ObjectTemplate.loopCount 1
ObjectTemplate.is3dSound 1
ObjectTemplate.stopType 0
ObjectTemplate.volume 0.21
ObjectTemplate.pitch 1
ObjectTemplate.reverbLevel 1
ObjectTemplate.minDistance 0.5
ObjectTemplate.halfVolumeDistance 2

ObjectTemplate.activeSafe Sound S_simrad_Zoom
ObjectTemplate.modifiedByUser "dbzao"

ObjectTemplate.activeSafe Sound S_simrad_Projectile_Looping
ObjectTemplate.modifiedByUser "dbzao"

Re: SIMRAD Missile

Posted: 2010-08-09 08:26
by Meehow818
Is it possible to get hold of ObjectTemplate. Commands? and what they mean cause i think it would be much easier if there was a guide or something like that

Re: SIMRAD Missile

Posted: 2010-08-09 10:05
by Sniperdog
Meehow818 wrote:Is it possible to get hold of ObjectTemplate. Commands? and what they mean cause i think it would be much easier if there was a guide or something like that
1. Try adding in the component parts I listed ;)

2. When you chance the simrad projectile as you have it above you are not changing anything.

Code: Select all

ObjectTemplate.projectileTemplate at_predator
That tells it to shoot the at_predator projectile. The projectile code you listed in above is the simrad projectile.

I would suggest setting the projectile the weapon shoots back to "simrad_Projectile" and then copying all the code from the at_pedator (which can be found in weapons_server.zip\weapons\armament\missiles), pasting it manually into the simrad_Projectile code you listed above and working from there.

The above code I gave you in my first reply should have all the stuff you need to add on top of the base at_predator code to make it work. (That is if enabling the mouse works on handheld weapons at all)

Generally if you are trying to make something new with coding there are no "guides" persay. Most just learn by doing or reading threads on the bfeditor forums (where other people needed help making stuff) which can help you understand bf2 coding.

ps try to put code in the code brackets. If you repost/edit the above into a code bracket I'll edit it to something that should hopefully work.

Re: SIMRAD Missile

Posted: 2010-08-09 10:26
by Meehow818
thankyou

Re: SIMRAD Missile

Posted: 2010-08-10 07:35
by Meehow818
By the way is it possible to delay rem ---BeginComp :P ostProcess --- for TV
rem ---EndComp ---
rem ---BeginComp :P ostProcess ---
ObjectTemplate.createComponent PostProcess
ObjectTemplate.postProcess.tvInterference 0.04
rem ---EndComp ---
For example:
ObjectTemplate.postProcess.Delay (or something like that?)