{"id":1608,"date":"2025-10-16T23:45:54","date_gmt":"2025-10-16T22:45:54","guid":{"rendered":"https:\/\/grimms3dworlds.ddns.net\/?page_id=1608"},"modified":"2025-10-16T23:45:54","modified_gmt":"2025-10-16T22:45:54","slug":"faction-setup","status":"publish","type":"page","link":"https:\/\/grimms3dworlds.ddns.net\/index.php\/faction-setup\/","title":{"rendered":"Faction setup"},"content":{"rendered":"\n<style>\n\/* Container Styling *\/\n#cod2-faction-container {\n    font-family: 'Segoe UI', Arial, sans-serif;\n    max-width: 900px;\n    margin: 0 auto;\n    padding: 20px;\n    background: #ffffff;\n    border-radius: 8px;\n    box-shadow: 0 4px 12px rgba(0,0,0,0.1);\n}\n\n\/* Heading Styling *\/\n#cod2-faction-container h1,\n#cod2-faction-container h2,\n#cod2-faction-container h3 {\n    color: #1a3c5e;\n    margin-bottom: 15px;\n    padding-bottom: 8px;\n}\n#cod2-faction-container h1 {\n    border-bottom: 2px solid #e0e6ed;\n}\n#cod2-faction-container h2 {\n    border-bottom: 2px solid #e0e6ed;\n}\n#cod2-faction-container h3 {\n    border-bottom: 1px solid #e0e6ed;\n}\n\n\/* Paragraph Styling *\/\n#cod2-faction-container p {\n    color: #4a4a4a;\n    line-height: 1.6;\n}\n\n\/* Note Section Styling *\/\n#cod2-faction-container .note {\n    background: #e7f3fe;\n    border: 1px solid #b6d4fe;\n    padding: 15px;\n    color: #0c5460;\n    border-radius: 5px;\n    margin-bottom: 20px;\n}\n\n\/* List Styling *\/\n#cod2-faction-container ul,\n#cod2-faction-container ol {\n    color: #4a4a4a;\n    padding-left: 20px;\n    margin-bottom: 20px;\n}\n#cod2-faction-container ul li,\n#cod2-faction-container ol li {\n    margin-bottom: 8px;\n}\n\n\/* Code Block Styling *\/\n#cod2-faction-container pre {\n    background: #1e1e1e;\n    color: #ffffff;\n    padding: 15px;\n    border-radius: 5px;\n    font-size: 14px;\n    line-height: 1.4;\n    max-height: 400px;\n    overflow-y: auto;\n    overflow-x: auto;\n    white-space: pre;\n    position: relative;\n}\n\n\/* Copy Button Styling *\/\n#cod2-faction-container .copy-button {\n    position: absolute;\n    top: 10px;\n    right: 10px;\n    background: #007bff;\n    color: #ffffff;\n    border: none;\n    padding: 8px 12px;\n    border-radius: 4px;\n    cursor: pointer;\n    font-size: 12px;\n}\n#cod2-faction-container .copy-button.copied {\n    background: #28a745;\n}\n\n\/* Table Styling *\/\n#cod2-faction-container table {\n    width: 100%;\n    border-collapse: collapse;\n    margin-bottom: 20px;\n}\n#cod2-faction-container th,\n#cod2-faction-container td {\n    border: 1px solid #ddd;\n    padding: 8px;\n    text-align: left;\n    color: black;\n}\n#cod2-faction-container th {\n    background: #f8f9fa;\n}\n\n\/* Image Styling *\/\n#cod2-faction-container .faction-image {\n    display: block;\n    width: 800px;\n    margin: 0 auto;\n}\n<\/style>\n\n<div id=\"cod2-faction-container\">\n    <h1>Call of Duty 2 Faction Setup<\/h1>\n    <p>To configure player factions in Call of Duty 2 multiplayer custom maps, you need to add specific code to your map&#8217;s .gsc file. This file, typically named <code>mp_yourmapnamehere.gsc<\/code>, is located in the <code>main\/maps\/mp<\/code> directory of your Call of Duty 2 installation or within an IWD file.<\/p>\n\n    <h2>Locating and Editing the GSC File<\/h2>\n    <p>If your map already has a .gsc file, it usually contains a <code>main()<\/code> function, which may look like this:<\/p>\n    <pre>\nmain()\n{\n    maps\\mp\\mp_brecourt_fx::main();\n    maps\\mp\\_load::main();\n}\n    <button class=\"copy-button\" onclick=\"copyCode(this)\">Copy<\/button>\n    <\/pre>\n    <p class=\"note\"><strong>Note:<\/strong> Use your preferred text editor to modify the .gsc file. Ensure you back up the file before making changes.<\/p>\n\n    <h2>Adding Faction Code<\/h2>\n    <p>Inside the <code>main()<\/code> function, add the following code to set up factions and character models:<\/p>\n    <pre>\ngame[\"allies\"] = \"american\";\ngame[\"axis\"] = \"german\";\n\ngame[\"attackers\"] = \"allies\";\ngame[\"defenders\"] = \"axis\";\n\ngame[\"american_soldiertype\"] = \"normandy\";\ngame[\"german_soldiertype\"] = \"normandy\";\n    <button class=\"copy-button\" onclick=\"copyCode(this)\">Copy<\/button>\n    <\/pre>\n    <p>This code configures your custom map to use American versus German factions with Normandy character models.<\/p>\n\n    <h3>Faction Configuration<\/h3>\n    <p>The first two lines define the factions:<\/p>\n    <ul>\n        <li><strong>Allies:<\/strong> Can be set to <code>american<\/code>, <code>british<\/code>, or <code>russian<\/code>.<\/li>\n        <li><strong>Axis:<\/strong> Must be set to <code>german<\/code>.<\/li>\n    <\/ul>\n\n    <h3>Character Model Configuration<\/h3>\n    <p>The last two lines specify the character models used for each faction. Below are the available options:<\/p>\n    <table>\n        <tr>\n            <th>Faction<\/th>\n            <th>Code<\/th>\n            <th>Description<\/th>\n        <\/tr>\n        <tr>\n            <td>British<\/td>\n            <td><code>game[\"british_soldiertype\"] = \"normandy\";<\/code><\/td>\n            <td>Normandy character model<\/td>\n        <\/tr>\n        <tr>\n            <td>British<\/td>\n            <td><code>game[\"british_soldiertype\"] = \"africa\";<\/code><\/td>\n            <td>Africa character model<\/td>\n        <\/tr>\n        <tr>\n            <td>American<\/td>\n            <td><code>game[\"american_soldiertype\"] = \"normandy\";<\/code><\/td>\n            <td>Normandy character model<\/td>\n        <\/tr>\n        <tr>\n            <td>Russian<\/td>\n            <td><code>game[\"russian_soldiertype\"] = \"coats\";<\/code><\/td>\n            <td>Coats character model<\/td>\n        <\/tr>\n        <tr>\n            <td>Russian<\/td>\n            <td><code>game[\"russian_soldiertype\"] = \"padded\";<\/code><\/td>\n            <td>Padded character model<\/td>\n        <\/tr>\n        <tr>\n            <td>German<\/td>\n            <td><code>game[\"german_soldiertype\"] = \"normandy\";<\/code><\/td>\n            <td>Normandy character model<\/td>\n        <\/tr>\n        <tr>\n            <td>German<\/td>\n            <td><code>game[\"german_soldiertype\"] = \"africa\";<\/code><\/td>\n            <td>Africa character model<\/td>\n        <\/tr>\n        <tr>\n            <td>German<\/td>\n            <td><code>game[\"german_soldiertype\"] = \"winterlight\";<\/code><\/td>\n            <td>Winter light character model<\/td>\n        <\/tr>\n        <tr>\n            <td>German<\/td>\n            <td><code>game[\"german_soldiertype\"] = \"winterdark\";<\/code><\/td>\n            <td>Winter dark character model<\/td>\n        <\/tr>\n    <\/table>\n\n    <h3>Search and Destroy Mode<\/h3>\n    <p>The following lines are specific to the Search and Destroy game mode:<\/p>\n    <pre>\ngame[\"attackers\"] = \"allies\";\ngame[\"defenders\"] = \"axis\";\n    <button class=\"copy-button\" onclick=\"copyCode(this)\">Copy<\/button>\n    <\/pre>\n    <p>These lines define which team is attacking (plants the bomb) and which is defending (defuses the bomb).<\/p>\n\n    <h2>Visual Reference<\/h2>\n    <img decoding=\"async\" src=\"https:\/\/grimms3dworlds.ddns.net\/wp-content\/uploads\/2025\/10\/factions.png\" alt=\"Call of Duty 2 Factions\" class=\"faction-image\">\n\n<\/div>\n\n<script>\nfunction copyCode(button) {\n    \/\/ Get the <pre> element containing the code\n    const pre = button.previousElementSibling;\n    const code = pre.textContent;\n    \n    \/\/ Copy to clipboard\n    navigator.clipboard.writeText(code).then(() => {\n        \/\/ Change button text and style\n        button.textContent = 'Copied!';\n        button.classList.add('copied');\n        \n        \/\/ Revert after 2 seconds\n        setTimeout(() => {\n            button.textContent = 'Copy';\n            button.classList.remove('copied');\n        }, 2000);\n    });\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\/* Container Styling *\/ #cod2-faction-container { font-family: &#8216;Segoe UI&#8217;, Arial, sans-serif; max-width: 900px; margin: 0 auto; padding: 20px; background: #ffffff; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); } \/* Heading Styling *\/ #cod2-faction-container h1, #cod2-faction-container h2, #cod2-faction-container h3 { color: #1a3c5e; margin-bottom: 15px; padding-bottom: 8px; } #cod2-faction-container h1 { border-bottom: 2px solid #e0e6ed; } #cod2-faction-container [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1608","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/pages\/1608","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/comments?post=1608"}],"version-history":[{"count":2,"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/pages\/1608\/revisions"}],"predecessor-version":[{"id":1611,"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/pages\/1608\/revisions\/1611"}],"wp:attachment":[{"href":"https:\/\/grimms3dworlds.ddns.net\/index.php\/wp-json\/wp\/v2\/media?parent=1608"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}