ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
WIP COP-inspired inventory

« Previous 10 events | 1 2 3 4 5 6 7 8 9 10 ... 19 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  01:32:40  29 March 2012
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
 

Message edited by:
Lijenstina
03/29/2012 1:37:39
Messages: 1902
This should work. I did it using a xml and some test textures. Textures must be named as faction names and should be located in the textures\test. Like this:
http://www.dodaj.rs/f/2M/xT/3vwgq1e6/neededfiles.jpg

To change their location, location on screen, size just edit the xml.
The script:
http://pastebin.com/1Fqth1kC

The xml. Goes into the config\ui
http://pastebin.com/rdLZjeLh


-----------------------------------------
In the bind_stalker in the function actor_binder:net_spawn(data) add this

ui_factions.add_custom_inv()

...and in the function actor_binder:net_destroy() add this.
ui_factions.remove_custom_inv()


----------------------------------------
In the xr_motivator in the function motivator_binder:update(delta) add this:


	if self.object:is_talking() then
		npc_community = self.object:character_community()
       else
	        if npc_community then npc_community = nil end
	end


On top of the xr_motivator add this :
npc_community = nil


------------------------------------------------
In the treasure_manager in the function CTreasure:use(npc) add this:

    if (npc and db.actor) then
		npc_comm = npc:character_community()
	end



On the top add this :
npc_comm = nil
------------------------------------------------
  17:31:20  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Thanks, just tried those scripts out. I really appreciate the assistance. However...it still doesn't wish to appear for dead NPCs .
  18:01:47  29 March 2012
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
Messages: 1902
It does show up but is a bit buggy - it doesn't always update properly. I'll look into it. Most likely it is beneath a stash texture. You'll need to cut a hole in the stash texture

Post a screen of the stash inventory
  18:28:20  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
That's the thing - I placed the icon temporarily where I'd definitely be able to see it (transparent glass pane, the description box).
  18:35:45  29 March 2012
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
 

Message edited by:
Lijenstina
03/29/2012 18:37:56
Messages: 1902

function ui_faction:Update()
    CUIScriptWnd.Update(self)
    if db.actor and treasure_manager and xr_motivator then
		if has_alife_info("ui_car_body") then
			if treasure_manager.npc_comm and self.tex ~= treasure_manager.npc_comm then
			    self.tex = treasure_manager.npc_comm 
			end
	        if self.tex then self.textures[self.tex]:Show(true) end
		elseif db.actor:is_talking() then
			if xr_motivator.npc_community and self.tex ~= xr_motivator.npc_community then 
				self.tex = xr_motivator.npc_community
			end
	        if self.tex then self.textures[self.tex]:Show(true) end
		else
			if self.tex then		
				self.tex = nil	
				for i = 1, #comms do 
				    self.textures[comms[i]]:Show(false)
				end
			end 
		end
	end
end


This seem to update the loot icon properly. The texture shows up in my game it is just beneath the vanilla one. Did you add the treasure_manager code ?
  19:09:54  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
03/29/2012 19:12:42
Messages: 1072
I still appear to be having problems...the icon only appears after killing an NPC (so if I load a save, I have to first kill an NPC as the old bodies won't display anything), and then only the icon of that first NPC will display...


function ui_faction:Update()
    CUIScriptWnd.Update(self)
	if db.actor and treasure_manager and xr_motivator then
		if has_alife_info("ui_car_body") then
			if treasure_manager.npc_comm and self.tex ~= treasure_manager.npc_comm then
				self.tex = treasure_manager.npc_comm 
			end
	        if self.tex then self.textures[self.tex]:Show(true) 
			end
		elseif db.actor:is_talking() then
			if xr_motivator.npc_community and self.tex ~= xr_motivator.npc_community then 
				self.tex = xr_motivator.npc_community
			end
			if self.tex then self.textures[self.tex]:Show(true)
			end
		else 
			if self.tex then		
				self.tex = nil	
				for i = 1, #comms do 
					self.textures[comms[i]]:Show(false)
				end
			end 
		end
	end
end



Okay, it's the same code you copied and pasted, just with the lines ending in then and ends on new lines, and only tabs (no spaces), but I must be doing something wrong...

EDIT: treasure_manager code was added, but where exactly in the CTreasure:use(npc) function did you place it? I'm placing it at the end, plus npc_comm = nil near the top, like so:
  19:12:59  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
03/29/2012 19:14:27
Messages: 1072

--// Ðàíäîìíûå òàéíèêè. Ñïîñîá ãåíåðèðîâàíèÿ õàáàðà âçÿò ñ ÀÌÊ ìîäà. Íî îñíîâàòåëüíî ïåðåðàáîòàíî ïîä ñîáñòâåííûå íóæäû.  \\--

local treasure_manager = nil

local opt = {
	option_random_treasure = system_ini():r_s32("options","option_random_treasure"), -- Âêëþ÷åíèå/âûêëþ÷åíèå ðàíäîìíûõ òàéíèêîâ òàéíèêîâ (true/false)
	tr_v = system_ini():r_s32("options","treasure_dropout"), -- ×àñòîòà âûïàäà òàéíèêîâ ïðè âûïîëíåíîì condlist. ×åì ìåíüøå, òåì áîëüøå âåðîÿòíîñòü. (70)
	need_text = system_ini():r_s32("options","treasure_need_text"), --Âûâîä ñîäåðæèìîãî â íû÷êó
	-- Êîëè÷åñòâî ïðåäìåòîâ äëÿ êàæäîãî ðàíãà. Ïðè âûñòàâëåíèè íóæíî ïîìíèòü, ÷òî çíà÷åíèå íå äîëæíî ïðåâûøàòü 7 (òàê êàê ñóùåñòâóåò âåðîÿòíîñòü, ÷òî èãðà çàöèêëèòñÿ)
	novice_min = 1, -- ìèíèìóì ïðåäìåòîâ äëÿ íîâè÷êîâ ïðè ñïàâíå
	novice_max = 3, -- ìàêñèìóì ïðåäìåòîâ äëÿ íîâè÷êîâ ïðè ñïàâíå
	experienced_min = 1, -- ìèíèìóì ïðåäìåòîâ äëÿ áûâàëûõ ïðè ñïàâíå
	experienced_max = 3, -- ìàêñèìóì ïðåäìåòîâ äëÿ áûâàëûõ ïðè ñïàâíå
	veteran_min = 1, -- ìèíèìóì ïðåäìåòîâ äëÿ âåòåðàíîâ ïðè ñïàâíå
	veteran_max = 3, -- ìàêñèìóì ïðåäìåòîâ äëÿ âåòåðàíîâ ïðè ñïàâíå
	master_min = 1, -- ìèíèìóì ïðåäìåòîâ äëÿ ìàñòåðîâ ïðè ñïàâíå
	master_max = 3, -- ìàêñèìóì ïðåäìåòîâ äëÿ ìàñòåðîâ ïðè ñïàâíå
}

npc_comm = nil

-------------------------------------------
local name_of_weapon = "" -- ñþäà áóäåò ñêëàäûâàòñÿ íàçâàíèå îðóæèÿ
local npc_rank_name_for_tr = "" -- ðàíã íåïèñÿ
local del_items = {} -- ïðåäìåòû, êîòîðûå óæå ïîáûâàëè â ñïàâíå
local kolvo_in_tr_manager = 0 -- êîëè÷åñòâî ïðåäìåòîâ äëÿ òåêóùåé ñåññèè.





function CTreasure:use(npc)
	printf("TREASURE USE")

	local se_obj = alife():object(npc:id())
	if se_obj.treasure_processed == true then
		return
	end
	se_obj.treasure_processed = true
	
	npc_rank_name_for_tr = ranks.get_obj_rank_name(npc)
   
	--' Íóæíî ðàíäîìíî âûáðàòü îäèí èç òàéíèêîâ.
	local avail = {}
	local tr_sum = 0
	for k,v in pairs(self.treasure_info) do

		if v.done == false then
			local treasure_prob = xr_logic.pick_section_from_condlist(db.actor, npc, v.condlist)
		
			if treasure_prob == "" or treasure_prob == nil then
				treasure_prob = 0
			end

			if tonumber(treasure_prob) >= 0 and
			v.community[npc:character_community()] == true and
			v.active == false
			then
				if tonumber(treasure_prob) == 100 then
				
					self:give_treasure(k)
				else
					table.insert(avail, {k = k, prob = treasure_prob})
					tr_sum = tr_sum + treasure_prob
			
				end
			end
		end
	end

	if tr_sum == 0 or
		amk.real_rand(100) < opt.tr_v -- 65 (à äëÿ òåñòà è âñå 10)
	then
		return
	end

	local tr_w = amk.real_rand(tr_sum)
	
	for k,v in pairs(avail) do
		
		tr_w = tr_w - v.prob
		if tr_w <= 0 then
		
			self:give_treasure(v.k)
			break
		end
	end

	
	if (npc and db.actor) then
		npc_comm = npc:character_community()
	end
end



Sorry for the double-post, it seems I broke the pre tags...(the CTreasure:use(npc) function isn't right at the top in mine, I just left out all the stuff in-between)
  19:25:47  29 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Yikes all that hassle over effectively dynamic updates for the HUD... you sure its worth all the fuss for that feature Kaidonni?
  19:28:31  29 March 2012
profilee-mailreply Message URLTo the Top
Lijenstina
Doom metal in the shade of the flying radiators
(Resident)

 

 
On forum: 07/23/2005
 

Message edited by:
Lijenstina
03/29/2012 19:34:13
Messages: 1902
Hm, I see the problem. Good catch.


function ui_faction:Update()
    CUIScriptWnd.Update(self)
    if db.actor and xr_motivator then
		if has_alife_info("ui_car_body") then
			if xr_motivator.npc_comm and self.tex ~= xr_motivator.npc_comm then
			    self.tex = xr_motivator.npc_comm 
			end
	        if self.tex then self.textures[self.tex]:Show(true) end
		elseif db.actor:is_talking() then
			if xr_motivator.npc_community and self.tex ~= xr_motivator.npc_community then 
				self.tex = xr_motivator.npc_community
			end
	        if self.tex then self.textures[self.tex]:Show(true) end
		else
			if self.tex then		
				self.tex = nil	
				for i = 1, #comms do 
				    self.textures[comms[i]]:Show(false)
				end
			end 
		end
	end
end



Remove the added code from the treasure_manager it is not needed - all is linked from xr_motivator anyway.

Change the function motivator_binder:use_callback(obj, who) in xr_motivator to this:


function motivator_binder:use_callback(obj, who)
	if self.object == nil then return end
	if actor_need_help.obj_id_in_team(self.object:id()) and
	   actor_need_help.get_movstate() > 0 then
	   state_mgr.set_state(self.object, "idle")
	end
	if self.object:alive() then
		xr_use.notify_on_use(obj, who)
		if self.st.active_section then
			xr_logic.issue_event(self.object, self.st[self.st.active_scheme], "use_callback", obj, who)
		end
	else
		if self.treasure_processed == false then
		   treasure_manager:get_treasure_manager():use(self.object)
		   self.treasure_processed = true
		end
		if (npc and db.actor) then
			npc_comm = npc:character_community()
		end
	end
end




These lines are

		if (npc and db.actor) then
			npc_comm = npc:character_community()
		end


what is added. So if there is some other mod related content in that function just add these lines in the function like it was shown.

In the end add the npc_comm = nil on the top of xr_motivator.
  19:50:28  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072

---QUOTATION---
Yikes all that hassle over effectively dynamic updates for the HUD... you sure its worth all the fuss for that feature Kaidonni?
---END QUOTATION---



It better be, or I want a good reason why the rabbit liver I just bled ran clear! It worked good enough for the Romans, why not me?
 
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.