questions about weapon randomization

Posts: 44
Joined: 28 Feb 2014, 12:30

questions about weapon randomization

Postby GoTDTruth » 05 Jun 2016, 13:31

It's been awhile. :P
but I'm back and I'm ready to start working on my own addon for CoC. Most important thing for me right now is weapon randomization and setting up faction weapons before I start on the economy and balancing. so I have a few questions about the current state of CoC.

1. NPCs do not have infinite ammo correct?

2. NPCs will loot weapons and sell them to traders?

Assuming Npcs no longer have infinite ammo I'm not sure the best way of making randomization. I would like to just #include "gameplay/file" with a list of weapons and corresponding probabilities. but then I'm not sure they will have ammo for these guns unless their is some way to link the ammo spawn to the gun. such as making specific "gameplay/file" for each ammo type and then giving corresponding weapons and probabilities for each of those.

ammo_5.56x45_ss190 \n
ammo_5.56x45_ap = 1, prob=0.2 \n

wpn_sig550 \n
wpn_g36 = 1, prob=0.08 \n
wpn_lr300 = 1, prob=0.2 \n
wpn_l85 = 1, prob=0.3 \n
wpn_fn2000 = 1, prob=0.005 \n

but honestly that is not enough randomization for me.

Upon installing AO3 for CoC I noticed that in death_generic and death_items_by_communities probabilities for ammo is not even given. This confuses me because the ammo dropped from NPCs is more varied than what is shown in the Character_desc_ files. Is there another file I am overlooking?

I want to make sure I can accomplish what I want before I start writing up hundreds of weapon lists and probabilities.

User avatar
Posts: 1368
Joined: 26 May 2012, 22:26

Re: questions about weapon randomization

Postby Alundaio » 05 Jun 2016, 16:15

1. There is still infinite ammo

2. Depends on where the npcs are located, but yes they will sometimes sell/buy stuff

I added a way to randomize loadouts to engine some time ago, just never got around to using it:

in the gameplay character description profiles you can do this now:

Code: Select all

            [spawn] \n
            device_torch \n
            wpn_binoc \n
            wpn_knife \n
            [spawn_loadout] \n
            wpn_pm = 1 \n
            wpn_ak74 = 1, ammo_type=1 \n
            wpn_lr300 = 1, scope, silencer, cond=0.8\n
            wpn_ak74 = 1 \n
            wpn_sig550 = 1, level=l08_escape \n

Okay, like in vanilla anything in [spawn] will spawn. But in CoC there is a new section. ONE thing will randomly be selected in [spawn_loadout]. This allows you to randomize the weapons for stalkers.

let me explain all the params.

  • Ammo is automatically detected and spawned, so no need to add ammo to NPCs anymore.
  • wpn_pm = 3 will spawn 3 boxes of ammo, not 3 wpn_pm.
  • ammo_type corresponds to the ammo_class in the weapon configs.

    Code: Select all

    ammo_class                               = ammo_5.56x45_ss190, ammo_5.56x45_ap

    in this case ammo_type = 0 will be the ss190 and ammo_type =1 will be the ap.
  • scope, silencer and launcher tags, when provided, will spawn the proper attachment on the weapon just like it would in the normal [spawn] section.
  • level tag will only spawn this item when the npc is on this level. It's a good way to add some sort of level progression. You need the level names from game_maps_single.ltx.
  • cond tag will allow you to set the condition for the weapon
"I have a dream that one day this community will rise up and live out the true meaning of its creed: "We hold these truths to be self-evident; that all mods are created equal."

Posts: 44
Joined: 28 Feb 2014, 12:30

Re: questions about weapon randomization

Postby GoTDTruth » 05 Jun 2016, 17:40

wow. This is great. I will have a lot of fun playing with this. :D

I see you have both pistols and rifles in [spawn_loadout] but you said it will only use one. So It would probably be best if I [spawn] the pistol on the NPC and randomize the primary weapon.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 2 guests