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 ... 10 11 12 13 14 15 16 17 18 19 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  21:03:11  26 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Can someone tell me what I've done wrong here?

From my own script...


class "ui_cop_pda" (CUIScriptWnd)

function ui_cop_pda:__init() super()
  self:InitControls()
end

function ui_cop_pda:InitControls()
    self:Init(0, 0, device().width, device().height)
    local xml = CScriptXmlInit()
    xml:ParseFile("ui_cop_radblood.xml")
	self.pda_screen = xml:InitStatic("pda_screen", self)
	self.pda_screen:Show(false)
end


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

	local active_item = db.actor:active_item()

	if active_item and (db.actor:active_slot() == 0 or db.actor:active_slot() == 1 or db.actor:active_slot() == 2 or db.actor:active_slot() == 3) then
		self.pda_screen:Show(true)
	else
		self.pda_screen:Show(false)
	end
end

  local HUD = nil

function add_custom_inv()
   if HUD == nil then
     HUD = ui_cop_pda()
    get_hud():AddDialogToRender(HUD)
  end
end

function remove_custom_inv()
    if HUD ~= nil then
      get_hud():RemoveDialogToRender(HUD)
      HUD = nil
  end
end



From bind_stalker actor_binder:update(delta)...


	if db.actor then
		if has_alife_info("ui_maingame") then
			ui_cop_pda.add_custom_inv()
		elseif (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
			ui_cop_pda.remove_custom_inv()
		else
		end
	end



An earlier version I managed to get working...but only just. Then it stopped adding the texture to cover the minimap...
  08:37:36  27 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
04/27/2012 8:42:54
Messages: 735
Without looking back through pages posts. I not quite certain why you are calling update from bind_stalker. Any reason you don't just just check your conditions in ui_cop_pda:Update()?

My first thought would be start the hud on load and show or hide elements using conditional checked in update.
  19:40:40  27 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
04/27/2012 19:43:14
Messages: 1890
Similar:

http://www.youtube.com/watch?v=_Uwmjhgs1_E

and even better:

http://www.youtube.com/watch?v=lDZM7jCTcDw&feature=relmfu

Skyloader has A LOT of awesome stuff...he just doesn't share it i think
  20:13:32  27 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/27/2012 20:27:29
Messages: 1072
I'd love to have that artifact detector mod. Alas, it is nowhere to be found. The one mentioned in a thread in these forums wasn't the same one (the detectors were attached to the belt...).

EDIT: New update function...


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

	local active_item = db.actor:active_item()
	local slot = db.actor:active_slot()

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



Still not working. Bind_stalker is down to the standard remove function in actor_binder:net_destroy() and an add function in actor_binder:update(delta):


	if db.actor then
		ui_cop_pda.add_custom_inv()
	else
	end

  20:44:10  27 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
04/27/2012 20:48:28
Messages: 735

---QUOTATION---



	if db.actor then
		ui_cop_pda.add_custom_inv()
	else
	end


---END QUOTATION---



Put the ui_cop_pda.add_custom_inv() in the net spawn portion of bind_stalker.

Technically I guess you could put it in update if you only triggered it once but i don't see a reason.

local HUD = nil
function add_new_hud()
	if HUD == nil then
		HUD = hudnew()
		get_hud():AddDialogToRender(HUD)
	end
end

function remove_new_hud()
	if HUD ~= nil then
		get_hud():RemoveDialogToRender(HUD)
		HUD = nil
	end
end



I use those.
  21:14:38  27 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/27/2012 21:50:18
Messages: 1072
No matter what I do, it just will not accept the script. It refuses to show my texture...


class "ui_cop_pda" (CUIScriptWnd)

function ui_cop_pda:__init() super()
  self:InitControls()
end

function ui_cop_pda:InitControls()
    self:Init(0, 0, device().width, device().height)
    local xml = CScriptXmlInit()
    xml:ParseFile("ui_cop_radblood.xml")
	self.pda_screen = xml:InitStatic("pda_screen", self)
	self.pda_screen:Show(false)
end


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

	local active_item = db.actor:active_item()
	local slot = db.actor:active_slot()

	if db.actor then
		if has_alife_info("ui_maingame") then
			if active_item and (slot == 0 or slot == 1 or slot == 2 or slot == 3) then
				self.pda_screen:Show(true)
			elseif (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(false)
			else
			end
		end
	end
end

  local HUD = nil

function add_custom_inv()
   if HUD == nil then
     HUD = ui_cop_pda()
    get_hud():AddDialogToRender(HUD)
  end
end

function remove_custom_inv()
    if HUD ~= nil then
      get_hud():RemoveDialogToRender(HUD)
      HUD = nil
  end
end



The texture is legitimate - it exists, it is not see-through, and calling a texture this way should place it over the minimap (the custom texture comes to the front).

EDIT: Still nothing...


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

	local active_item = db.actor:active_item()
	local slot = db.actor:active_slot()

	if slot == 0 or slot == 1 or slot == 2 or slot == 3 then
		self.pda_screen:Show(true)
	elseif slot == 4 or slot == 5 then
		self.pda_screen:Show(false)
	else
	end
end



In bind_stalker:


	if db.actor then
		if 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
			ui_cop_pda.add_custom_inv()
		else
			ui_cop_pda.remove_custom_inv()
		end
	end



I use the actor_binder:update(delta) section because that is where I call all of the other UI elements (especially since they need to be turned off when certain conditions, such as the inventory being open, are not met). Thing is, my pda screen worked at one point, but suddenly it stopped working, and ever since I haven't been able to figure it out at all.
  22:43:50  27 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
04/27/2012 23:03:52
Messages: 735

if has_alife_info("ui_maingame") then



that check stops it from displaying in my test.

edit : By structuring it that way you are creating and destroying that hud over and over as well as doing multiple updates per cycle.

To clarify, I don't know that there anything wrong with structuring it that way and I haven't followed what you overall goal is.
  23:15:50  27 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
My goal is to have the minimap framed by a texture of the PDA (as if the player is looking at his PDA) in the top left corner. However, when certain slots are active (knife, pistol, assault rifle, grenade), another texture will appear over the minimap, making it look like the PDA has been turned off and put away. That way, the minimap can only be used when not in combat, etc.
  23:59:59  27 April 2012
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
 

Message edited by:
nashathedog
04/28/2012 0:04:40
Messages: 8123

---QUOTATION---
My goal is to have the minimap framed by a texture of the PDA (as if the player is looking at his PDA) in the top left corner. However, when certain slots are active (knife, pistol, assault rifle, grenade), another texture will appear over the minimap, making it look like the PDA has been turned off and put away. That way, the minimap can only be used when not in combat, etc.
---END QUOTATION---



So cant you script it to position itself with different co-ordinates when your using a weapon etc. That way it can just disappear.
  00:07:17  28 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/28/2012 0:20:48
Messages: 1072
Can't really change the position of the texture - could run into similar problems. I have shrunk the PDA texture from OGSE down, and used it for the background on which the minimap is placed (in this case, the stamina box - it appears beneath the minimap, and no custom texture will really do for that without scripting). I then use another texture which uses part of the PDA texture to cover the minimap. If I can get the script to work, I can post a quick screenie.

EDIT: For the love of...! It just *refuses* to work no matter what. How the hell I managed to get it to work yesterday I don't know, and then what happened in the game to kill it I don't know. This is just ridiculous. Unless anyone can suggest an update function structure in my ui_cop_pda script that works, this feature is really a no-go.
 
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.