-
Notifications
You must be signed in to change notification settings - Fork 750
Add MILR - IR Pointer Rangefinder #11261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| z\ace\addons\milr |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| class Extended_PreStart_EventHandlers { | ||
| class ADDON { | ||
| init = QUOTE(call COMPILE_SCRIPT(XEH_preStart)); | ||
| }; | ||
| }; | ||
| class Extended_PreInit_EventHandlers { | ||
| class ADDON { | ||
| init = QUOTE(call COMPILE_SCRIPT(XEH_preInit)); | ||
| }; | ||
| }; | ||
| class Extended_PostInit_EventHandlers { | ||
| class ADDON { | ||
| clientInit = QUOTE(call COMPILE_SCRIPT(XEH_clientInit)); | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| // lol | ||
| class SlotInfo; | ||
| class PointerSlot: SlotInfo { | ||
| compatibleItems[] += {QGVAR(base),QGVAR(000),QGVAR(002),QGVAR(004),QGVAR(006),QGVAR(008),QGVAR(010),QGVAR(012),QGVAR(014),QGVAR(016),QGVAR(018),QGVAR(020),QGVAR(022),QGVAR(024),QGVAR(026),QGVAR(028),QGVAR(030),QGVAR(032),QGVAR(034),QGVAR(036),QGVAR(038),QGVAR(040),QGVAR(042),QGVAR(044),QGVAR(046),QGVAR(048),QGVAR(050),QGVAR(052),QGVAR(054),QGVAR(056),QGVAR(058),QGVAR(060),QGVAR(062),QGVAR(064),QGVAR(066),QGVAR(068),QGVAR(070),QGVAR(072),QGVAR(074),QGVAR(076),QGVAR(078),QGVAR(080),QGVAR(082),QGVAR(084),QGVAR(086),QGVAR(088),QGVAR(090),QGVAR(092),QGVAR(094),QGVAR(096),QGVAR(098),QGVAR(100),QGVAR(110),QGVAR(120),QGVAR(130),QGVAR(140),QGVAR(150),QGVAR(160),QGVAR(170),QGVAR(180),QGVAR(190),QGVAR(200),QGVAR(210),QGVAR(220),QGVAR(230),QGVAR(240),QGVAR(250),QGVAR(260),QGVAR(270),QGVAR(280),QGVAR(290),QGVAR(300)}; | ||
| }; | ||
|
|
||
| class PointerSlot_Rail: PointerSlot { | ||
| class compatibleItems { | ||
| GVAR(base)=1;GVAR(000)=1;GVAR(002)=1;GVAR(004)=1;GVAR(006)=1;GVAR(008)=1;GVAR(010)=1;GVAR(012)=1;GVAR(014)=1;GVAR(016)=1;GVAR(018)=1;GVAR(020)=1;GVAR(022)=1;GVAR(024)=1;GVAR(026)=1;GVAR(028)=1;GVAR(030)=1;GVAR(032)=1;GVAR(034)=1;GVAR(036)=1;GVAR(038)=1;GVAR(040)=1;GVAR(042)=1;GVAR(044)=1;GVAR(046)=1;GVAR(048)=1;GVAR(050)=1;GVAR(052)=1;GVAR(054)=1;GVAR(056)=1;GVAR(058)=1;GVAR(060)=1;GVAR(062)=1;GVAR(064)=1;GVAR(066)=1;GVAR(068)=1;GVAR(070)=1;GVAR(072)=1;GVAR(074)=1;GVAR(076)=1;GVAR(078)=1;GVAR(080)=1;GVAR(082)=1;GVAR(084)=1;GVAR(086)=1;GVAR(088)=1;GVAR(090)=1;GVAR(092)=1;GVAR(094)=1;GVAR(096)=1;GVAR(098)=1;GVAR(100)=1;GVAR(110)=1;GVAR(120)=1;GVAR(130)=1;GVAR(140)=1;GVAR(150)=1;GVAR(160)=1;GVAR(170)=1;GVAR(180)=1;GVAR(190)=1;GVAR(200)=1;GVAR(210)=1;GVAR(220)=1;GVAR(230)=1;GVAR(240)=1;GVAR(250)=1;GVAR(260)=1;GVAR(270)=1;GVAR(280)=1;GVAR(290)=1;GVAR(300)=1; | ||
| }; | ||
| }; | ||
|
|
||
| class asdg_SlotInfo; | ||
| class asdg_FrontSideRail: asdg_SlotInfo { | ||
| class compatibleItems { | ||
| GVAR(base)=1;GVAR(000)=1;GVAR(002)=1;GVAR(004)=1;GVAR(006)=1;GVAR(008)=1;GVAR(010)=1;GVAR(012)=1;GVAR(014)=1;GVAR(016)=1;GVAR(018)=1;GVAR(020)=1;GVAR(022)=1;GVAR(024)=1;GVAR(026)=1;GVAR(028)=1;GVAR(030)=1;GVAR(032)=1;GVAR(034)=1;GVAR(036)=1;GVAR(038)=1;GVAR(040)=1;GVAR(042)=1;GVAR(044)=1;GVAR(046)=1;GVAR(048)=1;GVAR(050)=1;GVAR(052)=1;GVAR(054)=1;GVAR(056)=1;GVAR(058)=1;GVAR(060)=1;GVAR(062)=1;GVAR(064)=1;GVAR(066)=1;GVAR(068)=1;GVAR(070)=1;GVAR(072)=1;GVAR(074)=1;GVAR(076)=1;GVAR(078)=1;GVAR(080)=1;GVAR(082)=1;GVAR(084)=1;GVAR(086)=1;GVAR(088)=1;GVAR(090)=1;GVAR(092)=1;GVAR(094)=1;GVAR(096)=1;GVAR(098)=1;GVAR(100)=1;GVAR(110)=1;GVAR(120)=1;GVAR(130)=1;GVAR(140)=1;GVAR(150)=1;GVAR(160)=1;GVAR(170)=1;GVAR(180)=1;GVAR(190)=1;GVAR(200)=1;GVAR(210)=1;GVAR(220)=1;GVAR(230)=1;GVAR(240)=1;GVAR(250)=1;GVAR(260)=1;GVAR(270)=1;GVAR(280)=1;GVAR(290)=1;GVAR(300)=1; | ||
| }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| #pragma hemtt suppress pw3_padded_arg file | ||
| #define CONCAT(a,b) a####b | ||
| #define ZERO(NUM) class GVAR(NUM): GVAR(base) { \ | ||
| scope = 1; \ | ||
| class ItemInfo: InventoryFlashLightItem_Base_F { \ | ||
| mass = 7; \ | ||
| class Pointer { \ | ||
| irLaserPos = "laser pos"; \ | ||
| irLaserEnd = QUOTE(CONCAT(laser ,NUM)); \ | ||
| irDistance = 5; \ | ||
| }; \ | ||
| class FlashLight {}; \ | ||
| }; \ | ||
| } | ||
|
|
||
| class CfgWeapons { | ||
| class ItemCore; | ||
| class InventoryFlashLightItem_Base_F; | ||
| class GVAR(base): ItemCore { | ||
| scope = 2; | ||
| inertia = 0.1; | ||
| author = ECSTRING(common,ACETeam); | ||
| displayName = "MILR"; | ||
| descriptionUse = "$STR_A3_cfgWeapons_use_pointer_IR0"; | ||
| descriptionShort = CSTRING(descriptionShort); | ||
| picture = "\A3\weapons_F\Data\UI\gear_accv_pointer_CA.paa"; | ||
| model = QPATHTOF(data\ace_milr.p3d); | ||
| class ItemInfo: InventoryFlashLightItem_Base_F { // do not use inheritance on ItemInfo/Pointer as it breaks something | ||
| mass = 7; // big chonky box | ||
| class Pointer { | ||
| irLaserPos = "laser pos"; | ||
| irLaserEnd = "laser dir"; | ||
| irDistance = 5; | ||
| }; | ||
| class FlashLight {}; | ||
| }; | ||
| }; | ||
| ZERO(000);ZERO(002);ZERO(004);ZERO(006);ZERO(008);ZERO(010);ZERO(012);ZERO(014);ZERO(016);ZERO(018);ZERO(020);ZERO(022);ZERO(024);ZERO(026);ZERO(028);ZERO(030);ZERO(032);ZERO(034);ZERO(036);ZERO(038);ZERO(040);ZERO(042);ZERO(044);ZERO(046);ZERO(048);ZERO(050);ZERO(052);ZERO(054);ZERO(056);ZERO(058);ZERO(060);ZERO(062);ZERO(064);ZERO(066);ZERO(068);ZERO(070);ZERO(072);ZERO(074);ZERO(076);ZERO(078);ZERO(080);ZERO(082);ZERO(084);ZERO(086);ZERO(088);ZERO(090);ZERO(092);ZERO(094);ZERO(096);ZERO(098);ZERO(100);ZERO(110);ZERO(120);ZERO(130);ZERO(140);ZERO(150);ZERO(160);ZERO(170);ZERO(180);ZERO(190);ZERO(200);ZERO(210);ZERO(220);ZERO(230);ZERO(240);ZERO(250);ZERO(260);ZERO(270);ZERO(280);ZERO(290);ZERO(300); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ace_milr | ||
| ========== | ||
|
|
||
| IR Pointer capable of rangefinding and adjusting beam zero based on ballistic calculations | ||
|
|
||
|
|
||
| #### Items Added: | ||
| `ace_milr_base` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| PREP(display_init); | ||
| PREP(display_refresh); | ||
| PREP(getRange); | ||
| PREP(keyPress); | ||
| PREP(pfeh); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| #include "script_component.hpp" | ||
| #include "\a3\ui_f\hpp\defineDIKCodes.inc" | ||
|
|
||
| if (!hasInterface) exitWith {}; | ||
|
|
||
| GVAR(currentPointer) = ""; | ||
| GVAR(pfid) = -1; | ||
| GVAR(data) = createHashMap; | ||
|
|
||
| ["ACE3 Equipment", QGVAR(range), [format ["MILR - %1", localize "str_a3_rscdisplayarsenal_stat_range"]], { | ||
| ["range", true] call FUNC(keyPress); | ||
| }, { | ||
| ["range", false] call FUNC(keyPress); | ||
| }, [DIK_TAB, [false, false, false]], false, 0] call CBA_fnc_addKeybind; | ||
|
|
||
| private _fnc_updatePointer = { | ||
| params ["_player"]; | ||
| private _pointer = (_player weaponAccessories (currentWeapon _player)) param [1, ""]; | ||
| if (_pointer == GVAR(currentPointer)) exitWith {}; // fast exit if no change | ||
| GVAR(currentPointer) = _pointer; | ||
|
|
||
| if (_pointer isKindOf [QGVAR(base), configFile >> "CfgWeapons"]) then { | ||
| if (GVAR(pfid) == -1) then { | ||
| TRACE_1("Adding PFEH",_pointer); | ||
| GVAR(pfid) = [LINKFUNC(pfeh), 0, []] call CBA_fnc_addPerFrameHandler; | ||
| }; | ||
| } else { | ||
| if (GVAR(pfid) != -1) then { | ||
| TRACE_1("Stopping PFEH",_pointer); | ||
| [GVAR(pfid)] call CBA_fnc_removePerFrameHandler; | ||
| GVAR(pfid) = -1; | ||
| }; | ||
| }; | ||
| }; | ||
| ["loadout", _fnc_updatePointer] call CBA_fnc_addplayerEventHandler; | ||
| ["weapon", _fnc_updatePointer, true] call CBA_fnc_addplayerEventHandler; | ||
|
|
||
|
|
||
| #ifdef ENABLE_QUICK_TESTING | ||
| player addPrimaryWeaponItem "ace_milr_base"; | ||
| [player] call CBA_fnc_addUnitTrackProjectiles; | ||
| player addItem "ace_rangecard"; | ||
|
|
||
| ["recompile", "recompile", "recompile", { | ||
| private _start = diag_tickTime; | ||
| [] call ACE_PREP_RECOMPILE; | ||
| [] call ace_common_fnc_dumpPerformanceCounters; | ||
| private _end = diag_tickTime; | ||
| systemChat format ["recompile took [%1 ms]", (1000 * (_end - _start)) toFixed 1]; | ||
| if (productVersion #4 == "Diag") then { | ||
| call compile "diag_mergeConfigFile ['P:\z\ace\addons\milr\config.cpp']"; | ||
| }; | ||
| false | ||
| }, {false}, [0x21, [false, false, false]], false] call CBA_fnc_addKeybind; // F Key | ||
| #endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| #include "script_component.hpp" | ||
|
|
||
| ADDON = false; | ||
|
|
||
| PREP_RECOMPILE_START; | ||
| #include "XEH_PREP.hpp" | ||
| PREP_RECOMPILE_END; | ||
|
|
||
| ADDON = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #include "script_component.hpp" | ||
|
|
||
| #include "XEH_PREP.hpp" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| #include "script_component.hpp" | ||
|
|
||
| class CfgPatches { | ||
| class ADDON { | ||
| name = COMPONENT_NAME; | ||
| units[] = {}; | ||
| weapons[] = {QGVAR(base)}; | ||
| requiredVersion = REQUIRED_VERSION; | ||
| requiredAddons[] = {"ace_interaction"}; | ||
| author = ECSTRING(common,ACETeam); | ||
| authors[] = {"PabstMirror"}; | ||
| url = ECSTRING(main,URL); | ||
| VERSION_CONFIG; | ||
| }; | ||
| }; | ||
|
|
||
| #include "CfgEventHandlers.hpp" | ||
| #include "CfgWeapons.hpp" | ||
| #include "CfgJointRails.hpp" | ||
|
|
||
| class GVAR(display) { | ||
| onLoad = QUOTE(call FUNC(display_init)); | ||
| idd = -1; | ||
| class Controls {}; | ||
| }; | ||
| class RscStructuredText; | ||
| class GVAR(structuredText): RscStructuredText { | ||
| colorText[] = {0.7,0.7,0.7,1}; | ||
| size = 0.05; // not safezone scaled | ||
| shadow = 0; | ||
| }; |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| ambient[]={1,0.98500001,0.97000003,1}; | ||
| diffuse[]={1,0.98500001,0.97000003,1}; | ||
| forcedDiffuse[]={0,0,0,0}; | ||
| emmisive[]={0,0,0,1}; | ||
| specular[]={0.0001,0.0001,0.0001,0}; | ||
| specularPower=2000; | ||
| PixelShaderID="Super"; | ||
| VertexShaderID="Super"; | ||
| class Stage1 | ||
| { | ||
| texture="#(argb,8,8,3)color(0.5,0.5,1,1)"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {1.0,0.0,0.0}; | ||
| up[] = {0.0,1.0,0.0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
| class Stage2 | ||
| { | ||
| texture = "#(argb,8,8,3)color(0.5,0.5,0.5,1,DT)"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {5,-4,0}; | ||
| up[] = {8,1.931601,0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
| class Stage3 | ||
| { | ||
| texture = "#(argb,8,8,3)color(0,0,0,0,MC)"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {1.0,0.0,0.0}; | ||
| up[] = {0.0,1.0,0.0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
| class Stage4 | ||
| { | ||
| texture="#(argb,8,8,3)color(0,1,1,1)"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {1.0,0.0,0.0}; | ||
| up[] = {0.0,1.0,0.0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
| class Stage5 | ||
| { | ||
| texture="#(argb,8,8,3)color(1,1,1,1)"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {1.0,0.0,0.0}; | ||
| up[] = {0.0,1.0,0.0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
| class Stage6 | ||
| { | ||
| texture = "#(ai,64,128,1)fresnel(1.5,1.22)"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {1.0,0.0,0.0}; | ||
| up[] = {0.0,1.0,0.0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
| class Stage7 | ||
| { | ||
| texture = "a3\data_f\env_land_co.paa"; | ||
| uvSource = "tex"; | ||
| class uvTransform | ||
| { | ||
| aside[] = {1.0,0.0,0.0}; | ||
| up[] = {0.0,1.0,0.0}; | ||
| dir[] = {0.0,0.0,0.0}; | ||
| pos[] = {0.0,0.0,0.0}; | ||
| }; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| import bpy | ||
| import bmesh | ||
| import math | ||
|
|
||
| def add_vertex_to_vgroup(new_cord, group_name): | ||
| me = obj.data | ||
| # Create a BMesh instance to handle the edit | ||
| bm = bmesh.new() | ||
| bm.from_mesh(me) | ||
| # Add a new vertex at a specific coordinate | ||
| new_vert = bm.verts.new(new_cord) | ||
| bm.verts.index_update() # Update indices after adding new vertex | ||
| new_index = new_vert.index | ||
| # Write the BMesh data back to the mesh and clean up (destroys new_vert) | ||
| bm.to_mesh(me) | ||
| bm.free() | ||
| me.update() | ||
| vgroup = obj.vertex_groups.new(name=group_name) | ||
| if vgroup.name != group_name: | ||
| raise Exception("Vertex group name mismatch") | ||
| vgroup.add([new_index], 1.0, 'ADD') | ||
|
|
||
|
|
||
| # Get the active object's mesh | ||
| obj = bpy.context.active_object | ||
| if not(obj and obj.type == 'MESH'): | ||
| raise Exception("not selected") | ||
|
|
||
| # start by cleaning out all old groups | ||
| obj.vertex_groups.clear() | ||
|
|
||
| base_x = 0.14 | ||
| base_y = 0.0 | ||
| base_z = 0.05 | ||
| delta_x = 0.1 | ||
| add_vertex_to_vgroup((base_x - delta_x, base_y, base_z), "laser pos") | ||
| add_vertex_to_vgroup((base_x, base_y, base_z), "laser dir") | ||
|
|
||
| count = 0 | ||
| for i in range(0, 100, 2): | ||
| count += 1 | ||
| angle = i / 10 | ||
| z = base_z + math.tan(angle/1000) * delta_x | ||
| new_cord = (base_x, base_y, z) | ||
| group_name = f"laser {i:03}" | ||
| print(f"adding {group_name} at {new_cord}") | ||
| add_vertex_to_vgroup(new_cord, group_name) | ||
|
|
||
| for i in range(100, 310, 10): | ||
| count += 1 | ||
| angle = i / 10 | ||
| z = base_z + math.tan(angle/1000) * delta_x | ||
| new_cord = (base_x, base_y, z) | ||
| group_name = f"laser {i:03}" | ||
| print(f"adding {group_name} at {new_cord}") | ||
| add_vertex_to_vgroup(new_cord, group_name) | ||
|
|
||
| print(f"finished with {count} total") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
|
|
||
| out_compatibleArray = " compatibleItems[] += {QGVAR(base)," | ||
| out_compatibleClasses = " GVAR(base)=1;" | ||
| out_weapons = "" | ||
|
|
||
| def addItem(i): | ||
| global out_compatibleArray, out_compatibleClasses, out_weapons | ||
| name = f"GVAR({i:03})" | ||
| out_compatibleArray += f"Q{name}," | ||
| out_compatibleClasses += f"{name}=1;" | ||
| out_weapons += f"ZERO({i:03});" | ||
|
|
||
| for i in range(0, 100, 2): | ||
| addItem(i) | ||
| for i in range(100, 302, 10): | ||
| addItem(i) | ||
|
|
||
|
|
||
|
|
||
| out_compatibleArray = out_compatibleArray.rstrip(",") + "};" | ||
|
|
||
| print("--- GENERATED OUTPUT ---") | ||
| print("--- compat array:") | ||
| print(out_compatibleArray) | ||
| print("--- compat classes:") | ||
| print(out_compatibleClasses) | ||
| print("--- weapons:") | ||
| print(out_weapons) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrong transformation matrix, dir should be 0,0,1
But this is copy pasted wrongly everywhere.
Also tab indent, while .editorconfig stipulates 4-space.