ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
Looting Armour

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  17:58:15  19 March 2016
profilee-mailreply Message URLTo the Top
Free Radical
On forum: 03/19/2016

Message edited by:
Free Radical
03/19/2016 20:59:41
Messages: 1
Looting Armour


I'm trying to configure NPCs to drop armour. I have a good understanding of the mechanics involved, I realise that technically they do not even wear armour so I'll have to spawn it in their inventory. The problem I'm having is that they are not dropping anything which is in slot 6 (or the item is simply not being spawned at all into that slot). I have changed a suit to slot 0 and it appeared as loot, but as soon as I revert it back it does not spawn; suffice to say that my scripting was correct.

One thing I have done is to literally spawn the suits in the same way as normal items are. The trouble with this is that I can only target a community rather than individual NPCs. I can disallow heavy armour on a per-level basis where necessary so it's not overly problematic, but I want to set armour on each and every NPC load-out. I suppose I could duplicate the armours and set them as slot 0, but then the player would not be able to wear them, and might even go about slapping enemies in the face with them, so it'd be utterly pointless (this reminds me, I switched bolts to the grenade slot one time and the NPCs actually stood there throwing endless bolts at me).

Is there a way in which I can force items in slot 6 to be dropped, at least insomuch that it does not cause issues with the player actor?



Never mind, I figured it out already!

I think the problem was that armour in an NPC's inventory is not mounted into slot 6, so targeting that slot achieves nothing. As such, I have to manually define each armour in death_manager.script, but that's okay because this way I can set some random math as a chance of dropping.


function keep_item(npc, item)

  if section == "novice_outfit" then
    if math.random(10) == 10 then -- 10%
      item:set_condition(0) -- that is, broken



Each word should be at least 3 characters long.
Search conditions:    - spaces as AND    - spaces as OR   
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion

All short dates are in Month-Day-Year format.


Copyright © 1995-2020 GSC Game World. All rights reserved.
This site is best viewed in Internet Explorer 4.xx and up and Javascript enabled. Webmaster.
Opera Software products are not supported.
If any problem concerning the site functioning under Opera Software appears apply
to Opera Software technical support service.