How do I make a custom gun game?

This is for the mod I’m working on. How do I make a gun game, setting kill requirements and weapons etc?

2 Likes

Create gun_game_mode_logic entity.

You can config, add and remove levels:


Additional info:
Would be good turn on gun game profile.
(Squad settings; gun game profile have one unarmed soldier and one squad).
For that you should create custom_profile (for players) and custom_bot_profile (for bots).
And write link to .json file: enl/globals/data/gun_game_profile.json.

2 Likes

ok. where do I write the .json link?

1 Like

In properties panel.
In custom_profile and custom_bot_profile entities.

Thx

1 Like

Hello! I am having trouble with creating a gun game because in the property panel after changing the gun type on levels 2-and-up it resets to the default weapon. Does anyone know how to fix this?

Do you change weapon in weapons? Then… You can’t do it in editor for some reasons.
So if you don’t want to work with scene.blk code (map code, file in userGameMods and in your modName folder).
Then edit selectedSessionWeapon and selectedSessionAmmo properties.

Else… You can open scene by any text file.
Find in file _template:t="gun_game_mode_logic"
It contains many code like it:

    "gun_game__levels:object"{
      weaponSlot:t="secondary"
      levelKills:i=3

      "weapons:array"{
        weapons:t="browning_m1918_gun"
        weapons:t="browning_m1918a1_gun"
        weapons:t="browning_m1918a2_gun"
        weapons:t="browning_wz_m1928_gun"
        weapons:t="colt_monitor_gun"
        weapons:t="fg_42_model_2_gun"
        weapons:t="fg_42_gun"
      }
    }

You need to change array ("weapons:array"{) to item<t> ("weapons:item<t>"{).
Something like it:

    "gun_game__levels:object"{
      weaponSlot:t="secondary"
      levelKills:i=1

      "weapons:list<t>"{
        item:t="mauser_98k_trench_gun"
        item:t="mauser_98k_gun"
      }
    }

As result you will able do random weapon in one round/level, but per game in map.

2 Likes

Okay thank you very much. Also what kind of language is this?

Will I also be able to define the slot as primary?

Depends on weapon. But mostly can be in primary, secondary and tertiary. Melee should be in melee.

I just prefer set first level on primary, second on secondary. Just for avoid any bugs. There may happened some problems when both levels on same levels: weapon may start shot faster or slower and other problems. But maybe fixed.

Which file do I find _template:t="gun_game_mode_logic" in?

In scene.blk. This file in folder with your mod name. And all this in userGameMods folder.
gun_game_mode_logic will be added in scene file only if you added this entity in code and save changes.

Thanks again!

1 Like

So if I added the logic in editor, it will not show up?

It will? To be honest I’m not very good understand where/what is problem.
Where scene.blk file placed? Or where gun_game_mode_logic?

I sorry about the confusion. What I meant to say was if I had added the gun_game_mode_logic in the editor (which I did), will it or will it not show up in the BLK file from my scene?

It will if you save changes. In scene.blk will appears code like it:

entity{
  _template:t="gun_game_mode_logic"

  "gun_game__announceLevelReach:list<i>"{
    item:i=1
    item:i=3
  }

  "gun_game__levels:array"{
    "gun_game__levels:object"{
      levelKills:i=1

      weaponSlot:t="secondary"

      "weapons:list<t>"{
        item:t="stg_44_rail_gun"
        item:t="stg_44_rail_gun"
      }
    }

    "gun_game__levels:object"{
      weaponSlot:t="melee"
      levelKills:i=10

      "weapons:array"{
        weapons:t="german_officer_sword_weapon"
        weapons:t="british_officer_sword_weapon"
        weapons:t="us_officer_sword_1902_weapon"
        weapons:t="italian_m1929_infantry_sword_weapon"
        weapons:t="russian_cavalry_sword_1927_weapon"
      }
    }

    "gun_game__levels:object"{
      weaponSlot:t="melee"
      levelKills:i=5

      "weapons:array"{
        weapons:t="axe_weapon"
      }
    }

    "gun_game__levels:object"{
      weaponSlot:t="melee"
      levelKills:i=3

      "weapons:array"{
        weapons:t="shovel_weapon"
        weapons:t="uk_shovel_weapon"
        weapons:t="usa_shovel_weapon"
        weapons:t="ussr_shovel_weapon"
      }
    }

    "gun_game__levels:object"{
      weaponSlot:t="melee"
      levelKills:i=7

      "weapons:array"{
        weapons:t="knife_weapon"
      }
    }
  }
}
1 Like

I have been saving it and I know that because whenever I load the scene it switches to the default gun game selection, but it hasn’t shown up in scene.blk under my scene file name in userGameMods.

1 Like

Maybe you opened wrong file?
All folders contains scene.blk file, but you need open this file that in folder with name of mod where you added gun game.

Or in code only it?

entity{
  _template:t="gun_game_mode_logic"
}

Would be cool to see some screenshots…

2 Likes

I would love to share some screenshots, but I’m worried someone might steal my ideas. When I am done, I will post it on the mods page.