ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Need help with specific function

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  23:17:36  26 October 2012
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158
Need help with specific function

I'm slightly modifying RMA 1.1.5 for my own purposes, and I've run across a rather annoying quirk I want to fix but can't quite manage to. I'm not sure if it's even possible to fix it or not..

I'm using a modified version of DMX's hidden_slots.script so I can switch out different melee weapons/binoculars and such, and when you get to Dead City in RMA it strips you of your inventory, bar your melee weapon/binoculars.

As it's quite easy to get replacements for these thanks to the hidden slots scripts, I'd like to be able to strip these two from the player aswell.

I think I've found the function responsible for this, in xr_effects, but it's slightly eluding me as to how it works.


function cit_drop_actor_inventory(actor)
	inv_box_2 = level_object_by_sid(1202)
	out_object = actor
	in_object = inv_box_2
		actor:inventory_for_each(transfer_object_item) 
end



I take it that this is the script that moves your inventory to the specified container, but I'm not sure how to modify exactly what is taken from you to include your melee/binoculars.

Anyone have any ideas?
  23:45:44  26 October 2012
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
actor:inventory_for_each(transfer_object_item)

transfer_object_item is iterated for each item in the actor's inventory. If you want to see what is taken out you need to look into transfer_object_item function. There it should be checking what not to remove.
  00:10:38  27 October 2012
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158
I've found what appears to be the transfer_object_item function, but I can't really see what functionality it would have to check items.

Here's the code I've found:


local function transfer_object_item(item)
    out_object:transfer_item(item, in_object)
end



I have no idea what this function is going. I've had a general search in the xr_effects script for each of the components of the funcition but it's not really showing anything lucrative.
  01:03:17  27 October 2012
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349

local function transfer_object_item(item)
    if item and item:section() ~= "whatever" then
         out_object:transfer_item(item, in_object)
    end
end

  02:41:51  27 October 2012
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158

---QUOTATION---

local function transfer_object_item(item)
    if item and item:section() ~= "whatever" then
         out_object:transfer_item(item, in_object)
    end
end


---END QUOTATION---



Wouldn't I have to list every item individually then, or would it take out the items it already does plus the ones I specify?

Sorry if this is a stupid question.
  03:24:08  27 October 2012
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
Messages: 2230
I'm not sure the knife or binoculars can be removed, though I never tried. Might have something to do with the weapon configs. But anyway, the function would look something like this if it wasn't removing something from the inventory:


local function transfer_object_item(item)
    if item and item:section() ~= "wpn_knife" then
         out_object:transfer_item(item, in_object)
    end
end



As you can see it's not the issue so there is another reason it isn't removed.
  04:09:53  27 October 2012
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158
I've just poked around the config files and in system.ltx I've found the "[inventory]" section with slot_persistent 1 etc in there. I'm not sure what these do, but I notice the knife/binoculars are set to true whereas other things are set to false.

I'm probably way off but I might try it anyway.
  08:58:13  27 October 2012
profilee-mailreply Message URLTo the Top
Vintar
a bit of this and a lot of that
(Resident)

 

 
On forum: 08/08/2008
Messages: 6349
Ah sorry i read your post wrong. Check death_manager script in "always keep items" i think they are listed there, but its been a while so i may be wrong.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl 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.