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 ... 11 12 13 14 15 16 17 18 19 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  18:28:06  30 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
Just use net_spawn and net_destroy sections of bind_stalker.
  19:00:41  30 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
04/30/2012 19:06:22
Messages: 1072
Thanks, it finally works now. I've always used net_destroy to remove my custom UI elements, but never net_spawn to add. I noticed that they disappear very quickly (the PDA cover in this instance) when the other panels (inventory, for instance) are opened. I'm wondering if I should call all of my other UI elements through net_spawn instead of using the update, as there always seems to be a delay between opening the various UI screens and my icons appearing (such as the faction patch icons for the trade screen - in some instances, it is quite significant, a couple of seconds). Would they appear much quicker if I only used net_spawn? And can I use the same conditions (the 'has_alife_info' sections) in net_spawn?

Here we are...
http://www.moddb.com/members/kaidonni/images/mini-map-for-cop-inpired-hud#imagebox
http://www.moddb.com/members/kaidonni/images/mini-map-for-cop-inpired-hud1#imagebox

Note that to speed up my experiment, I changed the slots that activate the texture. The compass (which I will clear up) is courtesy of Rulix Hud Reworked V2.0 for COP by Smurth (I shrunk the compass, but kept the letters the same size). I decided that a square mini-map was best. Rectangular just looked odd when rotating (you can't rotate the PDA map itself, so...).
  19:52:31  30 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
You create the Hud with net_spawn. All of the elements are initialized at that time. You update the current state of each element of the hud in the update section of the hud. So the additional Hud exists as long as the map is loaded what you do to that hud (what appears or doesn't appear) is all determined by the update check. You put whatever conditional statements you need in there. This would include info_portion checks.
  20:44:34  30 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
New issue...everytime I first talk to an NPC, it kills the script:


function ui_cop_pda:Update()
	CUIScriptWnd.Update(self)

	local slot = db.actor:active_slot()

	if (slot == 0 or slot == 1 or slot == 4 or slot == 5) and not (db.actor:is_talking() or (has_alife_info("ui_inventory") or has_alife_info("ui_talk") or has_alife_info("ui_trade") or has_alife_info("ui_car_body") or has_alife_info("ui_pda"))) then
		self.pda_screen:Show(true)
	else
		self.pda_screen:Show(false)
	end
end



Everything is fine until I talk to Sidorovich, especially with an item from one of those slots (in this case the bolt or the binoculars). After that, the overlay won't appear.
  03:54:46  1 May 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
Off the top of my head. I'm pretty sure "slot" becomes nil when you open a conversation. As db.actor:active_slot() is nil. Either take that into account and save the last valid active slot as "slot" variable or check for slot == nil and take that into account in your check.
  13:40:09  1 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
This just got confusing...


function ui_cop_pda:Update()
	CUIScriptWnd.Update(self)

	local slot = db.actor:active_slot()

	if db.actor:is_talking() and slot == nil then
		self.pda_screen:Show(false)
	elseif db.actor:is_talking() and slot ~= nil then
		self.pda_screen:Show(false)
	elseif not db.actor:is_talking() then
		if slot ~= nil and (slot == 0 or slot == 1 or slot == 4 or slot == 5) and not (has_alife_info("ui_inventory") or has_alife_info("ui_talk") or has_alife_info("ui_trade") or has_alife_info("ui_car_body") or has_alife_info("ui_pda")) then
			self.pda_screen:Show(true)
		else
			self.pda_screen:Show(false)
		end
	end
end



All messed up...I guess this is what happens when another variable is thrown into the mix.
  17:27:27  1 May 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
05/01/2012 17:31:41
Messages: 735
one option would be to save condition of active slot.

local slot = nil

function  ui_cop_pda:Update()
	CUIScriptWnd.Update(self)

	if not db:actor:is_talking() then slot = db.actor:active_slot() end

	if slot == 0 or  ...



another option might be to exit before slot update

function  ui_cop_pda:Update()
	CUIScriptWnd.Update(self)

	if db:actor:is_talking() then
		self.pda_screen:Show(false)   -- or (true) if this is used as covering texture
		return
	end

	local slot = db.actor:active_slot()

	if slot == 0 or  ...

  21:46:58  1 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Thanks, that works a charm (the first one, anyway). The overlay no longer permanently disappears.
  18:39:59  2 May 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735

---QUOTATION---
Thanks, that works a charm (the first one, anyway). The overlay no longer permanently disappears.
---END QUOTATION---



Unfortunately that is just a one off example of dealing with is_talking(). You'll probably need something more flexible for general use.
  17:10:07  5 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
What else might be problematic, then, for the PDA overlay?

A status update - almost finished with the 4:3 version, will shortly be porting it over to vanilla for a more widely compatible version (technically it's widely compatible now, as I sort of made the UI with vanilla slot use in mind, so the inventory slots are just fine - it's OGSE that needs a wider slot 1 so that shotguns can be placed there). I just have to optimise the current UI scripts since as I have been calling them via the update section of bind_stalker, and I figure moving to net_spawn for the add functions will work out better.

I am not bothering changing the OGSE repair box UI for the OGSE version. For some reason, the ui_repair.xml only pertains to the repair UI the player sees through NPCs repairing items (such as Sidorovich). Any changes to that particular xml seem to not carry over to the player's personal repair kit UI at all. I hope people don't mind (unless I can figure out where the player's repair kit UI comes from, it'd look odd to have two different repair UI's).

I will also be providing two options for the PDA overlay for OGSE - one will place the overlay over the minimap when the knife/pistol/assault rifle/grenade slots are active and when there is a blowout, and the other will only place the overlay over the minimap during blowouts (one of the OGSE modders, SimplyYuri, informed me it would make the game too hard because the minimap helps with grenade warning icons). For non-OGSE, the choice will be between an overlay and no overlay (the reason OGSE will have the overlay appear when there is a blowout is because the PDA itself is 'disabled' during blowouts).

I might need assistance with the widescreen port, as I don't have a 1280x768 screen to test it on.
 
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.