cornhelium
Member-
Content Count
656 -
Joined
-
Last visited
-
Medals
Everything posted by cornhelium
-
Unsung Vietnam War Mod Version 2.5 Discussion
cornhelium replied to sgt_savage's topic in ARMA 2 & OA - ADDONS & MODS: DISCUSSION
Looking spoogetastic, guys :) -
Good evening from the JAM3 team! We're very happy to announce that JAM3 is finished and ready for download. -Fully compatible with ECP, EECP, FFXUR, INQ-Mod, Y2K3, etc. -New AT rounds, compatible with CAVS project -Improved recoils for all rifles, pistols and shotgun -Tweaked accuracy for all sniper rifles -SD magazines tweaked to simulate realistic supersonic ammo where appropriate -Subsonic "SUB" mags preserve JAM2 SD values -New sounds for 99% of magazines and weapons- big thanks to the OFP community -Most magazines have separate fire sounds. Now you can tell who's shooting! -Different fly and hit sounds for different bullet types -Bullet hit and fly sounds also externalized to JAM_Sounds.pbo -THREE alternative versions of the JAM_Sounds.pbo available. Community Pack, Rainbow Pack, Cinemania Pack -New Mounted Machinegun magazines, with HD versions. Ready to be used on vehicles -New realistic-size mags for M60, M240, RPD, PKM. Max loadout of 500rds per unit -New 12rd Belts for grenade launchers, like GL Vest but only taking 3 spaces -Primary and pistol-slot options for most SMG/PDW mags. -Unsuppressed, suppressed and silenced (subsonic) MP5 and Uzi mags -Improved support for UMP-45 -New magazines for Remington SPC 6.8mm and Grendel 6.5mm rounds -New sniper mags for: L96A1-type, AWSM type (including armour piercing incendiary round), SVU tactical rifle -Made recoil more manageable for .50cal sniper rifles, based on real-life reports -New Editor groups -New units for all sides: Spotter, Grenadier (Belt), Machinegunner (500 rounds), AT Units (CAVS compatible) - All BIS vehicles available with JAM crew -Editor mission allows players to quickly preview many of the sounds -More effective smoke grenades. -A few config fixes Instructions from the ReadMe: Credits: Downloads: Core Files - JAM3 and Community Soundpack: Full, fixed JAM3 & Community Soundpack (13.5mb) Updated 29th December 2005 - thanks Sanctuary for hosting. JAM3 Fix, updated 29th December 05 (2.9mb) If you installed JAM3 after 3rd September 05, you can just download this fix and use the new JAM_Magazines.pbo and Readme.rtf to overwrite the old ones. Alternative Soundpacks Community Repeater Pack (same as community, but MachineGuns sound like they're firing more): Mirror - thanks to flashpoint.ru Mirror - thanks to OFPEC http://rapidshare.de/files/4327925/JAM_CommPack_1_2_REP.rar.html Rainbow Pack: Mirror - thanks to flashpoint.ru Mirror - thanks to OFPEC http://rapidshare.de/files/4331472/JAM_RainPack_1_2.rar.html Rainbow Repeater Pack: Mirror - thanks to flashpoint.ru Mirror - thanks to OFPEC http://rapidshare.de/files/4338165/JAM_RainPack_1_2_REP.rar.html Cinemania Pack: Mirror - thanks to flashpoint.ru Mirror - thanks to OFPEC http://rapidshare.de/files/4320541/JAM_CinePack_1_00.rar.html Cinemania Repeater Pack: Mirror - thanks to flashpoint.ru Mirror - thanks to OFPEC http://rapidshare.de/files/4323024/JAM_CinePack_1_00_REP.rar.html Resources: OFPEC JAM Page Scripts to swap dead units' JAM HD/Standard mags - very useful. Thanks Fox2 and Strango. Thanks again to BAS for letting the community carry on the good fight! Cheers, CH
-
All the best K-Man. Your input on JAM3's recoils was much appreciated. Â Cheers mate, CH
-
Thanks bardosy for this. Like J W I have 0 time for OFP nowadays, but at some point I'll definitely be trying this with and without Ebud's Tonal update. Cheers, CH
-
where to find change jam hd mag script
cornhelium replied to krypling's topic in OFP : MISSION EDITING & SCRIPTING
Hi krypling, AgentFox2 made the most recent version of that script, which was a casualty of the great OFPEC crash. If you PM him directly he might be able to send you a copy - he's a rather helpful fellow y'know Cheers, CH -
Doh, that'll teach me to jump the gun As Matt says, perhaps someone can release an ECP OPFOR after release. If the current OPFOR pbo structure is kept (ie. a tiny separate pbo for the .cpp), users could download and apply this in a few seconds. Cheers, CH
-
Hi Ebud, Sent you an ECP config.cpp for the v1.1 OPFOR - check your PM mate. Cheers, CH
-
Sorry to be a pest Ebud, but I just remembered that the current Tonal units aren't fully ECP compliant. Do you plan to fix this for the release? Here's a personal edit I've done on the Toyota wars units which works perfectly (needs 1 BIS unit on the map). Should be a snap to adapt to the Tonalis and paste into the base classes over the current JAM EHs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class EventHandlers : ECP_EventHandlers { init = "if (format[{%1},ECP_path]=={scalar bool array string 0xfcffffef})then{ _0={ECP_INIT}createVehicle [0,0,0]}; if (format[{%1},count ECP_addUnitsArray] == {scalar}) then {ECP_addUnitsArray=[]}; ECP_addUnitsArray=ECP_addUnitsArray+[_this select 0]; _this call (ECP_resources select 40); _this exec ""\DMA_CHAD\scr\african_faces.sqs"""; fired = "_this call (ECP_resources select 41); if((_this select 1 in[{Throw},{JAM_AT4Launcher},{JAM_CAVS_AT4Launcher},{JAM_RPG7Launcher},{JAM_CAVS_RPG7Launc her},{JAM_M72LAWLauncher},{JAM_CAVS_M72LAWLauncher}])or(_this select 4 in[{JAM_MarkerGrenadeammo}]))then{_this exec{\JAM_Magazines\FX\firedEH.sqs}}"; }; Not forgetting <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> class ECP_EventHandlers {}; just above the class CfgVehicles section. With this you get the full ECP gunsmoke, blood, bulletwhiz, DSAI etc, and also your own face set EH at initialisation. Cheers  CH
-
I found something funny about the bullet fly noise while working on the different JAM3 bullet sounds: OFP plays it back at a different pitch according to the speed of the bullet. Slower bullet = higher pitch, faster bullet = lower pitch. For mags with initspeed around 8-900 (ie most assault & sniper rifles and machineguns), OFP plays back the sound quite a bit slower, whereas for 250-400 (SMGs, pistols, subsonic) the sound is played back at more than double speed  Also, only one fly sound per bullet type can be played - you can't have a selection of fly sounds like you can with hit sounds. Cheers, CH
-
Stuffing global variables into an array
cornhelium posted a topic in OFP : MISSION EDITING & SCRIPTING
Hi, Still working on my wildlife sounds system for Tonal. The goal is to have mission editor templates for each separate area of Tonal that mission makers can simply merge over their finished mission, giving them reactive, authentic SE African wildlife sounds that change around the clock. So far, everything's going great. The basics are in place and working, now got a few months of editing and placing all the sounds. However, I've been reading about the savegame bug, and I might have a basic flaw in that I'm using a >lot< of global variables (could eventually run to a few hundred if other lag issues allow). All of these globals are needed, as many different groups of 2 trigger + 1 logic are passed to the same fauna.sqs at different times. Now, I've read here that the ECP team got around the savegame bug by stuffing all of their globals into a few arrays, then referencing them with selection numbers. Taking this approach, I could put half of my globals and array names into one array per area, probably buying myself enough headroom to get the system working safely at a decent scale. I've just tried a little re-write and have hit a wall of error messages. Could someone advise the correct syntax please? Here's what works, using the full global variable set for one 2trig+1logic "soundcentre". First, the elements and their names: Globvars passed to fauna.sqs va1m main trigger. covers a 250m radius. emits wildlife sounds. adds firedEH to units that can exec another "fly away in panic and don't come back for 10 minutes" script. zapped to 0,0,0 for 1 second in every 31 so that list va1m can refresh. va1t inner trigger. covers a 50m radius. used by fauna.sqs to determine if units are too near, in which case the main trigger will emit warning calls or go silent. Also emits the "panic" sounds as va1m is zapped to 0,0,0 for 10 minutes. Also the only element that never moves - this acts as an anchor point within the fauna.sqs which uses local variables exclusively. va1l logic. used by a looping script that checks the player's distance from all such logics. When player is within 500m, the script passes these three globals to fauna.sqs (along with a "type" that determines which section of fauna.sqs is used). We only want fauna.sqs to be executed once by any one group, so it now moves this logic 10km away for the duration. I think of each of these 2 trigger + 1 logic groups as a "soundcentre" Globvars referenced by va1m activation/deactivation fields to manage the firedEH va1 condition to activate/deactivate the firedEH. When a unit fires, the wildlife should flee in panic only once. Thus the firedEH itself sets va1 to false the first time a unit fires. This disables the EH until va1m is returned after 10 minutes or so, when it is reset to true by the activation field. va1i condition to isolate the units in list va1m at mission start. part of the archiving system described below. set to true in fauna_init.sqs, sets permanently to false first time va1m deactivates. Globarrays referenced by va1m activation/deactivation fields to manage the firedEH va1r copy of va1m list. refreshed on each activation (ie every 31 seconds) va1a growing archive of va1m list. set in fauna_init.sqs as list va1m, then added to with each trigger deactivation va1n new units in the area. va1m list from current activation minus va1m archive from previous deactivation. SilencedBullets set in fauna_init.sqs. small array of bullet classnames that should not make wildlife flee. easily accessible to mission makers to add/remove bullet types as they wish Explosives also set in fauna_init.sqs. another small array of explosives that will trigger a delayed flyoff script when "fired". Smokeshells another small array of smokeshells, flares etc that should not cause wildlife to flee at all. SilentShots SilencedBullets + Explosives + Smokeshells. OK - here's the current syntax which works fine: Globvars set in fauna_init.sqs (executed via init.sqs): <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> SilencedBullets = ["StrokeFistHit","StrokeGunHit","BulletSilencedSingle",etc] Explosives = ["GrenadeHand","PipeBomb","TimeBomb",etc] Smokeshells = ["JAM_SmokeGrenadeRed","JAM_SmokeGrenadeGreen",etc] SilentShots = SilencedBullets + Explosives + Smokeshells ~1 va1i = true ;similar lines here for other trigger groups making different sounds vb1i, vc1i, va2i etc. currently using 6 groups OK ~5 va1a = list va1m ;starts archive by waiting until va1m has activated then capturing its list before it deactivates for the first time ;similar lines here for other trigger groups making different sounds vb1a, vc1a, va2a etc. currently using 6 groups OK #loop ;script now runs in 60 second loops checking player distance to the logics and passing the elements to fauna.sqs when <500m goto "loop" va1m activation field (split to make a little clearer - basically the first section is only used once, after that only the second section is used <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> va1r = +thislist; va1 = true; player globalChat "activated va1m"; {if (va1i) then {_x addEventHandler ["fired",{if (va1 && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; va1 = false; player globalchat "va1 original fired"}}; if (va1 && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1 original bomb"}}}]}} foreach thislist; {_x addEventHandler ["fired",{if (va1 && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; va1 = false; player globalchat "va1 addition fired"}}; if (va1 && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1 addition bomb"}}}]} foreach (va1r - va1a) va1m deactivation field <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> va1n = va1r - va1a; va1a = va1a + va1n; va1i = false; player globalChat "deactivated va1m" All the above works fine, and so far is working with 6 soundcentres (each one using different global names vb1m,vbl,vb1t, vb1i, vb1a etc). Now, here's my extremely noob attempt to put some of these globvars into a single array Method put the globvars va1 and va1i, and the global arrays va1r, va1r, va1n, into a single array "vd" (short for "Veld area") va1 becomes (vd select 0) va1i becomes (vd select 1) va1r becomes (vd select 2) va1a becomes (vd select 3) va1n becomes (vd select 4) the globvars and arrays for subsequent veld soundcentres will just follow on sequentially ie vb1 becomes (vd select 5), vb1i becomes (vd select 6) etc. the global names for the triggers & logics will remain as they are New syntax fauna_init.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ~1 (vd select 1) = true ~5 (vd select 3) = list va1m ;etc. loop unchanged as trigger & logic names remain the same va1m activation field (not working - editor won't accept syntax) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> (vd select 2) = +thislist; (vd select 0) = true; player globalChat "activated va1m etc"; {if ((vd select 1)) then {_x addEventHandler ["fired",{if ((vd select 0) && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; (vd select 0) = false; player globalchat "va1m etc original fired"}}; if ((vd select 0) && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1m etc original bomb"}}}]}} foreach thislist; {_x addEventHandler ["fired",{if ((vd select 0) && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; (vd select 0) = false; player globalchat "va1m etc addition fired"}}; if ((vd select 0) && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1m etc addition bomb"}}}]} foreach ((vd select 2) - (vd select 3)) va1m deactivation field <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> (vd select 4) = (vd select 2) - (vd select 3); (vd select 3) = (vd select 3) + (vd select 4); (vd select 1) = false; player globalChat "deactivated va1" also tried this, after having a quick look at some ECP scripts: fauna_init.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ~1 vd set [1, true] ~5 vd set [3, (list va1m)] ;etc. loop unchanged as trigger & logic names remain the same va1m activation field (not working - long error message on trigger activation looks like something to do with one of the {_x addEH...} sections) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> vd set [2, (+thislist)]; vd set [0, true]; player globalChat "activated va1m"; {if ((vd select 1)) then {_x addEventHandler ["fired",{if ((vd select 0) && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; vd set [0, false]; player globalchat "va1m etc original fired"}}; if ((vd select 0) && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1m etc original bomb"}}}]}} foreach thislist; {_x addEventHandler ["fired",{if ((vd select 0) && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; vd set [0, false]; player globalchat "va1m etc addition fired"}}; if ((vd select 0) && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1m etc addition bomb"}}}]} foreach ((vd select 2) - (vd select 3)) va1m deactivation field <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> vd set [4, (vd select 2) + (vd select 3)]; vd set [3, (vd select 3) + (vd select 4)]; vd set [1, false]; player globalChat "deactivated va1m" Anyone who can advise me of the right syntax will be the proud owner of a wookie life-debt Thanks for your time, CH -
Stuffing global variables into an array
cornhelium replied to cornhelium's topic in OFP : MISSION EDITING & SCRIPTING
Ah, think I've found the cause of my syntax errors... ...If I'm stuffing variables into a global array, guess I better define an empty array to start with : vd = [] This now seems to work: fauna_init.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> SilencedBullets = ["StrokeFistHit","StrokeGunHit","BulletSilencedSingle",etc] Explosives = ["GrenadeHand","PipeBomb","TimeBomb",etc] Smokeshells = ["JAM_SmokeGrenadeRed",etc] SilentShots = SilencedBullets + Explosives + Smokeshells vd = [] ~1 vd set [1, true ] ~5 vd set [3, (list va1m) ] ;loop etc va1m activation field (split for the sake of readability) <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> vd set [2, (+thislist)]; vd set [0, true ]; player globalChat "activated va1m"; {if (vd select 1) then {_x addEventHandler ["fired",{if ((vd select 0) && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; vd set [0, false ]; player globalchat "va1m  original fired"}}; if ((vd select 0) && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1m original bomb"}}}]}} foreach thislist; {_x addEventHandler ["fired",{if ((vd select 0) && (_this select 0) distance va1m < 500) then {if !((_this select 4) in SilentShots) then {[_this select 0,va1m, va1l, va1t,"va"] exec "flyoff.sqs"; vd set [0, false]; player globalchat "va1m addition fired"}}; if ((vd select 0) && (_this select 0) distance va1m < 500) then {if ((_this select 4) in Explosives) then {[_this select 0,_this select 4,va1m, va1l, va1t,"va"] exec "flyoffdelayed.sqs"; player globalchat "va1m addition bomb"}}}]} foreach ((vd select 2) - (vd select 3)) va1m deactivation field <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> vd set [4, ((vd select 2) - (vd select 3))]; vd set [3, ((vd select 3) + (vd select 4))]; vd set [1, false]; player globalChat "deactivated va1m" ...as far as the savegame bug is concerned, shouldn't this save 5 global variables per soundcentre?  Cheers, CH -
Amazing work Ebud. Tonal captured my imagination when it was released back in 2003, and I've been "in-country" ever since. Those new Gov. Scouts could come in handy - I'm planning a nice little ambush involving a swamp, a BTR-T and a snorkel. Tell 'em I'll be waiting at bd24 with a sitrep and a nice cup of nettle tea Edit: nevermind, I see you've got enough on your plate Cheers, CH
-
Beautiful.
-
Sounds very impressive as usual tacrod. I'll be giving this a go as soon as time allows. Cheers, CH
-
Hi, I'm working on a wildlife sounds system, and the last hurdle is getting singing birds etc to "fly away" in alarm when a loud shot or explosion occurs. Here's part of the init field of the trigger for one area: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> tna1 = true; player globalChat "activated tna1"; {if (tna1i) then {_x addEventHandler ["fired",{if (tna1 && (_this select 0) distance tna1m < 500 && ((_this select 4) in ["JAM_West_762x51_Single_Bullet","JAM_West_762x51_Burst_Bullet","JAM_West_762x51_Auto_Bullet"])) then {[(_this select 0),tna1m, tna1l, tna1t,"tnaf"] exec "flyoff.sqs"; tna1 = false; player globalchat "tna1 original fired"}; if (tna1 && (_this select 0) distance tna1m < 500 && ((_this select 4) in ["GrenadeHand","PipeBomb","TimeBomb"])) then {[(_this select 4),tna1m, tna1l, tna1t,"tnaf"] exec "flyoffdelayed.sqs"; player globalchat "tna1 original bomb"}}]}} foreach thislist flyoff.sqs causes the wildlife to flee immediately, away from the firing unit flyoffdelayed.sqs will wait for the ammo to explode, then the wildlife will flee from the explosion It's all working great, but I really want to expand the types of ammo that will cause flyoff.sqs or flyoffdelayed.sqs to execute. I'd like to just list the ammotypes in 2 sqf files, "flyoffbullets.sqf" and "flyoffexplosives.sqs". This would also allow mission editors to easily add/remove ammo from the sqf files, rather than trawling through several dozen triggers. Can anyone advise me of the correct syntax to take the ammo classnames out of the trigger initfield and into the sqf files please? Thanks, CH
-
Fired EH ammotypes in sqf?
cornhelium replied to cornhelium's topic in OFP : MISSION EDITING & SCRIPTING
Thanks guys. Just to clarify what I'm looking for: This snippet works perfectly, but I want to include about 100 bullet types rather than just the 3: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> {if (tna1 && (_this select 0) distance tna1m < 500 && ((_this select 4) in ["JAM_West_762x51_Single_Bullet","JAM_West_762x51_Burst_Bullet","JAM_West_762x51_Auto_Bullet"])) then {[(_this select 0),tna1m, tna1l, tna1t,"tnaf"] exec "flyoff.sqs"; So, I'm looking for something like this, except I'm not sure of the right syntax <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> {if (tna1 && (_this select 0) distance tna1m < 500 && ((_this select 4) in BulletArray.sqf)) then {[(_this select 0),tna1m, tna1l, tna1t,"tnaf"] exec "flyoff.sqs"; I'll have a few dozen of these triggers around, and I want a couple of global ammo arrays they can all refer to. I'd like to have these arrays in an .sqf or .sqs file so that missionmakers can easily add ammotypes (I plan to put the core scripts and sound files in a .pbo) I'm using the actual bullet/bomb classes, not the base classes. The trigger initfields need to pass global variables to a central fauna.sqs, so if I assigned the EH in an .sqf I'd need one for each trigger. Thus better in this case to assign the EH within the trigger itself. Maybe I can just run a separate ammotypes.sqs at mission start, to define the two global arrays? Eg. in init.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> [] exec "ammotypes.sqs" ammotypes.sqs <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> BulletArray = ["JAM_West_762x51_Single_Bullet","JAM_West_762x51_Burst_Bullet","JAM_West_762x51_Auto_Bullet","LSR_M4_Bullet",etc",etc"...] ExplosiveArray = ["GrenadeHand","PipeBomb","TimeBomb","COCM18A1","etc","etc","etc"...] exit D'you think this would work? Is this an efficient way of doing it? What would be the correct syntax to refer to the array? I'm away from home at the moment and can't try this out. Many thanks CH Ps Yeah, they refer to triggers and logics in the group. It's basically so that one large central fauna.sqs can be used by the many 2trigger&logic groups (<40 of them I hope). Really, it's working fine and is robust, I just need to get over this last wrinkle then I can "load test" it Just this event. It's set to false by the firedEH, so that a shot can only make the birdies fly away >once< ...then a few minutes later "they" (ie the trigger) will return from [0,0,0] and will start singing again. The trigger resets to true if anybody is present. There's also code to make sure each unit can only get the trigger's EH added >once<, though it never gets removed (beyond my ability and available time). -
Passing arrays from a script with firedEH
cornhelium posted a topic in OFP : MISSION EDITING & SCRIPTING
Hi, I'm having trouble with the final element of my wildlife sounds script. This is the part where you'd hear the sounds of birds/animals fleeing in panic when anyone fires in a trigger area: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;fauna.sqs ;each ambient loop uses a set of two triggers and one logic, all with unique global names ;within fauna.sqs and all subsequent scripts they will be treated as local _main = _this select 0 ;a large repeating trigger anybody present ;emits the sound and is used by fauna.sqs to add firedEHs to units _logic = _this select 1 ;a logic that will be used as a distance reference and moved around ;various distance checks ensure that fauna.sqs cannot be run ;simultaneously by the same set _innertrigger = _this select 2 ; a smaller trigger anybody present, used to detect units in an inner warning call area ; when player is within 600m of _logic, _innertrigger execs fauna.sqs and passes the set to it _type = _this select 3 ; the type of critter specified in the activation field of _innertrigger ; points fauna.sqs to the relevant section ;=========================== ?(_type == "nightjar_sing"): Â goto "nightjar_sing_loop" ?(_type == "nightjar_hunt"): Â goto "nightjar_hunt_loop" ?(_type == "thrushnightingale_sing_alarm"): Â goto "thrushnightingale_sing_alarm_loop" ?(_type == "thrushnightingale_sing"): Â goto "thrushnightingale_sing_loop" ;=========================== #nightjar_hunt_loop _mainlist = list _main _mainmemory = +_mainlist _idx = {_x addEventHandler [{fired}, {[_this select 0,_main,_logic,_innertrigger,_type] exec "flyoff.sqs"}]} foreach _mainmemory {_x addeventhandler ["fired", format [{(_this select 0) removeeventhandler [{fired}, %1]},_idx]]} foreach _mainmemory ;move _logic away so that script can't be re-triggered for this set _logic setpos [0,0,0] ;check if any units are in the warning call area _list1 = list _innertrigger ? "man" counttype _list1 > 0 : goto "nightjar_hunt_wait" ;if inner area clear, say song file and wait for it to finish _main say "nightjar_eurasian_hunting" ~20 ; has player left the area? ?(player distance _main > 600) and (_innertrigger distance _main < 50):goto "shutdown" ; is player in area, but flyoff.sqs has moved other elements to 0,0,0? ?(_innertrigger distance _main > 50): goto "flownoff" ;move _main away and back, to refresh its unit list _main setpos [0,0,0] ~1 _repos = getpos _innertrigger _main setpos _repos goto "nightjar_hunt_loop" #nightjar_hunt_wait hint "nightjar hunt waiting while player is in trigger area" ;wait silently ;other critter types will sound a warning or alarm call ~15 ;check again that player hasn't left area or flyoff.sqs hasn't been triggered ?(player distance _main > 600) and (_innertrigger distance _main < 50):goto "shutdown" ?(_innertrigger distance _main > 50): goto "flownoff" ;refresh _main unit list _main setpos [0,0,0] ~1 _repos = getpos _innertrigger _main setpos _repos _list1 = list _innertrigger ;check if any units are still in warning call area ;if so, continue waiting ;if not, go back to main singing loop ? "man" counttype _list1 > 0 : goto "nightjar_hunt_wait" goto "nightjar_hunt_loop" ; ; ; ;similar sections for different critter types ; ; ; #shutdown hint "player over 600m while sound is playing - exiting now" ~2 _repos = getpos _innertrigger _logic setpos _repos exit #flownoff hint "flyoff.sqs has been tripped while fauna.sqs is in loop. Exit fauna.sqs" exit <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> ;flyoff.sqs ;when a unit fires, _main should emit a panic call, then "fly away" for 3 minutes ;placeholder sound used for now _shooter = _this select 0 _main = _this select 1 _logic = _this select 2 _innertrigger = _this select 3 _type = _this select 4 player globalchat "flyoff.sqs executed" ;=========================== ?(_type == "nightjar_sing"): Â goto "nightjar_sing_flyoff" ?(_type == "nightjar_hunt"): Â goto "nightjar_hunt_flyoff" ?(_type == "thrushnightingale_sing_alarm"): Â goto "thrushnightingale_sing_alarm_flyoff" ?(_type == "thrushnightingale_sing"): Â goto "thrushnightingale_sing_flyoff" ;=========================== goto "shutdown" #nightjar_hunt_flyoff player globalchat "nightjar_hunt_flyoff" _repos = getpos _innertrigger _main setpos [_repos select 0, _repos select 1, +250] _main say "bas_af_attack3" ~3 _logic setpos [0,0,0] _main setpos [0,0,0] ~180 goto "shutdown" #shutdown hint "repositioning main trigger" _repos = getpos _innertrigger _main setpos _repos ~5 hint "repositioning check logic" _logic setpos _repos exit The problem seems to in passing the arguments to flyoff.sqs from within fauna.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> _idx = {_x addEventHandler ["fired", {[_this select 0,_main,_logic,_innertrigger,_type] exec "flyoff.sqs"}]} foreach _mainmemory I get the "flyoff.sqs executed" message, so the script certainly execs, but it immediately goes to the shutdown section, which suggests that it isn't picking up any of the array elements which fauna.sqs passes to it. Can someone tell me the right syntax to use here pls? Secondly, when it comes to removing the EH, I get problems. Here's something I lifted from an old General Barron thread. To be honest, I'm completely out of my depth with it: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> {_x addeventhandler ["fired", format [{(_this select 0) removeeventhandler [{fired}, %1]},_idx]]} foreach _mainmemory This gives an error message: '(_this select 0) removeeventhandler [{fired}, scalar |#|bool array string 0xfcffffef]': Error Unknown operator bool Can anyone advise pls? What I need is the same firedEH added to each unit in the trigger, then that same EH removed from those units as soon as one unit fires. Using removeallEHs messes up the other EHs that the units may or may not have. Thanks, CH -
Passing arrays from a script with firedEH
cornhelium replied to cornhelium's topic in OFP : MISSION EDITING & SCRIPTING
Just a couple of questions before I go any further. The ideal solution for me would be to add the EH in the trigger activation field, where I can use the global names of each individual element. Eg. this works fine in the activation field of one of the many _main triggers on the map: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> {_x addEventHandler ["fired",{[nightjar_hunt1_main, nightjar_hunt1_l, nightjar_hunt1_t,"nightjar_hunt"] exec "flyoff.sqs"}]} forEach thislist But the problem is that there seems no reliable way to remove that EH, without screwing up other EHs that the units may be using. I can disable the EH by switching a global variable in the trigger: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> nightjar_hunt1 = true; {_x addEventHandler ["fired",{if (nightjar_hunt1) then {[nightjar_hunt1_main, nightjar_hunt1_l, nightjar_hunt1_t,"nightjar_hunt"] exec "flyoff.sqs",nightjar_hunt1 = false}}]} forEach thislist This gives the effect I'm after (that is, the flyoff.sqs can only be triggered once every x minutes), but the EHs are never removed and I worry about them piling up. I'm aiming to have around 50 of these ambient loops on the map, each running from a single fauna.sqs and flyoff.sqs. Worse, fauna.sqs refreshes the unit list within the _main trigger on every loop, adding EHs to any new unit that has wandered into the trigger and again to units that were previously in the trigger. (Only for "active" sets. That is, sets where the player is within around 550m.) So, the EHs could potentially pile up into the thousands over the course of a mission, even though they only actually do anything 1% of the time. Should I abandon this approach, or is it OK to keep adding "disabled" EHs? I've also tried using the _main trigger field to assign that trigger's EH a global name, so it can be removed either in the trigger or via some looping cleanup.sqs: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> nightjar_hunt1_flyoff = {_x addEventHandler ["fired",{[nightjar_hunt1_main, nightjar_hunt1_l, nightjar_hunt1_t,"nightjar_hunt"] exec "flyoff.sqs"; (_this select 0) removeeventhandler ["fired", nightjar_hunt1_flyoff]}]} forEach thislist This would be the perfect solution I think, only it doesn't work . I get error 'Type Nothing, expected any' within the editor. The problem here seems to be assigning a global ID to an EH within the trigger. Is it only possible to do this from a script? Apologies if this is all a bit confused and amateurish, but hey, I'm a confused amateur Thanks, CH -
Passing arrays from a script with firedEH
cornhelium replied to cornhelium's topic in OFP : MISSION EDITING & SCRIPTING
Wow, thanks guys. I'm gonna chew all this over for a while - will report back soon Cheers, CH -
It's a shame, because once you get over the first objective, the mission is a joy to play. It's >very< difficult to get the camp cleared by 0750hrs without triggering the alert and bringing in hordes of Rebels, then you have to retrieve the notebook/data and huddle up to your RTO in time for the 1-minute window. All just to activate the second objective. The mission really "opens up" afterwards. The open palm forest is great to fight in, as it's easy to keep your team together and you can often spot enemy patrols in time to avoid them Again, I sometimes have problems getting the RTO's evac command at the end. If the mission is updated, I'd really recommend just using "traditional" radio commands. I also have the shelling problems since downloading the update. I hope chaos doesn't get put off by all this though, there's clearly a diamond here that just needs a few tiny flaws taking away. Cheers, CH
-
Great stuff minorthreat, Just one tiny suggestion: could you change the sound of the mounted PK from BIS sounds to JAM sounds, so it sounds the same as the other PKMs on the battlefield? In the BAS_OPCPP config, look for "class BAS_PK_BRDMMounted" and replace: <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> sound[]={"Weapons\AK74full",db10,1}; with <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> sound[]={"\JAM_Sounds\sounds\PKFire.wss",db0,1}; May as well add the reload sound while you're there <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE"> reloadMagazineSound[]={"\JAM_Sounds\sounds\PKReload.wss",db0,0.9}; For my own personal use, I've edited them to use JAM3's mounted MG magazines, but I guess that could break some mission scripts if applied to the official version. Cheers, CH Ps. A TDF retexture of Footmunch's Skyraider would be great, and fairly credible. The French Armee de l'Air used Skyraiders in many African nations including Madagascar next door, eventually donating six to Chad and eight to Gabon. As Tonal is supposed to be a former French colony, they could've donated a couple more to the TDF. Â
-
Hi Stegman, Try one of these two alternative soundpacks. They were part of the JAM3 release: Rainbow soundpack - high quality sounds, very little echo Cinemania soundpack - Boom! Just replace the current JAM_Sounds.pbo with one of these. This won't cause any problems in MP - all players can use any sounds they want. And you can easily make your own JAM_Sounds.pbo, using whatever sounds you want. Apologies Snake Man for hijacking the thread  Cheers, CH
-
Hi Chops, With the exceptions you note, the models (and optics) are inherited from the relevant BIS classes, rather than specified. Whatever weapon model the main OFP config uses, the equivalent JAM weapon will also use. So, the easiest way to get a sexy JAM_AKM is to just run a config mod like FFUR, EECP, Y2K3, or InqMod (still a great, memory friendly mod), and you'll get whatever model the mod uses. Don't like that one? Try another mod! The same applies for the unit & vehicle models. Give it a try and see. One of the goals of JAM3 was to make it as "transparent" as possible to config mods. Cheers bud, CH
-
Looking good mate, been hoping someone would make an SPC pack. You'll find a ton of mags for these in JAM3. Most fire modes and magazine sizes should be covered. The readme will give you all the magazine classnames. Cheers, CH
-
Nasty Class 80' Vietnam PTF Boat
cornhelium replied to Pappy Boyington's topic in ADDONS & MODS: COMPLETE
Hi Pappy, I can't find any mention of a released update. The boat files I have are: cwk_pt.pbo date 9/1/2004 12.54AM 10.8mb CWK_PTF.pbo date 9/1/2004 1.44PM 11.3mb Is there a newer version floating around somewhere (aha) ? Cheers, CH