TedHo
Member-
Content Count
152 -
Joined
-
Last visited
-
Medals
-
Medals
Everything posted by TedHo
-
Scripts for rifle range & CQB complex
TedHo replied to M0n3y's topic in ARMA 3 - MISSION EDITING & SCRIPTING
If no answer pops up, I would recommend you unpack Arma 3's weapon range missions and take a look at how BIS did it. I'm sure you'll find all you need in there. -
[RELEASE]Zeus Mission Builder
TedHo replied to austin_medic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I understand :( I guess if you want to export selected objects only, "curatorSelected" would return an array of arrays containing all entities selected in the Zeus interface. Format: [selectedObjects, Selected Groups, Selected Markers, Selected Waypoints]. -
[RELEASE]Zeus Mission Builder
TedHo replied to austin_medic's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi austin_medic, yours is a great tool for mission building, and is definitely much, much easier to use than GID. However, after building a short mission using your wonderful mission builder, I felt that the feature I needed was not to export everything on the map to a completed "mission.sqm", but to be able to selectively export a few entities into a .sqf file as this will make it easier (for me at least) to make updates to existing missions built using traditional methods. I am wondering if you have plans to include that feature in the future? Inspired by your work, I wrote this simple script that allowed me to select any number of objects in Zeus and then hit [Ctrl+C] to export them to sqf code (createVehicle, setPos, setVectorDirAndUp, enableSimulation). [Ctrl+A] exports all Zeus-editable objects, [Ctrl+Shife+E] makes nearby objects editable by Zeus, and [Ctrl+S]/[Ctrl+Shift+S] toggles "enableSimulation" for selected objects. The way I wrote it, the script would only support empty vehicles/objects, their position/orientation and simulation status. It wouldn't work with units/groups/markers/waypoints/modules/containers with stuff inside as I personally felt comfortable with doing those via scripting/2D editor. But if you ever decide to expand your mission builder to include selective-export/sqf-code functionality, feel free to take a peek at the code below. Whether or not you have plans/time for such features, this is definitely a great tool and I hope you will continue expanding it. Thanks! //Usage //Place Zeus module in editor named "ZE_Zeus", then execVM the following code. //Object Export function ZE_ExportEntities = { ZE_ObjectsExport = []; _mode = toLower (_this select 0); //Register objects to export switch (_mode) do { case "all": { { _obj = _x; _class = typeOf _obj; _pos = getPosATL _obj; _vec = [vectorDir _obj, vectorUp _obj]; _sim = simulationEnabled _obj; _pack = [_class,_pos,_vec,_sim]; ZE_ObjectsExport = ZE_ObjectsExport + [_pack]; } forEach (curatorEditableObjects ZE_Zeus); }; case "sel": { { _obj = _x; if (typeName _obj == typeName objNull) Then { _class = typeOf _obj; _pos = getPosATL _obj; _vec = [vectorDir _obj, vectorUp _obj]; _sim = simulationEnabled _obj; _pack = [_class,_pos,_vec,_sim]; ZE_ObjectsExport = ZE_ObjectsExport + [_pack]; }; } forEach (curatorSelected select 0); }; }; //Compile _compiledTxt = "//Exported with ZE"; { private ["_addTxt"]; _objArr = _x; _class = _objArr select 0; _pos = _objArr select 1; _vec = _objArr select 2; _sim = _objArr select 3; if (_sim) Then { _addTxt = format [" _object = createVehicle [""%1"", [0,0,0], [], 0, ""CAN_COLLIDE""]; _object setPosATL %2; _object setVectorDirAndUp %3; ", _class, _pos, _vec]; } else { _addTxt = format [" _object = createVehicle [""%1"", [0,0,0], [], 0, ""CAN_COLLIDE""]; _object enableSimulation %4; _object setPosATL %2; _object setVectorDirAndUp %3; ", _class, _pos, _vec, _sim]; }; _compiledTxt = _compiledTxt + _addTxt; } forEach ZE_ObjectsExport; copyToClipboard _compiledTxt; }; //Enable editing function ZE_AddCuratorObjects = { _nearObjs = (getPos curatorCamera) nearObjects 25; ZE_Zeus addCuratorEditableObjects [_nearObjs,false]; }; //Handle Object simulation ZE_ObjectSimulation = { _mode = toLower (_this select 0); switch (_mode) do { case "enable": { {_x enableSimulation true} forEach (curatorSelected select 0); }; case "disable": { {_x enableSimulation false} forEach (curatorSelected select 0); }; }; }; //Key Stroke Handler key_ctrl = 29; key_shift = 42; key_c = 46; key_a = 30; key_e = 18; key_s = 31; pressed_ctrl = false; pressed_shift = false; pressed_c = false; pressed_a = false; pressed_e = false; pressed_s = false; //Add Keystroke EH ZE_AddKeyStrokeEH = { ZE_keyDownEHId = findDisplay 312 displayAddEventHandler ["KeyDown",{ if (_this select 1 == key_ctrl) then {pressed_ctrl = true;}; if (_this select 1 == key_shift) then {pressed_shift = true;}; if (_this select 1 == key_c) then {pressed_c = true;}; if (_this select 1 == key_a) then {pressed_a = true;}; if (_this select 1 == key_e) then {pressed_e = true;}; if (_this select 1 == key_s) then {pressed_s = true;}; }]; ZE_keyUpEHId = findDisplay 312 displayAddEventHandler ["KeyUp",{ if (_this select 1 == key_ctrl) then {pressed_ctrl = false;}; if (_this select 1 == key_shift) then {pressed_shift = false;}; if (_this select 1 == key_c) then {pressed_c = false;}; if (_this select 1 == key_a) then {pressed_a = false;}; if (_this select 1 == key_e) then {pressed_e = false;}; if (_this select 1 == key_s) then {pressed_s = false;}; }]; ["ZE_KeyStroke", "onEachFrame", { if (pressed_ctrl && pressed_a) ExitWith { ["ALL"] call ZE_ExportEntities; hint ""; ["CuratorAddAddons",["ZEUS objects copied to clipboard."]] calL BIS_fnc_showNotification; pressed_a = false; }; if (pressed_ctrl && pressed_c) ExitWith { ["SEL"] call ZE_ExportEntities; ["CuratorAddAddons",["SELETED objects copied to clipboard."]] calL BIS_fnc_showNotification; pressed_c = false; }; if (pressed_ctrl && pressed_shift && pressed_e) ExitWith { [] call ZE_AddCuratorObjects; ["CuratorAddAddons",["Nearby objects ENABLED for Zeus."]] calL BIS_fnc_showNotification; pressed_e = false; }; if (pressed_ctrl && pressed_shift && pressed_s) ExitWith { ["DISABLE"] call ZE_ObjectSimulation; ["CuratorAddAddons",["DISABLED simulation for selected objects."]] calL BIS_fnc_showNotification; pressed_s = false; }; if (pressed_ctrl && pressed_s) ExitWith { ["ENABLE"] call ZE_ObjectSimulation; ["CuratorAddAddons",["ENABLED simulation for selected objects."]] calL BIS_fnc_showNotification; pressed_s = false; }; }] call BIS_fnc_addStackedEventHandler; }; //Remove Keystroke EH ZE_RemoveKeyStrokeEH = { findDisplay 312 displayRemoveEventHandler ["KeyDown",ZE_keyDownEHId]; findDisplay 312 displayRemoveEventHandler ["KeyUp",ZE_keyUpEHId]; ["ZE_KeyStroke", "onEachFrame"] call BIS_fnc_removeStackedEventHandler; }; //Enable/disable EH on Zeus start/end [] spawn { while {true} do { waitUntil {sleep 0.1; !(isNull findDisplay 312)}; [] spawn ZE_AddKeyStrokeEH; waitUntil {sleep 0.1; isNull findDisplay 312}; [] spawn ZE_RemoveKeyStrokeEH; }; }; ADD: Also a [Ctrl+Z] undo last change function would work wonders. Although I'm not sure if that's ever possible in Arma. Just a thought. -
Question: loop a ammo effect modul ?
TedHo replied to stephsen's topic in ARMA 3 - MISSION EDITING & SCRIPTING
The easiest way to do this would be to put the first part in your init.sqf. //Spawn flares function IOT_SpawnFlare = { _pos = [_this,0,[0,0,0],[[]]] call BIS_fnc_param; _height = [_this,1,150,[0]] call BIS_fnc_param; _radius = [_this,2,100,[0]] call BIS_fnc_param; _class = [_this,3,"F_40mm_Red",[""]] call BIS_fnc_param; _speed = [_this,4,15,[0]] call BIS_fnc_param; _fallSpeed = [_this,5,-1,[0]] call BIS_fnc_param; _rx = random _speed; _ry = sqrt(_speed*_speed - _rx*_rx); if (random 1 > 0.5) Then { _rx = - _rx; }; if (random 1 > 0.5) Then { _ry = - _ry; }; _velocity = [_rx,_ry,_fallSpeed]; _pos set [2,(_pos select 2) + _height]; _flare = createVehicle [_class, _pos, [], _radius, "FLY"]; _flare setVelocity _velocity; }; And then put the second part in the onActivation field of a trigger. When you activate this trigger flares should start spawning in 20 seconds. //Spawning flares at random intervals [] spawn { sleep 20; IOT_SpawnFlare_1 = true; [] spawn { waitUntil {sleep 1; missionNamespace getVariable ["IOT_SpawnFlare_1",false]}; while {missionNamespace getVariable ["IOT_SpawnFlare_1",false]} do { [markerPos "IOT_FlarePos_1", 150, 50, "F_40mm_Red",15,-0.1] spawn IOT_SpawnFlare; sleep ((random 30) + 30); }; }; }; Then create a second trigger, and put this into its activation field. When this trigger fires flares stop spawning. IOT_Spawnflare_1 = false; And do remember to create a marker (F6) in the editor called "IOT_Flarepos_1" where you want your flares to spawn. If you want mortar rounds just set spawn height to 0. In the second part of the script you can change the parameters for the spawn flare function. //Change: [markerPos "IOT_FlarePos_1", 150, 50, "F_40mm_Red",15,-0.1] spawn IOT_SpawnFlare; //To: [markerPos "IOT_FlarePos_1", 0, 50, "ammo 82mm_He",15,-0.1] spawn IOT_SpawnFlare; I have not tested this on mortar rounds so you might have to adjust the params a bit. They are: [spawn position, Spawn height, Random spawn radius, Ammo Classname, Horizontal speed (direction is random), Vertical speed] Hope this helps. Cheers! -
Question: loop a ammo effect modul ?
TedHo replied to stephsen's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am not sure about this but I think the module is only meant to activate once. It would be easier to just spawn rounds using createVehicle and setVelocity and use a while loop with random sleep intervals. The following code spawns red flares every 30-60 seconds at random locations around the marker "IOT_FlarePos_1" as long as "IOT_SpawnFlare_1 == true". Feel free to adapt as you see fit. //Spawn flares function IOT_SpawnFlare = { _pos = [_this,0,[0,0,0],[[]]] call BIS_fnc_param; _height = [_this,1,150,[0]] call BIS_fnc_param; _radius = [_this,2,100,[0]] call BIS_fnc_param; _class = [_this,3,"F_40mm_Red",[""]] call BIS_fnc_param; _speed = [_this,4,15,[0]] call BIS_fnc_param; _fallSpeed = [_this,5,-1,[0]] call BIS_fnc_param; _rx = random _speed; _ry = sqrt(_speed*_speed - _rx*_rx); if (random 1 > 0.5) Then { _rx = - _rx; }; if (random 1 > 0.5) Then { _ry = - _ry; }; _velocity = [_rx,_ry,_fallSpeed]; _pos set [2,(_pos select 2) + _height]; _flare = createVehicle [_class, _pos, [], _radius, "FLY"]; _flare setVelocity _velocity; }; //Spawning flares at random intervals [] spawn { sleep 20; IOT_SpawnFlare_1 = true; [] spawn { waitUntil {sleep 1; missionNamespace getVariable ["IOT_SpawnFlare_1",false]}; while {missionNamespace getVariable ["IOT_SpawnFlare_1",false]} do { [markerPos "IOT_FlarePos_1", 150, 50, "F_40mm_Red",15,-0.1] spawn IOT_SpawnFlare; sleep ((random 30) + 30); }; }; }; -
If you are willing to dive into BIS campaign pbos, in mission C_m02 they used fsm scripts (vehicleFlow.fsm and convoyFlow.fsm) to maintain convoy order, spacing, and speed. Works better than any other script I've seen out there. Worked with any combination of vehicles and allows you to set a speed limit as well as convoy order.
-
Help for text on screen (3 questions)
TedHo replied to Wiki's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hi Wiki, I think BIS uses function BIS_fnc_camp_showOSD to automatically display time and location, however it is only defined in the A3 campaign description.ext, if you want to use it in your own missions just add this to your description.ext class CfgFunctions { class BIS { tag = "BIS"; class Timeline { file = "a3\missions_f_epa\Campaign_shared\Functions\Timeline"; class camp_showOSD {}; }; }; }; and then call [] call BIS_fnc_camp_showOSD I think what this does is it displays time and location (only supports Altis and Stratis). I could not get it to display mission name/character name without getting deep into the campaign config files. So I've been using my own function which does pretty much the same things except that it also receives mission title and player name as input parameters. Date and time is auto-detected. ["John Hawkins", "Northern Altis", "JUST ANOTHER DAY"] call IOT_fnc_missiontile; ["John Hawkins", "Northern Altis"] call IOT_fnc_missiontile; ["John Hawkins"] call IOT_fnc_missiontile; Here's the function. Just put it in a sqf file and define it in your description.ext. /* Author: ted_hou Description: Shows mission information in A3 style. - 'Mission Title' (Optional) - Time - Player Name - Location (Optional) Parameter(s): 0 : STRING - player name 1 (Optional): STRING - Location 2 (Optional): STRING - Mission title Returns: nothing Example: ["John Hawkins", "Northern Altis", "JUST ANOTHER DAY"] call IOT_fnc_missiontile; ["SUPERMAN", "Northern Altis"] call IOT_fnc_missiontile; ["SUPERMAN"] call IOT_fnc_missiontile; */ _playerName = _this select 0; _location = _this select 1; _title = _this select 2; _yy = date select 0; _mo = date select 1; _dd = date select 2; _hh = date select 3; _mm = date select 4; switch (count _this) do { case 1: { [ [ [format ["%1/%2/%3 ",_mo,_dd,_yy],"align = 'right' valign = 'bottom' size = '1'"], [format ["%1",[dayTime,"HH:MM"] call BIS_fnc_timeToString],"align = 'right' valign = 'bottom' size = '1' font = 'PuristaSemibold'"], ["","<br/>"], [_playerName,"align = 'right' valign = 'bottom' size = '1'"] ], -.75, 1.15, true, "<t>%1</t>" ] spawn BIS_fnc_typeText2; }; case 2: { [ [ [format ["%1/%2/%3 ",_mo,_dd,_yy],"align = 'right' valign = 'bottom' size = '1'"], [format ["%1",[dayTime,"HH:MM"] call BIS_fnc_timeToString],"align = 'right' valign = 'bottom' size = '1' font = 'PuristaSemibold'"], ["","<br/>"], [_playerName,"align = 'right' valign = 'bottom' size = '1'"], ["","<br/>"], [_location,"align = 'right' size = '1'"] ], -.75, 1.15, true, "<t>%1</t>" ] spawn BIS_fnc_typeText2; }; case 3: { [ [ [format ["'%1'", _title],"align = 'right' valign = 'bottom' size = '1' font = 'PuristaSemibold'"], ["","<br/>"], [format ["%1/%2/%3 ",_mo,_dd,_yy],"align = 'right' valign = 'bottom' size = '1'"], [format ["%1",[dayTime,"HH:MM"] call BIS_fnc_timeToString],"align = 'right' valign = 'bottom' size = '1' font = 'PuristaSemibold'"], ["","<br/>"], [_playerName,"align = 'right' valign = 'bottom' size = '1'"], ["","<br/>"], [_location,"align = 'right' size = '1'"] ], -.75, 1.15, true, "<t>%1</t>" ] spawn BIS_fnc_typeText2; }; default {}; }; -
Oh yes, the voice actors did a fantastic job. And for the katas anmiation: unit switchMove "AmovPercMstpSnonWnonDnon_exerciseKata"; Here it is! intro_cmpTitle = { showChat FALSE; _x = 0; _y = 0.3; _duration = 5; _fadeInTime = 2; ["bis_fnc_dynamicText"] spawn BIS_fnc_blackOut; _introText = format["%1","<t font='PuristaBold' align='center' valign='center' size='1'>AN ARMA 3 CAMPAIGN</t>"]; [_introText,_x,_y,_duration,_fadeInTime,0,100] spawn bis_fnc_dynamicText; sleep (_duration+2*_fadeInTime); _introText = format["%1","<t font='PuristaBold' align='center' valign='center' size='2'>IN OUR TIME</t>"]; [_introText,_x,_y,_duration,_fadeInTime,0,100] spawn bis_fnc_dynamicText; sleep (_duration+2*_fadeInTime); ["bis_fnc_dynamicText"] spawn BIS_fnc_blackIn; sleep 2; };
-
Hi Inlesco, Glad you like the campaign! And yes the voice ators did a fantastic job. Please feel free to tell me about pieces of plots you found odd. There are plenty of plots I wanted to change but never had time to. I'll watch out for them in the future though. Thanks.
-
I apologize to all those who had trouble getting the campaign version to load. This is due to a packing error on my part making Arma ignore the .pbo content. I will ask the armaholic admin to upload a fixed version soon. Meanwhile you can download the fixed version here: Download link for fixed version (1.0.6.1) Thanks Old_Painless, for providing a solution and confirming that the addon version works. Releasing a campaign as an addon may seem weird but it was the only way to publish them on steam at the time. ---------- Post added at 01:04 ---------- Previous post was at 00:31 ---------- Thank you Clausewitz for your GREAT comment. I am glad that you enjoyed it. The last mission was my favorite too and was a ton of fun developing. Hi Wiki, I'm glad you asked. There would be 5 missions + 1 hub + 1 skirmish mission in the sequal. I've finished the hub and missions 1-3, just started working on the mission 4. Finishing missions 4 and 5 would still take about a month. Voice acting would probably take another. It is relatively easy to tell a story but I've had some difficulty creating interesting combat scenarios so I've been going back and forth on mission designs. But I'll keep working on it until I am confident enough to publish it. Thanks!
-
Make sure C01_InOurTime_MANW.pbo is in the campaigns folder if you haven't already done that. That should work. Anyway, you could also try subscribing to the addon version on steam workshop. Just subscribe and activate in A3 Launcher. Hope this helps.
-
The Memory is easily the best Arma 2 campaign I've ever played. Fantastic work! Great dubbing and amazing scripting! Puts the BIS campaigns to shame IMO... Thanks and hope you guys will keep making quality work like this.
-
Yes, these are all great ideas. Vietnam era weapons can be found in RobertHammer's M4 Pack, and HLC AK/M60 packs. I'm not sure where we would find good vietnam uniforms for both the US and the OPFOR soldiers. And for insertion missions you would need a good mod for the Huey helicopter (HAFM maybe?). It would be interesting to see a mission like that.
-
Great, I'm glad you enjoyed it. : ) I'm about halfway done with the sequel, which would be longer and would allow more freedom. I expect to be able to release the final version in January or February 2015. Thanks for your great comment and support.
-
try the armaholic or steam workshop link, should both be updated. if you still run into trouble pls let me know
-
Hi Wiki, thanks for the report. People were having trouble with the little bird since the dev build helicopter update. I recently released an update (v1.06) intended to fix this. However, I just found that the armaholic download link still links to the 1.05 version. I'll ask the host to upload the new version soon. Meanwhile, you could use console command "player moveInCargo Bee2" to teleport yourself back into the chopper. Hope this helps!
-
[Functions] UnitCapture/UnitPlay for Infantry Units in ArmA 3
TedHo replied to TedHo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Hey Iceman77, thanks for the comment! I had imagined the thread title would be misleading but I couldn't really think of a proper title... Anyway I'm glad you find this interesting. It's nowhere near complete right now, and I'll be making improvements along the way. Thanks. ---------- Post added at 21:35 ---------- Previous post was at 21:34 ---------- Hi Foxhound! Thanks for posting the armaholic page! Much appreciated! :) -
[Functions] UnitCapture/UnitPlay for Infantry Units in ArmA 3
TedHo replied to TedHo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Thanks, IndeedPete. I'm a bit unfamiliar with animating vehicle parts (wheels, engine, dirt trails...). But I might do ground vehicles in the future if I ever figure out an easy way to do that. -
Hi reforger, Plenty of thanks for voting! Glad you enjoyed it! ---------- Post added at 13:18 ---------- Previous post was at 13:13 ---------- Hi Jona33, Thanks for your great comment! And for the great story in the third mission. I do believe the freedom and the fact that every playthrough is different is what make ArmA great. Glad you enjoyed the campaign. I am still working slowly on the sequel and I might be able to finish it sometime next year. Cheers!
-
Detect loaded addons on mission start?
TedHo replied to TedHo's topic in ARMA 3 - MISSION EDITING & SCRIPTING
Awesome! Thanks a lot! -
Hi, I'm just wondering whether there is a function that returns a list of loaded addons when called. I am just trying to detect whether certain weapon mods are loaded and add these weapons to an ammobox. Thanks!
-
There is any way to emulate a flashlight without using a flashlight?
TedHo replied to Icaruk's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I am trying to include a handheld flashlight feature in my missions and I am wondering about the same question here. -
Hi ballard_44, Thanks for your great feedback! Glad you liked it! I think there is indeed a thing or two I could do to fix the non-responsive AI. I'll include it in the next patch. Really helpful info. Thanks! ---------- Post added at 10:15 ---------- Previous post was at 10:14 ---------- Hi colonel stagler, Glad you liked it! I'll be making a sequel, 'Bell Tolls', over the next few months!
-
kbTell - how to change the volume of the sound?
TedHo replied to Undeceived's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I've been wondering about the same question. I've yet failed to find a way to set the volume in .bikb files, but you could always use audio editors to amp up the volume. -
Is there a code for "abandoned" vehicles?
TedHo replied to majorexperimental's topic in ARMA 3 - MISSION EDITING & SCRIPTING
I usually use the canMove command to detect vehicles that have no driver, or is too damaged to move (however, canMove does not detect fuel levels.). {canMove _x} count [T1, T2, T3, T4, T5,T6,T7,T8,T9,T10,T11,T12,T13] == 0