Jump to content

Scanger

Member
  • Content Count

    57
  • Joined

  • Last visited

  • Medals

Community Reputation

0 Neutral

About Scanger

  • Rank
    Lance Corporal

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Scanger

    annoying problem

    If it's a script you are working on then here's the correct ways to script it. There are a few options, depends on what u need to do. But here are a few scripting rules and methods. The getpos command returns an array [x,z,y] The setpos command sends and array [x,z,y] These commands can be run as a whole, or split into single co-ords: x coordinates is east-west getpos _object select 0 is always it's x co-ord z is south-north getpos _object select 1 is always it's z co-ord y is height above ground getpos _object select 2 is always it's y co-ord This will increase the guns height above ground level by 10 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _gun = _this select 0 _posx = getpos _gun Select 0 //returns number value for east-west _posz = getpos _gun Select 1 //returns number value for south-north _posy = getpos _gun Select 2 //returns number value for height above ground _gun setpos [_posx,_posz,(_posy)+10] This will also increase the guns height above ground level by 10 <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _gun = _this select 0 _gun setpos [getpos _gun select 0, getpos _gun select 1, (getpos _gun select 2) +10] This will simply place the gun wherever u want it <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _gun = _this select 0 _gun setpos [2500, 2500, 100] That's the scripting for positioning of an object, but if it's just an error you're getting then it must be an addon or script you are using in your mission that has the script error...my hunch, it's something with a gun ;)
  2. Scanger

    Flashbang (work in progress)

    Thanks a lot SelectThis, i'll definitely give those a good look, I'm no master when it comes to scripting so any reference I can study is a God send :D hardest part for the flashbang is the orientation alright so you won't get blinded when facing away from it, so hopefully I'll find the answer in there. Scanger BTW: i did find a workaround, if you run a custom startup...eg -mod=??? and edit cfgWeapons.hpp in the Bin folder of that and add your magazines into the "throw" weapon class then they'll work in multiplayer, thing is I'd assume all players on server must have the same change made to stop errors. EDIT..i checked the BAS blackhawks dust in eyes thing...unfortunately it goes by distance from chopper again rather than orientation <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">@ player distance _mh60 < 25 && player distance _mh60 >7 && player animationphase "goggles" == 0 && ! (player in _mh60) && (getpos _mh60 select 2) <10 && vehicle player == player && (alive player) but i got an idea of a way of implementing it by: getting the players distance & direction relative to impact point then rotating the dummy towards the player then making a 180 degree flashzone and clearzone flashzone/distance would give the amount of blindness/disorientation to inflict on player clearzone/distance would still be flashed but to a lesser extent and without the disorientation unless within 10 ft or so
  3. Scanger

    Custom "Throw" class

    Here's a link to my test addon: JMG_Throw.pbo Basically I got a custom throw class and custom grenade and smokeshell classes too. They work Perfect in single player, but aren't even available in Multiplayer, any ideas? Another thing worth noting is that I have a BIS Smokeshell on my unit, with MY Throw class i deliberately left that OUT of the magazines so it won't show up in single player(thats working fine) BUT in multiplayer it ONLY shows the BIS Smokeshell, so it's looking like the original Throw class is overpowering my custom throw class in multiplayer for some reason. here's the cpp code:but download the addon too and see if the same happens to you <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// some basic defines #define TEast 0 #define TWest 1 #define TGuerrila 2 #define TCivilian 3 #define TSideUnknown 4 #define TEnemy 5 #define TFriendly 6 #define TLogic 7 #define true 1 #define false 0 // type scope // used for show entry #define private 0 //! item is never visible #define protected 1 //! "advanced designer" switch must be activated to use it #define public 2 //! anyone can see/use it #define WeaponNoSlot 0 // dummy weapons #define WeaponSlotPrimary 1 // primary weapons #define WeaponSlotSecondary 16 // secondary weapons #define WeaponSlotHandGun 2 // HandGun #define WeaponSlotHandGunItem 32 // HandGun magazines #define WeaponSlotItem 256 // items #define WeaponSlotBinocular 4096 // binocular #define WeaponHardMounted 65536 class CfgPatches { class JMG_Throw { units[] = { JMG_Throw_Soldier }; weapons[] = { JMG_Throw, JMG_HandGrenadeMag, JMG_SmokeShellBlue }; requiredVersion = 1.75; }; }; class CfgAmmo { class Default{}; class Grenade: Default{}; class GrenadeHand: Grenade{}; class JMG_GrenadeHand: GrenadeHand { //-->Ammo as referenced in Magazine //initTime=2.0; model=handgrenade.p3d; minRange=40;minRangeProbab=0.10; midRange=45;midRangeProbab=0.30; maxRange=60;maxRangeProbab=0.5; visibleFire=2; // how much is visible when this weapon is fired audibleFire=0.25; visibleFireTime=1; }; class SmokeShell : GrenadeHand{}; class JMG_SmokeShellBlue : SmokeShell { smokeColor[] = {0, 0, 1, 0}; }; }; class CfgWeapons { //-->Weapons and magazines access = ReadAndCreate; class Default{}; class GrenadeLauncher: Default{}; class Throw: GrenadeLauncher{}; class JMG_Throw: Throw { //-->Main Weapon scopeWeapon = protected; scopeMagazine = private; valueWeapon = 0; weaponType = WeaponNoSlot; displayName="JMG_Throw"; sound[]={,db-70,1}; reloadSound[]={,db-70,1}; aiDispersionCoefX=2.0; aiDispersionCoefY=2.0; enableAttack=false; showEmpty = false; autoReload = true; canDrop = false; magazines[] = {JMG_HandGrenadeMag, JMG_SmokeShellBlue}; }; class HandGrenade: GrenadeLauncher{}; class JMG_HandGrenadeMag: HandGrenade { //-->Magazine - YES THEY DO GO IN CfgWeapons scopeWeapon = private; scopeMagazine = public; valueMagazine = 1; magazineType = WeaponSlotItem; ammo=JMG_GrenadeHand; picture="HandGrenade"; displayName="JMG_HandGrenade"; displayNameMagazine="JMG_HandGrenade"; shortNameMagazine="JMGHG"; initSpeed=22; maxLeadSpeed = 7; reloadTime=1.5; count=1; sound[]={,db-70,1}; }; class SmokeShell: HandGrenade{}; class JMG_SmokeShellBlue: SmokeShell { //-- valueMagazine = 2; picture = "smokeshell"; ammo = JMG_SmokeShellBlue; displayName="SmokeShell(Blue)"; displayNameMagazine="SmokeShell(Blue)"; shortNameMagazine="SmokeShellBlue"; }; }; class CfgVehicles { class All{}; class AllVehicles:All{}; class Land:AllVehicles{}; class Man:Land{}; class Soldier:Man{}; class SoldierWB : Soldier{}; class JMG_Throw_Soldier:SoldierWB { displayName = "JMG_Throw Soldier"; weapons[]={"JMG_Throw","Put","StrokeGun","StrokeFist"}; magazines[]={JMG_HandGrenadeMag,SmokeShell,JMG_SmokeShellBlue}; //Custom Handgrenade, BIS Smokeshell, Custom Blue Smokeshell }; }; //JMG_Throw is the weapon, JMG_HandGrenadeMag is the mag of the weapon and it's ammo is JMG_GrenadeHand and for those who know what I'm on about: i added my magazine names into the default throw class in cfgWeapons.hpp and that worked in multiplayer, so this proves that the BIS throw is the one being used in MP i've been tryna sort this for hours and am just about to xplode, but i need it to make a flashbang thats usable in MP
  4. Scanger

    Flashbang (work in progress)

    i've run into a major snag ANY custom grenade i make or download doesn't work in multiplayer, but has no problems in single player. it appears on the gear page but cannot be switched to ingame so the flashbang script is on hold until i figure this out cos only in MP will the flashbang be most effective. any ideas? and if anyone has a link to a custom grenade that works in multiplayer that'd be great, then maybe i can find where the problem is. Scanger
  5. back again with another update...i found a way to track the fired object,i.e. grenade/flashbang, this will give the impact time and position. i will give this script but bear in mind it still has bugs that hopefully someone can iron out This is the eventhandler for your unit equipped with flashbang <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">class eventhandlers { fired ="[_this select 0, _this select 1, _this select 4] exec ""\JMG_Flashbang\Scripts\test.sqs"""; }; test.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">;================================================== ;Ammo tracker and Flashbang script by Scanger ;================================================== _player    = _this Select 0 _weapon    = _this Select 1 _ammoType   = _this Select 2 ;================================================== ;Intercepts fired object ;================================================== _ammo = NearestObject [_player,_ammoType] ;================================================== ;WEAPON & AMMO CHECK ;================================================== ?!((_weapon == "JMG_Flashbang") && (_ammoType == "JMG_Flashbang")): exit ;================================================== ;Ammo Position tracker ;================================================== #TrackAmmo _PosAmmo = getpos _ammo _player groupChat "TrackAmmo" ~.1 ?(alive _ammo):goto "TrackAmmo" _player groupChat "Boom!" ;================================================== ;Creates dummy vehicle then places at impact point ;================================================== _position = "Logic" createVehicle [0,0,0] _position setPos _PosAmmo ;================================================== ;Checks players position relative to dummy vehicle ;Decides level of blindnesss inflicted by flashbang ;================================================== ?(player distance _position < 20): titletext ["", "WHITE IN", 15] ?((player distance _position > 20) && (player distance _position < 40)): titletext ["", "WHITE IN", 10] ?((player distance _position > 40) && (player distance _position < 60)): titletext ["", "WHITE IN", 4] ?((player distance _position > 60) && (player distance _position < 100)): titletext ["", "WHITE IN", 0.3] ~1 ;================================================== ;Tells the player his distance from impact point ;================================================== _far = player distance _position _player groupChat Format["Distance from impact %1",_far] exit known bugs: You do NOT have to be staring at flashbang to get blinded..it goes by distance from flashbang(any help on fixing appreciated) I haven't yet added any disorientation feature but it will happen. currently it'll only work on HUMAN players since they can see, AI won't be affected in this release. currently using grenade model and smokeshell pics, will make new ones later today it's not perfect but it's a start...especially the tracking ammo bit, i've left my chat sections in script so u can see when things happen edit: fixed distance issue(needed Logic dummy vehicle) TO SAVE PEOPLE TIME RECOMPILING THIS SCRIPT HERE'S A LINK TO MY TEST JMG_Flashbang.pbo Unit is under west>men>JMG Soldier(Flashbang)
  6. Scanger

    Hand Grenade Standard Config

    moving flashbang script to it's own thread so it gets more attention ;)
  7. Scanger

    Hand Grenade Standard Config

    ok, after i played around a bit I found a way to get a script to run when the grenade is thrown but not when it impacts yet...i'll give the code Eventhandlers(cfgVehicles) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class eventhandlers { fired ="[_this select 0, _this select 1, _this select 4] exec ""\JMG_HandGrenade\Scripts\test.sqs"""; }; the script itself <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_player    = _this Select 0 _weapon    = _this Select 1 _ammotype   = _this Select 2 ?((_weapon == "JMG_HandGrenade") && (_ammotype == "JMG_HandGrenade")): _player GroupChat "JMG_Handgrenade is current weapon and ammo type" i just use the chat to visibly see that my script is running. change according to what u need i modified the above cpps too cos i noticed that the actual pic in the gear page wasn't available
  8. Scanger

    Is this an Error display???

    not a prob, i suppose there's always the possibility that it's part of a feature disabled in O2light that was in the full oxygen...
  9. Scanger

    Is this an Error display???

    i wouldn't say so since if you un-maximize o2 and just resize it from the corner the contents of that box will change to what it currently around the screen in that position for example open internet explorer behind o2 then switch to it and then back to o2, you can now see the text or picture in that little box that was in internet explorer, basically it looks like a transparent box so i wouldn't worry about it check this pic...see homer through the box ;)
  10. Scanger

    can sum 1 help

    heres a totally basic cpp this will only show your addon up as a static building but at least you will see how it looks ingame. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// type scope #define private 0 #define protected 1 #define public 2 class cfgPatches { class MyFirstAddon { units[] = {MyFirstAddon}; weapons[] = {}; requiredversion = 1.0; }; }; class cfgVehicles { class All {}; class Static: All {}; class Building: Static {}; class NonStrategic: Building {}; class TargetTraining: Nonstrategic {}; class TargetGrenade: TargetTraining {}; class MyFirstAddon: TargetGrenade { vehicleClass = "MyFirstAddon"; model="\MyFirstAddon\MyFirstAddon.p3d"; armor=20000; scope=2; displayname="MyFirstAddon" }; }; just change the "MyFirstAddon" bits with your own addons folder\modelnames Scanger :D
  11. Scanger

    Config for several footstep sounds

    no i'd say that's not doable given that it relies on ground textures and theres no script command that can locate them, BUT i found a way around it....there are positives and negatives. Positives=i got the sounds changed Negatives=can't really be implemented into an addon, more of a mod so i'd recommend it for personal use and preference rather than releasing it...that said, it could be released since it doesn't modify any original game file. heres the method: Make folder with any name in your root "OperationFlashpoint" folder...in my case i made "E:\Games\OperationFlashpoint\MyMod\" and inside this folder make another folder called "Bin" and another called "Addons" Copy contents of "\OperationFlashpoint\Res\Bin\" into your "Bin" folder that you just created Go here Breathe Website and download Commented_Config_191.zip Extract the zips contents into your "OperationFlashpoint\MyMod\Bin" directory(replace files if asked) Next open "cfgVehicles.hpp" in a text editor and search for the string below: this is merely to find our bearings <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">soundEnviron[]={People\dirt_L,db-70,1}; below that you will see a load of different info relating to footstep sounds eg. "People\gravel_L",db-95,1" Modify the ones that you wish to change: eg. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{"People\Grass_L",db-115,1} i changed to: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">{"\MyNewFootsteps\sirena.ogg",db-115,1} Next put your sounds into a folder eg. "MyNewFootsteps" then compress this into a PBO "MyNewFootsteps.pbo" (NO CONFIG.CPP FILE NEEDED IN THIS PBO-IT'S ONLY AN ARCHIVE) Place "MyNewFootsteps.pbo" into YOUR addon folder <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">\OperationFlashpoint\MyMod\Addons\ Make shortcut to FlashpointResistance.exe anywhere. Get properties of it and make it look like this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">\FLASHPOINTRESISTANCE.EXE -mod=MyMod Start the Game using this shortcut Your sounds should be changed now and no critical files have been modified, just run the normal shortcut when u don't wanna use your sounds. You may need to mess around with the db-115,1 values on the sounds to make them more audible. Hope this works for you too. Scanger
  12. Scanger

    Config for several footstep sounds

    got this from the BIS 1.91 config.cpp file /*! \patch 1.43 Date 1/22/2002 by Ondra - Fixed: CfgSurfaces protected against addon modification. */ guess thats our answer
  13. Scanger

    Hand Grenade Standard Config

    lol, now that script bit sounds interesting, slightly over my head though. i would assume that you could use eventhandlers with the init or fired commands to do it. i was in the middle of testing this earlier but the power went out, and i'm using the laptop now so still got no access to ofp stuff on my main comp, i'll try again tomorrow but it was tough...the fired eventhandler was registering for all weapons rather than just the grenade which would need to be sorted, i think eventhandlers have to be in the cfgvehicles section so the unit would exec the script rather than the weapon, but i'll see what happens. as far as the power of the grenade..what oyman suggested should be fine. ;)
  14. Scanger

    Hand Grenade Standard Config

    for those who want to add a unit too try this: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// some basic defines #define TEast 0 #define TWest 1 #define TGuerrila 2 #define TCivilian 3 #define TSideUnknown 4 #define TEnemy 5 #define TFriendly 6 #define TLogic 7 #define true 1 #define false 0 // type scope #define private 0 #define protected 1 #define public 2 #define WeaponNoSlot 0// dummy weapons #define WeaponSlotPrimary 1// primary weapons #define WeaponSlotSecondary 16// secondary weapons #define WeaponSlotItem 256// items #define WeaponSlotBinocular 4096// binocular #define WeaponHardMounted 65536 class CfgPatches { class JMG_HandGrenade { units[] = {JMG_HandGrenadeSoldier}; weapons[] = {JMG_HandGrenade}; requiredVersion = 1.40; }; }; class CfgAmmo { class default {}; class Grenade: Default{}; class GrenadeHand: Grenade {}; class JMG_HandGrenade: GrenadeHand { //model="\JMG_HandGrenade\JMG_HandGrenade"; model=handgrenade.p3d; //<-normal grenade model soundHit[]={Explosions\expl3,db20,1}; soundFly[]={objects\noise,db-90,1}; hit=20;indirectHit=18;indirectHitRange=7; minRange=40;minRangeProbab=0.10; midRange=45;midRangeProbab=0.30; maxRange=60;maxRangeProbab=0.5; visibleFire=2; // how much is visible when this weapon is fired audibleFire=0.25; visibleFireTime=1; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class GrenadeLauncher: Default {}; class JMG_HandGrenade: GrenadeLauncher { scopeWeapon = private; scopeMagazine = public; valueWeapon=0; valueMagazine=1; weaponType=0; magazineType=WeaponSlotItem; picture="HandGrenade"; ammo="JMG_HandGrenade"; sound[]={"",1,1}; displayName="JMG HandGrenade"; displayNameMagazine="$STR_MN_HAND_GRENADE"; shortNameMagazine="$STR_SN_HAND_GRENADE"; initSpeed=22; maxLeadSpeed=7; reloadTime=1.5; count=1; reloadSound[]={"",1,1}; autoReload=1; showEmpty=0; canDrop=0; enableAttack=0; aiDispersionCoefX=2.000000; aiDispersionCoefY=2.000000; magazines[]={"JMG_HandGrenade"}; }; }; class CfgVehicles { class All{}; class AllVehicles:All{}; class Land:AllVehicles{}; class Man:Land{}; class Soldier:Man{}; class SoldierWB : Soldier{}; class JMG_HandGrenadeSoldier:SoldierWB { displayName = "JMG HandGrenade Soldier"; weapons[]={"m16","NVGoggles","Binocular","JMG_HandGrenade","Put","StrokeGun","StrokeFist"}; magazines[]={"m16","m16","m16","m16",JMG_HandGrenade,JMG_HandGrenade,JMG_HandGrenade,JMG_HandGrenade, JMG_HandGrenade, JMG_HandGrenade}; }; }; };
  15. Scanger

    Hand Grenade Standard Config

    This works for me :) This basic config will add the weapon "JMG_HandGrenade" but not a soldier equipped with it. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">// type scope #define private 0 #define protected 1 #define public 2 #define WeaponNoSlot 0// dummy weapons #define WeaponSlotPrimary 1// primary weapons #define WeaponSlotSecondary 16// secondary weapons #define WeaponSlotItem 256// items #define WeaponSlotBinocular 4096// binocular #define WeaponHardMounted 65536 class CfgPatches { class JMG_HandGrenade { units[] = {""}; weapons[] = {JMG_HandGrenade}; requiredVersion = 1.40; }; }; class CfgAmmo { class default {}; class Grenade: Default{}; class GrenadeHand: Grenade {}; class JMG_HandGrenade: GrenadeHand { model="\JMG_HandGrenade\JMG_HandGrenade"; //model=handgrenade.p3d; <-normal grenade model soundHit[]={Explosions\expl3,db20,1}; soundFly[]={objects\noise,db-90,1}; hit=20;indirectHit=18;indirectHitRange=7; minRange=40;minRangeProbab=0.10; midRange=45;midRangeProbab=0.30; maxRange=60;maxRangeProbab=0.5; visibleFire=2; // how much is visible when this weapon is fired audibleFire=0.25; visibleFireTime=1; }; }; class CfgWeapons { class Default {}; class MGun: Default {}; class GrenadeLauncher: Default {}; class JMG_HandGrenade: GrenadeLauncher { scopeWeapon = private; scopeMagazine = public; valueWeapon=0; valueMagazine=1; weaponType=0; magazineType=WeaponSlotItem; picture="HandGrenade"; ammo="JMG_HandGrenade"; sound[]={"",1,1}; displayName="JMG HandGrenade"; displayNameMagazine="$STR_MN_HAND_GRENADE"; shortNameMagazine="$STR_SN_HAND_GRENADE"; initSpeed=22; maxLeadSpeed=7; reloadTime=1.5; count=1; reloadSound[]={"",1,1}; autoReload=1; showEmpty=0; canDrop=0; enableAttack=0; aiDispersionCoefX=2.000000; aiDispersionCoefY=2.000000; magazines[]={"JMG_HandGrenade"}; }; }; };
×