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 ... 3 4 5 6 7 8 9 10 11 ... 19 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  20:16:24  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
heh i could post the update function code for that random quests panel. 248 lines. This is peanuts.
  20:59:40  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Now I know I'm screwing up somewhere, because it refuses to show up on the loot screen again...

Here's what I have after messing with spaces and tabs again, but rolling back before messing with the ends (because for some reason, it then despised the whole thing and wouldn't show anything, not even the trade faction icons...):


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



It would also seem that my xr_motivator motivator_binder:use_callback(obj, who) is slightly different (code is with added code for ui):


function motivator_binder:use_callback(obj, who)

    if not self.object then 
		if obj then
			self.object = obj
		else	
			return
		end
	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

  21:13:18  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's not your fault. It's mine. I forgot to change the variable name.
Change these lines

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



Into these:

		if self.object then
			npc_comm = self.object:character_community()
		end



Sorry for the mistake.
  21:37:55  29 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
No problem, it's working now as expected. Thanks for all your help.

I'm just hoping it works with ranks too.

Plus, as expected, it bugs out on mutants - it shows the faction patch of the last NPC looted (just like it shows the relations of the last NPC looted, although that text will be off-screen).

Now just for Sid's check. I am assuming that that one would be simple...?
  22:30:16  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

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 xr_motivator.npc_comm then xr_motivator.npc_comm = nil end
			if self.tex then		
				self.tex = nil	
				for i = 1, #comms do 
				    self.textures[comms[i]]:Show(false)
				end
			end 
		end
	end
end


Try this as a mutant fix.

I'll have to look into it for Sid.
  23:22:37  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 23:28:20
Messages: 1072

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



Trying it out for ranks and...what might be wrong here? The log says:


FATAL ERROR
 
[error]Expression    : fatal error
[error]Function      : CScriptEngine::lua_error
[error]File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
[error]Line          : 73
[error]Description   : <no expression>
[error]Arguments     : LUA error: ... shadow of chernobyl\gamedata\scripts\ui_rank.script:21: attempt to index field '?' (a nil value)
 

stack trace:



Line 21 being if self.tex then self.textures[self.tex]:Show(true) end.

I would have at least thought rank could be dealt with in a similar manner, or isn't it that simple?
  23:37:22  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 23:43:20
Messages: 1902
self.tex is not valid i think. Most likely a value passed in from the scripts is not in the texture tables. What are you trying to do ? Ranks like the CS ones ? That will need a rewrite.


Solved the trader issue. Also mutants work correctly now.


function ui_faction:Update()
    CUIScriptWnd.Update(self)
    if db.actor and xr_motivator and bind_monster 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 not bind_monster.trader_comm then
				if xr_motivator.npc_community and self.tex ~= xr_motivator.npc_community then 
					self.tex = xr_motivator.npc_community
				end
			else
			    self.tex = "trader"
			end
	        if self.tex then self.textures[self.tex]:Show(true) end
		else
		    if xr_motivator.npc_comm then xr_motivator.npc_comm = nil end
		    if xr_motivator.npc_community then xr_motivator.npc_community = nil end
		    if bind_monster.trader_comm then bind_monster.trader_comm = false end
			if self.tex then		
				self.tex = nil	
				for i = 1, #comms do 
				    self.textures[comms[i]]:Show(false)
				end
			end 
		end
	end
end



in the bind_monster.script add this on the top

trader_comm = false


In the function generic_object_binder:update(delta)

find these lines :

	if self.object:clsid() == clsid.script_trader then
		trade_manager.update(self.object)
	end



and replace them with these


	if self.object:clsid() == clsid.script_trader then
		trade_manager.update(self.object)
		if self.object:is_talking() then
		    trader_comm = true
		else
		    trader_comm = false
		end
	end

  00:00:07  30 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/30/2012 0:15:41
Messages: 1072
Yeah, I was hoping I could show the ranks. It isn't an absolute must, but I liked the idea.

EDIT: Yep, Sid's working and mutants aren't showing any faction either. Thanks for all the help you've given me.

One thing about displaying the textures via bind_stalker - I've found that having in function actor_binder:update(delta)...


	if db.actor then
		if (has_alife_info("ui_trade") or has_alife_info("ui_car_body")) then
			ui_faction.add_custom_inv()
		else
			ui_faction.remove_custom_inv()
		end
	end



...and only having in function actor_binder:net_destroy()...


ui_faction.remove_custom_inv()



...the patches appear on top of other textures (quite desirable, actually). The main thing about this is that there appears to be a texture underneath the character info on the loot panel, and since character info won't appear for stashes, then I can repurpose that particular texture to block off the view (otherwise there'd be nothing there at all). If the faction patches appeared beneath most textures, then this would prove a problem since I'd need to cut a block out of even that hidden texture (leaving a hole in it when checking stashes ).
  18:03:59  30 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890
Hey kai,

do you still need those textures i made you?
  19:24:14  30 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Yes please . I've moved the inventory around so that the description box is no longer in the centre, instead the full actor and suit values and belt is dominating that part. The icons should fit somewhere in there.

I've decided to scrap rank appearing, going to stick with just the faction patches, I've taken up enough of Lijestina's time on that.
 
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.