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

1 2 3 4 5 ... 19
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  21:14:03  19 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/19/2012 21:15:44
Messages: 1072
WIP COP-inspired inventory

So, in deciding to create a submod for OGSE, I took it upon myself to fiddle about with the inventory screen. I fancied a COP-inspired inventory, and so far, I think I've done sort of well. I want to ask others what they think of my current WIP, though, to see if I'm not just deluded (I am, but it'd be comforting to know others were deluded with me ).

So, here's a peek at the inventory screen at the moment...
http://imageshack.us/photo/my-images/28/wipcopinv.jpg/

It is still a WIP, and those health/stamina/psy-health/radiation buttons are...okay. They just don't sit too right with me, though, at least not spaced that far apart (and the psy-health symbol needs re-working).

I am curious if there is a function to check the actor's community, as I'd like to return the character's name and community to the inventory also, like in COP.

So, from the piccy above, do I continue or burn it?

One option for the colour icons is to collapse the pic from the description box, make the box smaller, and fit those colour symbols in the space there.
  21:22:11  19 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
03/19/2012 21:23:40
Messages: 1890

---QUOTATION---
WIP COP-inspired inventory

So, in deciding to create a submod for OGSE, I took it upon myself to fiddle about with the inventory screen. I fancied a COP-inspired inventory, and so far, I think I've done sort of well. I want to ask others what they think of my current WIP, though, to see if I'm not just deluded (I am, but it'd be comforting to know others were deluded with me ).

So, here's a peek at the inventory screen at the moment...
http://imageshack.us/photo/my-images/28/wipcopinv.jpg/

It is still a WIP, and those health/stamina/psy-health/radiation buttons are...okay. They just don't sit too right with me, though, at least not spaced that far apart (and the psy-health symbol needs re-working).

I am curious if there is a function to check the actor's community, as I'd like to return the character's name and community to the inventory also, like in COP.

So, from the piccy above, do I continue or burn it?

One option for the colour icons is to collapse the pic from the description box, make the box smaller, and fit those colour symbols in the space there.
---END QUOTATION---



Go on please!!! FOR THE LOVE OF GOD <3

and, send me over the files so i can re-texture them.

And, really? OGSE only? *sadface* and why do i see a Primary / secondary / TERTIARY(?) weapon slot!?

Last thing, if you REALLY want a duplicate inventory like cop, try vintars hud mod. What it does is simple, check for medkits / bandages / rads etc. and show them on the hud, like in this shot: http://www.moddb.com/mods/stalker-particle-paradise/images/texture-pack
  21:57:42  19 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
I'm just testing it on OGSE at the moment, but I'll make it so the files can be used for any mod. They can at the moment, it's just that the bind_stalker wouldn't be compatible with other mods, but it's easy to port the changes to other bind_stalker files.

On the weapon slots - OGSE has a strange way of handling weapons (well, not strange, but different to vanilla and most other mods). Basically, pistols and shotguns are in the first slot (as is the crossbow and flamethrower), automatics in the second. I ended up with a CTD when I was testing an earlier version with a smaller pistol slot box, as the BM16 Long covers seven boxes, as goes into the first slot. The third box is for the belt. I can always tweak it so that the first two slots are smaller and have a symbol indicating their primary weapon type.

I have kept previous versions so the weapon slots can be re-textured, and I am rolling back to a version where Marked One's pic is much smaller, about 140 pixels by 90 or so (85% of the standard size, which is 165 x 108).

As for the icons on the HUD, not really sure about that. I'm trying to keep the main HUD free of too much. I'm scrapping a box in which the ammo type and firing mode is positioned on the main HUD, it'll just be words in the bottom right corner. I will be keeping in the minimap, though - just, if the player has a weapon out, the minimap will be covered by a black box to indicate Marked One is not in a position to stare at it (he's only got one pair of hands ).

I'm hoping to use the HUD effects from LURK for reducing health, stamina, and increased radiation - hence the colour icons in the inventory. I didn't like the idea that the player couldn't have *ANY* indication of health, stamina, psy-health and radiation away from the HUD, especially when the inventory is where the player remedies problems; but I also didn't like progress bars, they are too specific. I twigged that a rough indication could be given, in the form of colour symbols.

As for the remaining progress bar visible on that screen - that's for restriction stock, from AMK. When filling your backpack with items, the bar will increase, telling you how full it is. A progress bar being specific is okay in that case.

And thanks, I'll send over the basic icons I have, since the step after is to use an overlay texture to colour them, and I need to mess around with that bit.
  22:15:25  19 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
03/19/2012 22:16:18
Messages: 1890
Nice idea's, really nice in fact. But, why not completely remove the Minimap from the HUD? Thats were the PDA comes in right? I always thought a minimap on the hud is somewhat cheating-like.

(this idea can only be done if you keep the minimap)

And, if its possible, well i think it is because I've seen such a mod on amk, but would it be possible to make the minimap round? like in CoP? And put the sound and "seen" parameters around it? i think I've seen such a hud on amkforums, but that was a long time ago Ill search for it in a min.

The best HUD in my opinion is minimal, because everything on screen is just distracting. The only thing that should be visible is the ammo. The rest is obsolete in my eyes. It will only distract you.

and i tried a CoP inspired inventory too! but i failed, so i re-textured the old one http://www.moddb.com/mods/stalker-particle-paradise/images/patch-001b1#imagebox

i do hate the horrible stretching stalker does on 16:10 screens :L and i wont patch it to 10006 only for the fix...
  00:57:39  20 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/20/2012 0:58:49
Messages: 1072
Well, it depends with the minimap - detectors come in really handy displaying symbols of anomalies, and I am unsure if OGSE places these on the PDA. The artifact detector mod I downloaded (likely incompatible with another feature I want for my submod, artifact containers - but we'll see about that at a later date) places artifact symbols on the PDA map, so it is probably possible - I just don't know how.

I'd have to check out the scripts of any mod with a circular mini-map. I'm no expert scripter, so I won't be creating something like that anytime soon, but it wouldn't be too hard to merge I should imagine (I imagine a lot).

If the minimap goes, then only ammo and certain HUD effects will remain - the special overlays that indicate lower health, stamina and high radiation, and also the eating icon. Also a flashing around the screen to indicate bleeding. I'll be borrowing these effects from Lurk (gotta make good on my requests for permission from 2010 ).
  17:43:30  21 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
03/21/2012 17:44:13
Messages: 1890
Well, I've been working on the textures these days, this is what i came up with: http://fc09.deviantart.net/fs70/f/2012/081/f/b/ui_actor_menu_by_mod_a_holic-d4tkiso.png


Something that needs to be changed? (dont mind the squares, thats the 50x50 grid. they will be removed)
  20:00:54  21 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/21/2012 22:38:28
Messages: 1072
The first thing that comes to mind is this - if a description box can be scripted to appear like it does in CS/COP, then you're doing great. I believe this is possible, but I'm not really a scripter. Otherwise, there needs to be somewhere for the info on any item to appear.

Same with the suit properties - if the protection offered by a suit can be shown as a progress bar, then just change the icons as necessary.

The repair button is redundant in SOC, and many mods that feature repair access the feature from a dialogue option when talking to the relevant character.

Also be wary of the size of the character picture boxes - the standard size in SOC is 165x108 pixels, although those are the values for the source texture. You can use trade_character.xml to define the size either picture appears, and I plan myself to scale it down by about 15% - it's easier and less time-consuming than resizing the character and mutant icons manually.

As for the belt, as long as the slots are positioned and sized correctly, the glass boxes in COP where artifacts are placed when on the belt are just fine.

Hope this helps.

What I'd like to know is if there is any way to check the actor's faction (community) and rank, as then I can return those to the inventory like they are in COP. I can even change the rank to the CS method (a chevron patch) rather than use wording.

I've attached a screenshot to show my progress. It's a bit more messy than the previous one, but it shows where I want my icons to go for health/stamina/psy-health/radiation. I'm planning to dispense with wording for both faction and rank - the CS icons for those might be better. It's best they go where the health/stamina/psy-health/radiation icons go, along with deposit info and a clock. But, I do wonder about a script to check for faction and rank. I'll look through mods that allow you to join factions, but...eh...I'm no expert.

http://imageshack.us/photo/my-images/687/ssparents032112183647l0.jpg/

EDIT: Well, looks like I found what I want with xRatx's Clear Sky Faction mod. Excellent...now it is on to rank. That's gotta be easy, I suspect. Of course, no script works perfectly first time round (I hear even the experts have their own problems with their scripts, so I am in good company ).

EDIT 2: Is it possible to check the faction and rank of an NPC the player is trading with or looting? I know there are already the character info boxes, but instead of wording, I thought the CS faction and rank patches would be better. Only thing is, I don't know if it is possible to check the rank and faction of the individual the player is trading with/looting.
  12:33:38  22 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
No one has anything else to say at all on my progress? Hardly worth posting anything...

And what about checking the faction and rank of an NPC so I can return certain textures instead of relying on wording to convey the information?
  13:14:01  22 March 2012
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
 

Message edited by:
nashathedog
03/22/2012 13:49:40
Messages: 8123
No one has anything else to say at all on my progress?

Not at all, I'm sure it's just like me a lot of us have no way to help so simply keep an eye on what your doing looking forward to it.
I've been reading this thread but have no helpful input to give as I am unable to help with this type of modding but as far as your basic idea and what the screen shots show I think it is great. Although I do hope for a more universal version so that we can use it with more mods with less work to adjust it like Loner said. Rather than those who will be relying on your finished work having to use it for OGSE only. I like the idea of having visuals rather than words where possible.

EDIT It is a good idea and I like where your going with the tweaks and look forward to using it. I hope you don't lose the minmap altogether for me it is a make or break feature I can't do without but that's only 1 opinion. I don't use SHOC as much as COP but for me personally features such as this inventory will give SHOC more appeal like other ported CS\COP features have. It's great your making a more compatible version now, it will get a lot more use because of this.
  13:29:02  22 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/22/2012 14:03:50
Messages: 1072
Well, the internet just gobbled up a post it took me 15 minutes to type... I'm not a very confident person, and since my goal is to release this mod to the public, silence does make me a little nervous... I was hoping preliminary screenshots would help guage opinion on if I was headed in the right direction with the aesthetics and general layout. As for the scripting, I know only a few people may be able to answer those questions (I'm more wondering about figuring out the NPC community and rank via script, as I found out how to do it for the player)

Aside from that, I now realise my changes do not rely on OGSE, so I'm going to make it so it can be used with any mod and vanilla. I've even changed some other files in my OGSE to reflect vanilla values (i.e. slot 1 weapons will not be 7x2 tiles...that just looked wrong in my inventory - slot 1 should really look smaller than the second slot).

EDIT: Last year, before I decided to mess about with COP and the level editor, I was going with the idea of the minimap being covered in certain situations. It would be framed within a 'PDA' (the vanilla SOC stamina/standing-crouching-prone box element is one of the few parts of the HUD that is placed below the minimap - all I need to do is change the texture, and the 'off' mode would be another texture called via script), and only by holstering a slot 1 or 2 weapon or a grenade could you see the minimap.
  14:20:31  22 March 2012
profilee-mailreply Message URLTo the Top
BeastZomb
(Senior)
 
On forum: 05/13/2011
Messages: 100
i must admit i am one of those who watch the progress as i have no modding abilities at all,

but im sure there are alot of ppl interested in this,

i think it looks great and would definately use this,

keep up the great work m8 it is appreciated
  15:03:26  22 March 2012
profilee-mailreply Message URLTo the Top
Theophantus
(Novice)
 
On forum: 07/14/2008
Messages: 24
Kaidonni,

Nice idea and concept. Good that you've made it compatible with other mods and not just OGSE.

Like others posted here, i'm just watching and waiting.



Theo
  15:27:48  22 March 2012
profilee-mailreply Message URLTo the Top
LiquidBronze
Senior Resident
 

 
On forum: 03/25/2007
Messages: 545
Kaidonni,

It looks great so far, keep up the good work man!

A suggestion:

I think it would look better if you expanded the full character portraits box to the right more (then centered the actor pic in it), which would move the indicators over to the right to fill the space . Right now there is a lot of space not used, not sure you have another plan for that or not?
  15:37:23  22 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
If you mean the actor in the suit part (baring in mind Imageshack was no good for my second screenshot - serves me right for ignoring what other people have said about it and using it), then I decided that the belt would go to the right of the actor's depiction, and the health/stamina/psy-health/radiation buttons will be in the centre panel under the weapon slots. I plan to collapse the description box more so there will be no pic (I added that feature back in, but it takes up too much space). Along with the health/stamina/psy-health/radiation buttons will be a faction patch and if I can figure it out, a chevron patch (both from Clear Sky); it is likely I will move the deposit info there also rather than leave it next to Marked One's facial shot.

I may just leave the wording in for the faction info on the loot and trade screens, and keep the icons for faction and rank in the inventory.
  02:33:36  23 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
I like it. My gripes with it though;

Pistol slot shouldn't be more than 5 boxes, looks weird with 7.
Green icons are too big for my taste
Inventory grid should have more boxes so theres less scrolling

Side Notes:

If you complete that UI you will need to make one for 4:3 (incredible as it seems some users still don't have widescreen monitors! ), then you will have to change inventory box UI, trader UI etc to match player inventory UI otherwise it will just be weird. Also adding a "Deposit All" button would be nice

Those are my thoughts and notes anyway, but I do like the direction your going in.
  04:17:14  23 March 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
Believe it or not, 4:3 is easier to set up than 16:9 because of how GSC implemented 16:9 positions in 4:3 screen size. It would be 100 times less painful if they specified 16:9 in 16:9 size!
  04:36:38  23 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
 

Message edited by:
ket
03/23/2012 4:39:56
Messages: 1432
Oh I know how painful making a widescreen UI is. I had all kinds of headaches just tweaking the vanilla one. I honestly wonder what kind of crappy hardware the GSC deves were working with... I mean NPC textures in vanilla SoC are of a higher resolution than the big textures covering buildings! Total WTF moment GSC..

Even back when SoC was in development a 1024 texture was pretty "meh" and 512 textures were gross. I'll hedge my bets and hazard a guess the GSC devs were developing SoC on a 2GHz laptop with a X3100 intel GPU
  12:16:41  23 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/23/2012 12:22:05
Messages: 1072

---QUOTATION---
I like it. My gripes with it though;

Pistol slot shouldn't be more than 5 boxes, looks weird with 7.
Green icons are too big for my taste
Inventory grid should have more boxes so theres less scrolling

Side Notes:

If you complete that UI you will need to make one for 4:3 (incredible as it seems some users still don't have widescreen monitors! ), then you will have to change inventory box UI, trader UI etc to match player inventory UI otherwise it will just be weird. Also adding a "Deposit All" button would be nice

Those are my thoughts and notes anyway, but I do like the direction your going in.
---END QUOTATION---



Ahem...it is 4:3 . And I have changed the blasted pistol box now - the original screenshot you can blame purely on OGSE and how they handled shotguns. They shoved them into slot 1, along with the crossbow and flamethrower. Well, no more (my original goal was to create a submod for OGSE, with the new UI as part of it - but my UI will also be standalone since it doesn't rely on any OGSE features anyway, and the version for OGSE will change some weapons so they appear in slot 2 instead).

As for the colour buttons, I'm planning on keeping them the same size as the ones from COP's inventory - I'm just moving them to the centre panel, as all that extra space makes them look so wrong. In COP, there are only two buttons - one for bleeding and one for radiation, and they fit in nice and snug with everything else.

I'm just trying to think of the best way to place the faction patch and rank patch now, and if money should be moved, and where the time might go.
  14:37:04  23 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
When it comes to the time I would plonk it at the bottom of the green icons or next to them. Its as good a place as any for it. Make a nice little digital watch icon or something and have the time in that.
  21:43:51  23 March 2012
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
Messages: 647
CoP allows any weapon to go to any of the slots. ShoC engine does not allow that. Making both weapon palceholders bigger is a technique used from many years on many mods, does very little to ease the rigid division slot1-slot2.

Anyway, it would be nice to have a different inventory arrangement that substitutes the archaic and limited vanilla interface.
  02:07:33  24 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
I don't actually like X-Ray 1.6. I like X-Ray 1.5 much more, things just look better in X-Ray 1.5 than they do in 1.6, dunno why.
  12:34:17  24 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/24/2012 13:03:38
Messages: 1072
I may have figured out where to put the faction and rank patches...but it's calling them via script that is bothering me. I can figure out the actor's scripts, but what about NPCs? It can only happen when the actor is either looting or trading with an NPC, which means any script has to recognise it's that NPC.

I'm looking at death_manager.script, but...I have my doubts. Would it by any chance be 'if npc then' that I need? I see other things in there for how to check rank or community, but does 'if npc' refer specifically to an NPC the player is looting or trading with? Well, in this instance, not trading...
  18:15:07  24 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Unless anyone can answer the scripting question, I have no idea how to progress with my inventory, since the next part relies on knowing whether or not I can show NPC faction and rank as patches instead of relying on the text.
  18:18:18  24 March 2012
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567
Looks great!
  18:27:07  24 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
I'll post a new screenshot soon, since I think I'm focusing too much on insignificant features. I'll try to get the faction and rank patches in, but maybe it's best to keep it to the player's inventory and leave NPCs out of it altogether.
  04:19:42  25 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Probably best. The more complex something becomes the more prone to problems it becomes, and as we all know thats not a good thing in stalker
  12:29:00  25 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/25/2012 12:59:07
Messages: 1072
I emailed Vintar in any case. I did manage to figure out where I'd put the information and how I'd lay it out, so it'd be a shame now if I can't do the same for NPCs for the trade and loot panels. I could do it whenever for the player.

As I've said, I'm not much of a scripter. The current scripted elements are courtesy of Vintar, Barin, Imperial Reign, mnn and Gannebaum. They either provided template scripts or assisted me in threads in fixing problems. I simply modified the scripts based on my needs with them. Text is the next thing I need to sort out if I go with the faction and rank patches - I need text for the inventory, it already appears for trading and looting (the character info panel, just need to tweak positions of the different elements).
  14:09:32  25 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Well, you certainly aren't lacking for creativity I look forward to seeing some screens of when your UI is complete.
  15:43:09  25 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/25/2012 15:46:40
Messages: 1902
This is the latest smp variant. It still got some rough edges. On the left is a random item quests panel and on the right should be the medic panel. (i'm thinking of some health related problems triggered by passing time) that will be available when talking to a medic.

http://screenshot.xfire.com/s/122514713-4.jpg

From what i've seen a call from the xr_motivator with the is_talking() function could be used for your problem.
  16:06:43  25 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/25/2012 16:07:49
Messages: 1072
I don't see any is_talking() function in either the vanilla or OGSE's xr_motivator. I'm wondering if dialog_manager is more on the money, since at the beginning of the script there is a function where information is being gathered:


function fill_phrase_table()
	--' Èòåðèðóåìñÿ ïî âñåì íàñòðîéêàì ôðàç
	if not phrase_ini:section_exist("list") then
		abort("There is no section [list] in dialog_manager.ltx")
	end
	local n = phrase_ini:line_count("list")
	local id, value = "",""
	local category = ""
	
	for i=0,n-1 do
		result, id, value	= phrase_ini:r_line("list",i,"","")
		
		if not phrase_ini:section_exist(id) then
			abort("There is no section [%s] in dialog_manager.ltx", id)
		end		
		--' 2. Íåîáõîäèìî ñôîðìèðîâàòü íàáîð ïðåäèêàòîâ  table[string_id] = predicate()
		if not phrase_ini:line_exist(id, "category") then
			abort("Dialog manager error: not categoried section [%s]", id)
		end
		category = phrase_ini:r_string(id, "category")
		local tt = {}
		tt.name = id
		if phrase_ini:line_exist(id, "community") then
			tt.community = phrase_ini:r_string(id, "community")
		end
		if phrase_ini:line_exist(id, "npc_community") then
			tt.npc_community = phrase_ini:r_string(id, "npc_community")
		end
		if phrase_ini:line_exist(id, "relation") then
			tt.relation = phrase_ini:r_string(id, "relation")
		end
		if phrase_ini:line_exist(id, "npc_rank") then
			tt.npc_rank = phrase_ini:r_u32(id, "npc_rank")
		end
		if phrase_ini:line_exist(id, "level") then
			tt.level = phrase_ini:r_string(id, "level")
		end
		if phrase_ini:line_exist(id, "condlist") then
			tt.condlist = xr_logic.parse_condlist(db.actor, "dialog_manager", "condlist", phrase_ini:r_string(id, "condlist"))
		end
		if phrase_ini:line_exist(id, "smart_terrain") then
			tt.smart_terrain = phrase_ini:r_string(id, "smart_terrain")
		end					
		if phrase_ini:line_exist(id, "cost") then
			tt.price = phrase_ini:r_u32(id, "cost")
		end					
		if phrase_ini:line_exist(id, "article_info") then
			tt.article_info = parse_names(phrase_ini:r_string(id, "article_info"))
		end					
		if phrase_ini:line_exist(id, "treasure") then
			tt.treasure = phrase_ini:r_string(id, "treasure")
		end					
		if phrase_ini:line_exist(id, "wounded") then
			tt.wounded = phrase_ini:r_string(id, "wounded")
		else
			tt.wounded = "false"
		end
		tt.phr_id			= gen_phrase_id_str()
		tt.phr_id2			= gen_phrase_id_str()
		phrase[category][tt.phr_id] = tt
	end
end



I don't know if I can use anything from that, though.
  16:32:29  25 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/25/2012 16:41:57
Messages: 1902
There is none, you have to add it.

This is some pseudo code to give you an idea how it should look like.

npc_talks = false
npc_community = nil


add it on the top of the script.
Then in the update function add these lines:

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


Then in a hud script ( in the update function) like the ui_hudnew add this

if xr_motivator and xr_motivator.npc_talks then
       local comm = xr_motivator.npc_community or "none"
       if comm == "killer" then here you set the merc texture to be shown
       elseif comm == "stalker" then same for stalker etc.
             ... here you define all the factions what texture to be shown
       end
end



Do you know how to define globals in the ui script so you can use the :Show(boolean) functions ?
  17:03:28  25 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/25/2012 17:04:12
Messages: 1072
From my tinkering about with scripts, aren't globals shown by, e.g. script_name.function_name, as well as being made local values within the function requiring them (e.g. local function_a = script_name.function_name)?
  17:10:39  25 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/25/2012 17:12:34
Messages: 1902
Used the local because it has less characters to write in script so it looks less cramped and also locals should be faster to execute in lua.
You could instead of comm use the xr_motivator.npc_community - it's the same value.

Globals are variables shared between more scripts. If it hasn't got the local before it it's a global.
  17:31:48  25 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
I'll try out the scripting now. One more question - can it be adapted for looting?
  17:46:26  25 March 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432

---QUOTATION---
This is the latest smp variant. It still got some rough edges. On the left is a random item quests panel and on the right should be the medic panel. (i'm thinking of some health related problems triggered by passing time) that will be available when talking to a medic.

http://screenshot.xfire.com/s/122514713-4.jpg

From what i've seen a call from the xr_motivator with the is_talking() function could be used for your problem.
---END QUOTATION---



That UI looks pretty good. Is there somewhere I could download just the UI? I'd like to fiddle around with it
  17:55:54  25 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/25/2012 18:01:47
Messages: 1072
Well, thanks Lijenstina, those script lines work a charm. Only issue now is with the blasted trader...his icon refuses to show up. However, the one for the Stalkers is working, in two instances - either when I specify a patch to be shown specifically for their faction, or when the command is given under the final 'else' (in that instance, I was testing it so that only the trader icon is shown for a specific faction, the Traders, while all others get given the Stalker one).

However, it just doesn't feel like showing anything for Sidorovich - maybe traders are treated differently. It definitely works for the military in the test script (they get given the 'else' texture).
  18:30:56  25 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/25/2012 18:31:17
Messages: 1902
Try with "trader" - for Barkeep that should work. Sidorovich is a mutant class - a puppet that plays animations. His animations are controlled in the mob_trader.script. Hm maybe that means you need to add a check in the bind_monster.script just for Sidorovich.
  19:28:25  25 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/25/2012 22:42:55
Messages: 1072
No wonder Sid never leaves his bunker...he'd get creamed by the other Stalkers for being a mutant.

Maybe with Sidorovich I could check that the npc talking is Sidorovich, as in this instance he's a specific NPC?

EDIT: Rather than double posting...is there any way this function can be modified to also work for looting NPCs?
  00:16:12  26 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/26/2012 0:25:07
Messages: 1902
function CTreasure:use(npc) in treasure_manager should give you the community. However you need a check for the stash / body search. For that use the ui_car_body and the ui_car_body_hide infoportions.


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

  00:48:38  26 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Thanks, I'll look into it tomorrow.
  18:47:31  26 March 2012
profilee-mailreply Message URLTo the Top
ZaGaR
Skaarj Hybrid - NaPali survivor
(Resident)

 

 
On forum: 07/24/2007
Messages: 647
Kaidoni, if you plan to relax the use of both slots for the weapons, have you found animatios/visuals with single-handed option for these pieces? Most mods have the absurd situation where you climb the ladders holding a RPK, both hands visible . Utter nonsesne.
  18:55:30  26 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/26/2012 19:45:12
Messages: 1072
I'm bloomin' clueless (and hopeless). While it's probably very similar to the first method for living NPCs, I can't figure this out for the treasure manager script. I've meddled about a bit, but I'm no scripter... Obviously I don't call it in the treasure_manager script, since it seems to either do nothing or it totally kills the script. As for xr_motivator, I've had a few tries, but it certainly didn't like what I was doing. Unless, of course, everything has to be done with my custom ui script and bind_stalker...which I have been trying.

EDIT 2:


function ui_faction:Update()
  CUIScriptWnd.Update(self)
	
  if treasure_manager then
	if (npc and db.actor) then
		if has_alife_info("ui_car_body") then
			npc_comm = npc:character_community()
		end
	end

	local faction = npc_comm

	if faction == "stalker" then
	  self:display_texture("stalker")
	elseif faction == "trader" then
	  self:display_texture("stalker")
	elseif faction == "bandit" then
	  self:display_texture("bandit")
	elseif faction == "military" then
	  self:display_texture("military")
	elseif faction == "dolg" then
	  self:display_texture("dolg")
	elseif faction == "freedom" then
	  self:display_texture("freedom")
	elseif faction == "ecolog" then
	  self:display_texture("ecolog")
	elseif faction == "killer" then
	  self:display_texture("killer")
	elseif faction == "monolith" then
	  self:display_texture("monolith")
	elseif faction == "csky" then
	  self:display_texture("csky")
	else
	  self:display_texture("empty")
	end
  end
end



Well, if I go with the following in bind_stalker...


	if (npc and db.actor) then
		if has_alife_info("ui_car_body") then
			ui_faction.add_custom_inv()
		else
			ui_faction.remove_custom_inv()
		end
	end



...nothing appears. But if I just go with if db.actor then the blank texture appears (basically the background on which the faction patches appear - I have to have it so that it will blend properly with the ui, or there's a white border around any of my textures). However, it appears for both dead NPCs and stash boxes.

EDIT: No plans to relax the use of slots any longer. Slot 1 will now be for pistols and the small shotguns since it just looks better overall.
  10:00:49  27 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/27/2012 10:06:17
Messages: 1902

function ui_faction:Update()
  CUIScriptWnd.Update(self)
    local faction = "none"
    if db.actor then
      if has_alife_info("ui_car_body") then 
            if treasure_manager and treasure_manager.npc_comm then
	         faction = treasure_manager.npc_comm
	    else 
		  faction = "none"
	    end
        elseif db.actor:is_talking() then
            if xr_motivator and xr_motivator.npc_talks then
                  faction = xr_motivator.npc_community or "none"
            else
	          faction = "none"
	    end
	else
	     faction = "none"
	end
    end
    if faction == "stalker" then
	  self:display_texture("stalker")
	elseif faction == "trader" then
	  self:display_texture("stalker")
	elseif faction == "bandit" then
	  self:display_texture("bandit")
	elseif faction == "military" then
	  self:display_texture("military")
	elseif faction == "dolg" then
	  self:display_texture("dolg")
	elseif faction == "freedom" then
	  self:display_texture("freedom")
	elseif faction == "ecolog" then
	  self:display_texture("ecolog")
	elseif faction == "killer" then
	  self:display_texture("killer")
	elseif faction == "monolith" then
	  self:display_texture("monolith")
	elseif faction == "csky" then
	  self:display_texture("csky")
	else
	  self:display_texture("empty")
	end
  end
end



Add that code in the xr_motivator and the treasure_manager. Also add a global on the top of the treasure manager.
npc_comm = nil

This update code would work for displaying if the npc is talking and looting.
  13:40:03  27 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/27/2012 15:12:57
Messages: 1072
Bit more confused now. The ui_faction update function is from the custom ui script, not sure how it fits into treasure_manager or xr_motivator (not doubting your knowledge or anything, just a little confused by it needing to be placed in other scripts also), or how I'd change the function in the ui_faction script (where I call the different textures - e.g. "stalker" refers to the ending of the relevant texture, as the script incudes self.overlay:InitTexture("ui\\ui_faction_" .. idx)).

In fact, here's the ui script above the update function:


class "ui_faction" (CUIScriptWnd)

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

function ui_faction:InitControls()
  self:Init(0, 0, device().width, device().height)

  self.overlay = CUIStatic()
  self.overlay:SetAutoDelete(true)
	-- replace x, y with position of overlay texture (position on hud)
	-- and w, h with overlay texture's width and height, respectively
	-- you can use device().width instead of w if you want to set screen's
	-- width as a texture width
  self.overlay:Init(510, 613, 60, 60)
  self.overlay:InitTexture("ui\\ui_faction_empty")
  self.overlay:SetStretchTexture(true) -- to stretch texture based on w, h
  self.overlay:Show(false)
  self:AttachChild(self.overlay)

  self.hud_stage = "no"
end

--initialize and display overlay textures
function ui_faction:display_texture(idx)
	if self.hud_stage ~= idx then
		self.overlay:InitTexture("ui\\ui_faction_" .. idx)
		self.overlay:Show(true)
		self.hud_stage = idx
	end
end



Ignore the co-ordinates where I'm placing the texture...just placing them there for now in tests in the event that they appear *below* the main loot or trade panel textures, so at those co-ordinates they can be seen under a glass panel).

Sorry for my stupidity, I easily got the xr_motivator changes, but not the treasure_manager changes.

Also, here's what I currently have in xr_motivator for the trade screen textures (a slight modification on what you wrote):


	if self.object:is_talking() then
		npc_talks = true
		npc_community_trade = self.object:character_community()
		npc_rank_trade = self.object:rank()
	else
		npc_talks = false
		npc_community_trade = nil
		npc_rank_trade = nil
	end

  15:29:12  27 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/27/2012 15:39:47
Messages: 1902
Sorry i did post it hastily.

I meant the code that i posted before ( my two previous posts mentioning xr_motivator and treasure_manager ) not the last post which is HUD/UI related.

The update function from the last post should go in your HUD/UI script.

To update the textures You need to know what is the community of the corpse that is looted - that is the code in the treasure_manager. The code in xr_motivator should return the community of the npc engaged in the conversation with the player.

Haven't looked into your new attach child code - should work - the main issue is knowing what to display.
  16:38:19  27 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/27/2012 17:12:30
Messages: 1072
That's okay, I'd probably be confused anyway. It's a wonder I got anything done with the ui, since I've mainly done it on the fly.

New problem...


Expression    : fatal error
Function      : CScriptEngine::lua_error
File          : E:\stalker\sources\trunk\xr_3da\xrGame\script_engine.cpp
Line          : 73
Description   : <no expression>
Arguments     : LUA error: ...ow of chernobyl\gamedata\scripts\bind_stalker.script:398: attempt to index global 'ui_faction' (a nil value)



Here is the code, just as you posted (I hope, anyway):


function ui_faction:Update()
	CUIScriptWnd.Update(self)
	local faction = "none"
	if db.actor then
		if has_alife_info("ui_car_body") then 
			if treasure_manager and treasure_manager.npc_community_loot then
				faction = treasure_manager.npc_community_loot
			else 
				faction = "none"
			end
		elseif db.actor:is_talking() then
			if xr_motivator and xr_motivator.npc_talks then
				faction = xr_motivator.npc_community_trade or "none"
			else
				faction = "none"
			end
		else
			faction = "none"
		end
	end
    if faction == "stalker" then
	  self:display_texture("stalker")
	elseif faction == "trader" then
	  self:display_texture("stalker")
	elseif faction == "bandit" then
	  self:display_texture("bandit")
	elseif faction == "military" then
	  self:display_texture("military")
	elseif faction == "dolg" then
	  self:display_texture("dolg")
	elseif faction == "freedom" then
	  self:display_texture("freedom")
	elseif faction == "ecolog" then
	  self:display_texture("ecolog")
	elseif faction == "killer" then
	  self:display_texture("killer")
	elseif faction == "monolith" then
	  self:display_texture("monolith")
	elseif faction == "csky" then
	  self:display_texture("csky")
	else
	  self:display_texture("empty")
	end
end



In bind_stalker, my line reads:


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



I am now aware that I should also have ("ui_car_body" in there in addition, but I don't think that'd be responsible for the nil CTD.

In treasure_manager, I placed the relevant code at the end of the CTreasure:use(npc) function:


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
		if has_alife_info("ui_car_body") then
			npc_community_loot = npc:character_community()
			npc_rank_loot = npc:rank()
		end
	end
end



EDIT: Whoops...I probably should use tabs and not spaces in the scripts...EDIT 2: Now fixed in the code tags. EDIT 3: Looks a bit weird now.

The other code I posted at the top:


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_community_loot = nil
npc_rank_loot = nil



Only the last two lines there are relevant, but it seems that posting them anywhere else and the script didn't like that one bit.

EDIT: Fixed the nil CTD errors, but now the trade faction patches are flickering, and loot ones still show as empty (but hey, no CTD ).
  17:52:30  27 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/27/2012 17:58:19
Messages: 1902
The reason why the loot doesn't show is that the ui isn't called. Try this.


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



The flickering of textures, most likely, has to do with the display_texture function. I usually do the Show(boolean) calls.
  18:17:28  27 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/27/2012 19:02:49
Messages: 1072
Le sigh...there's always something silly missing. Mind you, my nil CTD error was due to a mix-up of spaces and tabs. I was flitting between one and the other, plus there was an extra end after I meddled about a bit.

EDIT: Nope, still not appearing it seems...

Plus the rank isn't appearing properly either with my other script.

EDIT 2: I went back to the old separate script method because the symbol kept flickering on the trade panel. Now it doesn't flicker any more. Still, the rank texture does not appear (and I made sure that the placeholder texture for rookies wasn't the blank texture)...
  19:15:00  27 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
Post the script on the paste.bin

Should work maybe some detail is wrong.
  19:36:21  27 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/27/2012 20:25:46
Messages: 1072
Here is my ui_npc_rank script:

http://pastebin.com/sVTidfi8

Here is the older ui_faction script (the one where the faction patch flickers on and off):

http://pastebin.com/fxR4YuM3

As for xr_motivator, all I made was a simple adjustment:


	if self.object:is_talking() then
		npc_talks = true
		npc_community_trade = self.object:character_community()
		npc_rank_trade = self.object:character_rank()
	else
		npc_talks = false
		npc_community_trade = nil
		npc_rank_trade = nil
	end



Here's my other script for looting:

http://pastebin.com/1h2HA0wv

It only ever allows the blank texture to appear (by blank or empty, I mean the background on which any patch is placed, it can actually be seen).

Here's the excerpt from treasure_manager:

http://pastebin.com/1wQdxSAn
  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?
  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.
  19:25:43  30 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
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.
---END QUOTATION---



So what you needed were the high quality icons right?
  20:23:12  30 March 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Yep, the equivalents to the large grey - that colour probably not necessary in this instance - and coloured radiation/blood drop icons (but instead for health, stamina, and psy-health).
  20:40:57  30 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
03/30/2012 20:41:07
Messages: 1890

---QUOTATION---
Yep, the equivalents to the large grey - that colour probably not necessary in this instance - and coloured radiation/blood drop icons (but instead for health, stamina, and psy-health).
---END QUOTATION---



I was wondering how i should arrange them? like, an empty dds file or the one you send me?
  00:19:17  31 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/31/2012 0:41:15
Messages: 1072
An empty dds file will be fine, since they are separated out into their own individual texture files anyway.
  00:44:22  31 March 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
An empty dds file will be fine, since they are separated out into their own individual texture files anyway.
---END QUOTATION---



Thats what i needed
  14:36:51  31 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/31/2012 15:44:49
Messages: 1072
Just one more scripting question - should I wish to show the player's faction in the inventory, do I place a check on community in bind_stalker (along with a global such as player_comm = nil at the top of the script), under function actor_binder:update(delta), and modify the ui_faction.script accordingly? Or would it be more complex than that?

EDIT: Nope, which shows how stupid I am. Nevermind. While it'd be nice to have the same in the inventory like in COP (name and faction along with player's pic), it might be wasting space also.
  18:55:13  2 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/02/2012 20:31:54
Messages: 1072
An update - will post a new screen soon, been fiddling about with the inventory screen. Suffice it to say, I found out I can incorporate a COP feature I didn't think I could - flashing icons. Rather, the flashing radiation icon from the COP inventory. All it takes is a line in an xml file for the texture and it works (I was skeptical about that - I didn't think it would be so simple, and that some more complex changes would have to be made somewhere else).

Only thing is...it shows at the wrong size, and it won't change colour based on severity. Hmmm, gonna have to figure that out. Missed a couple of lines in the script I believe.

Here's the script:


class "ui_cop_rad" (CUIScriptWnd)

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

function ui_cop_rad:InitControls()
    self:Init(0, 0, device().width, device().height)
    local xml = CScriptXmlInit()
    xml:ParseFile("ui_cop_rad.xml")
	self.rad_green = xml:InitStatic("rad_green", self)
	self.rad_yellow = xml:InitStatic("rad_yellow", self)
	self.rad_orange = xml:InitStatic("rad_orange", self)
	self.rad_red = xml:InitStatic("rad_red", self)
	self.rad_green:Show(false)
	self.rad_yellow:Show(false)
	self.rad_orange:Show(false)
	self.rad_red:Show(false)
	self.rad_green:Init(592, 478, 40, 40)
	self.rad_yellow:Init(592, 478, 40, 40)
	self.rad_orange:Init(592, 478, 40, 40)
	self.rad_red:Init(592, 478, 40, 40)
end


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

	local rad = db.actor.radiation * 100

	if rad > 0 then 
		self.rad_green:Show(true)
	elseif rad > 25 then
		self.rad_yellow:Show(true)
	elseif rad > 50 then
		self.rad_orange:Show(true)
	elseif rad > 75 then
		self.rad_red:Show(true)
	else
		self.rad_green:Show(false)
		self.rad_yellow:Show(false)
		self.rad_orange:Show(false)
		self.rad_red:Show(false)
	end
end

  local HUD_b = nil

function add_custom_inv()
   if HUD_b == nil then
     HUD_b = ui_cop_rad()
    get_hud():AddDialogToRender(HUD_b)
  end
end

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



I know, I know...bit mucked up. It doesn't CTD, and the flashing green icon definitely appears (regardless of radiation level, as long as it's > 0...it's only meant to be up to around 25%, then replaced by another). It also appears at the size the texture file is (easy fix, I can change the texture file itself), but in my xml I place it at 40x40 (I consider resizing there to be better than mucking with the actual texture). Is it safe to remove the lines from the xml relating to width and height, and be able only to use the script for that?

EDIT: I'm aware I've probably messed up the update function...
  19:07:52  3 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/03/2012 19:09:19
Messages: 1072
Le sigh...anyone know why the hell my xml values are *NOT* being used?


class "ui_cop_rad" (CUIScriptWnd)

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

function ui_cop_rad:InitControls()
    self:Init(0, 0, device().width, device().height)
    local xml = CScriptXmlInit()
    xml:ParseFile("ui_cop_rad.xml")
	self.rad_green = xml:InitStatic("rad_green", self)
	self.rad_yellow = xml:InitStatic("rad_yellow", self)
	self.rad_orange = xml:InitStatic("rad_orange", self)
	self.rad_red = xml:InitStatic("rad_red", self)
	self.rad_green:Show(false)
	self.rad_yellow:Show(false)
	self.rad_orange:Show(false)
	self.rad_red:Show(false)
end


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

	local rad = db.actor.radiation * 100

	if rad > 0 then 
		self.rad_green:Show(true)
	elseif rad > 25 then
		self.rad_green:Show(false)
	elseif rad > 25 then
		self.rad_yellow:Show(true)
	elseif rad > 50 then
		self.rad_yellow:Show(false)
	elseif rad > 50 then
		self.rad_orange:Show(true)
	elseif rad > 75 then
		self.rad_orange:Show(false)
	elseif rad > 75 then
		self.rad_red:Show(true)
	elseif rad < 76 then
		self.rad_red:Show(false)
	else
	end
end

  local HUD = nil

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

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




class "ui_cop_rad_empty" (CUIScriptWnd)

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

function ui_cop_rad_empty:InitControls()
  self:Init(0, 0, device().width, device().height)

  self.overlay = CUIStatic()
  self.overlay:SetAutoDelete(true)
	-- replace x, y with position of overlay texture (position on hud)
	-- and w, h with overlay texture's width and height, respectively
	-- you can use device().width instead of w if you want to set screen's
	-- width as a texture width
  self.overlay:Init(598, 470, 52, 52)
  self.overlay:InitTexture("ui\\ui_cop_rad_empty")
  self.overlay:SetStretchTexture(true) -- to stretch texture based on w, h
  self.overlay:Show(false)
  self:AttachChild(self.overlay)

  self.hud_stage = "no"
end

--initialize and display overlay textures
function ui_cop_rad_empty:display_texture(idx)
	if self.hud_stage ~= idx then
		self.overlay:InitTexture("ui\\ui_cop_rad_" .. idx)
		self.overlay:Show(true)
		self.hud_stage = idx
	end
end

--update texture based on actors current condition
function ui_cop_rad_empty:Update()
  CUIScriptWnd.Update(self)
	
  local rad = db.actor.radiation * 100

	--display texture overlay based on actor's radiation levels
  if rad >= 0 then
    self:display_texture("empty")
  else
  end
end

local HUD = nil

function add_empty_rad()
  if HUD == nil then
    HUD = ui_cop_rad_empty()
    get_hud():AddDialogToRender(HUD)
  end
end

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



I'm aware I've mucked up the update function on ui_cop_rad, only the green icon appears (no progression to yellow, orange or red), but for some reason, the icon appears far too large. I've tried it at 52x52 pixels (it's *actual* size) and 40x40, yet it shows larger than 52x52 (the grey radioactive icon that it should be flashing on top of appears at it's proper size, but is smaller than what the xml is calling). Basically, the textures are being increased in size when they shouldn't be. Here's the xml:


<window>
	<rad_green x="598" y="470" width="52" height="52" light_anim="ui_slow_blinking_alpha">
	    <texture>ui\ui_cop_rad_green</texture>
	</rad_green>

	<rad_yellow x="598" y="470" width="52" height="52" light_anim="ui_slow_blinking_alpha">
		<texture>ui\ui_cop_rad_yellow</texture>
	</rad_yellow>

	<rad_orange x="598" y="470" width="52" height="52" light_anim="ui_slow_blinking_alpha">
		<texture>ui\ui_cop_rad_orange</texture>
	</rad_orange>

	<rad_red x="598" y="470" width="52" height="52" light_anim="ui_slow_blinking_alpha">
		<texture>ui\ui_cop_rad_red</texture>
	</rad_red>

	<rad_empty x="598" y="470" width="52" height="52">
		<texture>ui\ui_cop_rad_empty</texture>
	</rad_empty>
</window>

  21:08:27  4 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/04/2012 22:11:42
Messages: 1072
I figured it out...needed stretch = 1 in the xml file. D'oh!

EDIT: I've checked lua_help.script, but just curious - is there any manner in which a script can track how much the player is bleeding, or would it be overly complicated? The only thing missing from the inventory screen now is a flashing blood drop icon.
  22:27:51  4 April 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4282

---QUOTATION---
I'm aware I've mucked up the update function on ui_cop_rad, only the green icon appears (no progression to yellow, orange or red)
---END QUOTATION---


Your "if rad > 0 then self.rad_green:Show(true)" test for radiation effectively says "Always show green if there is any radiation." The else statements are never checked.

"Ever stop to think, and forget to start again?" The game already shows colored blood drop icons. You just need to do for them what you did for radiation.
  23:47:43  4 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072

---QUOTATION---
I'm aware I've mucked up the update function on ui_cop_rad, only the green icon appears (no progression to yellow, orange or red)
Your "if rad > 0 then self.rad_green:Show(true)" test for radiation effectively says "Always show green if there is any radiation." The else statements are never checked.

"Ever stop to think, and forget to start again?" The game already shows colored blood drop icons. You just need to do for them what you did for radiation.
---END QUOTATION---



Well, for radiation, there's a property that can be checked so I can return a texture to the inventory specifically. At least in lua_help there isn't anything for bleeding. The only one that leaves any question mark is morale, and I already tried that one (didn't think it would work anyway). I'm thinking back to when I considered new icons for hunger, and unfortunately there wasn't any simple way to check the actor's satiety.
  00:51:48  5 April 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
 

Message edited by:
NatVac
04/05/2012 1:05:04
Messages: 4282
I should have included the smiley on that italicized quote.

You'll find yourself continually banging up against a serious limitation: Too much of the game's feature set is hidden behind the great wall of engine binary. (You could hack the DLLs. There might also be hope in that GSC is letting game resources become more available.)

It is a strange division between what is accessible versus what isn't. The radiation icons are displayed via script; the bleeding ones are not. So even if you make use of db.actor:get_bleeding()*, you'd have to override the existing icons. That's why I indicated it would be easier to apply the same XML tweak that you did for radiation to the bleeding stuff.

You've already made significant progress, even so.

I'm not sure about morale with respect to the player. That property belongs to game_object, which has some broad application to game entities. I've seen that in places for the NPCs, but your personal morale is likely to be independent of the game's impression of it.

__________
* 0 = no bleeding. This acts the same as the health actor "property". One can read it but changing it has no effect. The radiation property is more of a true get/set property.

Edit: Actually, the else statements might be checked if there is no radiation and if you are still calling the function from bind_stalker.script's actor_binder:update() when the radiation == 0 (logical if you want to make sure stuff is turned off), but only the Show(false) for red is executed if rad == 0 (elseif rad < 76 then ...).
  01:11:39  5 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/05/2012 1:13:03
Messages: 1072
By xml tweak and overriding existing icons, I'm not entirely sure what you mean.

It is rather frustrating when some features are handled one way and others another. There's a texture for the description box in the loot panel that just cannot be changed. At all. The only way that problem was solved was by making the texture completely invisible - nothing could be moved around so that the texture was off-screen but the description text on-screen.

So, db.actor:get_bleeding() does nothing, basically?

EDIT: I tried breaking the radiation script up into four segments, one for each colour. It seemed to work, will have to try again.
  18:49:57  5 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/05/2012 18:51:36
Messages: 1072
Fixed the radiation icons completely now. Simply divided the original script into four mini-scripts, one for each of the flashing icons. There are five mini-scripts due to needing a static grey icon for them to flash on top of (I would actually place the grey icons on the inventory texture itself, but textures called via script don't seem to align exactly with the screen, they always seem to look 1 pixel off even though they aren't).
  00:10:35  6 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Ahem... wheres that updated screenshot then?
  00:36:45  6 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/06/2012 0:53:35
Messages: 1072
It's coming . I'll get it up tomorrow, since as I'm now leaving the inventory behind and moving on to the loot and trade panels. Pretty satisfied with how it's shaped up. Figured out where to look for the button settings in the unpacked COP ui xml files, so the exit and take all buttons should look pretty much the same as in COP.

As for the bleeding - one final question. Is there a way in which to simply check if the player is bleeding or not? It might be better than nothing, although it wouldn't change colour like the other symbols in the inventory (just a grey icon and a flashing icon).

One other thing - what are the correct settings in Photoshop for a .dds file? Having a little bit of trouble with spill-over of colours. Not too big a problem, it hasn't ruined anything, but if I could completely prevent it, that'd be great.
  01:36:49  6 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Bit random but related, is there a way to add a "Deposit All" button? It gets really tedious having to move everything one by one.... especially when it comes to ammo.
  02:54:46  6 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735

---QUOTATION---

As for the bleeding - one final question. Is there a way in which to simply check if the player is bleeding or not? It might be better than nothing, although it wouldn't change colour like the other symbols in the inventory (just a grey icon and a flashing icon).

---END QUOTATION---



I use a bleeding check in bind_stalker : update.

bleed = db.actor:get_bleeding() > 0.015

bleed is a global that can be accessed and used (by auto heal feature in this case.)

Not very efficient.
  12:24:11  6 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/06/2012 12:25:43
Messages: 1072

---QUOTATION---
Bit random but related, is there a way to add a "Deposit All" button? It gets really tedious having to move everything one by one.... especially when it comes to ammo.
---END QUOTATION---



Oh, certainly. All I need to do is replace the 'Take All' button texture with the button texture I've got from COP, and then place it at the bottom of the NPC/stash bag slots.

EDIT: Ah, seems I misread your post. I'm not sure that the player can get a 'Deposit All' button, someone else will have to answer that. Sorry.


---QUOTATION---
I use a bleeding check in bind_stalker : update.

bleed = db.actor:get_bleeding() > 0.015

bleed is a global that can be accessed and used (by auto heal feature in this case.)

Not very efficient.
---END QUOTATION---



Thanks. NatVac mentioned it too, but that changing it had no effect. I'll have to muck about with it to see if it can be of any use. If not, no real loss - it'd just be nice to have the final icon on the inventory. I don't want it to feel left out (hunger already has to be left out from those icons).
  13:34:19  6 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
 

Message edited by:
ket
04/06/2012 13:34:56
Messages: 1432
I think it probably is possible to add a "Deposit All" button, its basically the same function as "Take All", but in reverse. Hopefully somebody knows how to add a "Take All", I'll then love you forever kaidonni
  18:27:42  6 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/06/2012 18:43:46
Messages: 1072
Well, db.actor:get_bleeding() does appear to work in an initial test. I basically test for db.actor:get_bleeding with a local value, bleeding > 0. Now to test to see how far I can push the envelope on this one.

EDIT: It does seem to return different textures, as hoped for (right? Riiiight? I'm not dreaming, am I?). Only thing is, they don't completely match the textures on the main HUD in terms of colour severity (mine end up going from green to yellow to orange to red and back, but not at the same time, so I have the actual values off for when to call the different textures). Anyone know the actual values of bleeding that correspond to the HUD colour symbols, or ones that correspond closely? I'm working on values between 0 and 1, and mine correspond closely, but not exactly, and it might be that margin for error that creates a false sense of panic (seeing a green icon on the HUD, but a yellow one in the inventory? ).
  18:44:11  6 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
It has been quite some time since I looked at it but I believe bleeding can exceed 1.
  18:51:29  6 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/06/2012 21:19:35
Messages: 1072
Well, I think I got the transition down between the yellow and orange symbols (~0.6), but the green remains for higher than 0.3. As for it exceeding 1, the final flashing icon will cover anything above a certain number, so it doesn't matter too much. Just guesswork for the most part with the other icons. I'm thinking 0.35 and 0.7 for going to yellow and then orange, with red 1 and above. Easy changes. I just didn't expect the db.actor:get_bleeding() function to work this way (at least, that's what I thought NatVac was talking about, that it didn't work properly).

EDIT: Also fixed the update functions so that I only need one for either bleeding or radiation (I split them each into four mini-ones, but that was a waste, and I figured out where the logic was wrong). I now have to bloomin' track down the closest values where the HUD blood and radiation icons change colour, because I want my inventory icons to match the timing as close as possible (nevermind that the HUD will have different effects for bleeding and irradiation, not symbols; however, I do prefer to match the symbol to the severity of the bleeding/radiation as defined by the game).
  00:55:16  8 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
http://www.moddb.com/members/kaidonni/images/cop-inspired-inventory-wip

An update, albeit small. Mainly been moving the inventory panel around, figuring out what works best where. The health, stamina and psi-health buttons are placeholder textures only, the final ones will be much better, courtesy of Loner1 (I'm no texture artist - please note this inventory was done via lots of copy and paste and clone stamp, and the radiation and bleeding icons are from COP).

I have no idea what's happening at the top of the backpack...some weird texture has appeared just above the backpack slots. It isn't there in Photoshop, neither in my dds or psd files (I double-save to make sure I have a fallback if the dds mucks anything up).

I'm happy with where I have the inventory now. It's just what to do with the info box when it comes to the trade and loot panels (mainly the trade panel - I need to balance the sizes of the backpacks and buy/sell boxes for that, and the info box, even changed for that screen, will take up a lot of space if I keep the pic in). I like the info box with the pic in the inventory screen, though (I can change it if people think the info pic was always a waste of space).

I have already started on the loot panel, and the trade panel will be very similar (just buy/sell parts to the panel, plus the money text, really). Still using OGSE as the base, but all my changes will be available as stand-alone.
  01:36:36  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
04/08/2012 14:55:20
Messages: 1890
Here is the download with coloured icons and the standard grey ones

link: REMOVED
  12:52:11  8 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/08/2012 12:53:46
Messages: 1072
Thanks . They look much better than the COP symbols, and their style fits much better.
  14:49:39  8 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Thats looking really good now. One thing though, the bars for the condition of the gun, its accuracy etc, any change of using thicker bars rather than lots of thin bars? It'll fit way better with the rest of the UI IMO.
  14:55:37  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
04/08/2012 14:59:23
Messages: 1890

---QUOTATION---
Thanks . They look much better than the COP symbols, and their style fits much better.
---END QUOTATION---



Np man, thats what i do


---QUOTATION---
Thats looking really good now. One thing though, the bars for the condition of the gun, its accuracy etc, any change of using thicker bars rather than lots of thin bars? It'll fit way better with the rest of the UI IMO.
---END QUOTATION---



I think this is better, its a CoP like hud so the striped bars fit. The original shoc style was just fat bars, which is nothing like CoP
  15:13:04  8 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
I've been looking at your colour versions of the icons and trying my own out (hope you don't mind). How did you colour your colour versions? I'm going for two overlays of a particular colour (green, yellow, orange, red) and then an overlay of white. They look rather neon in glow, hopefully that works.
  15:14:58  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
I've been looking at your colour versions of the icons and trying my own out (hope you don't mind). How did you colour your colour versions? I'm going for two overlays of a particular colour (green, yellow, orange, red) and then an overlay of white. They look rather neon in glow, hopefully that works.
---END QUOTATION---



Used a simple saturation table i made the icon grey, put a sepia layer on top and used the saturation table to get the same color for each and every icon and i dont mind
  15:26:38  8 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Now comes the 'fun' part - separating each icon, grey and colour, into a 52x52 pixel texture. There should be an update later this afternoon of a screen with the icons on (a number of screens showing different colours).

I noticed your dds files were 50x50, while Photoshop forces me to use a value to the power of 4. What sorcery is this?
  15:36:19  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
 

Message edited by:
LoNer1
04/08/2012 15:36:36
Messages: 1890

---QUOTATION---
Now comes the 'fun' part - separating each icon, grey and colour, into a 52x52 pixel texture. There should be an update later this afternoon of a screen with the icons on (a number of screens showing different colours).

I noticed your dds files were 50x50, while Photoshop forces me to use a value to the power of 4. What sorcery is this?
---END QUOTATION---



id say center them. just create a 52x52 canvas and center my 50x50 one with a margin of 2px on each side. should do the trick
  16:08:38  8 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/08/2012 16:16:06
Messages: 1072
http://www.moddb.com/members/kaidonni/images/cop-inspired-inventory-adding-in-loner1s-icons

An update. All icons are coloured here (can't have a test without blood or radiation, now, can we? ). The blood drop and radiation icons are actually flashing, but a screenshot can't really capture those moments.

However...I think the .dds files have mucked up again. Might try saving them only as tga's, see if I can prevent any spill-over or blending.

The actual buttons are 45x45 pixels, and without a blending edge for the alpha channel, they'd have a white box around them. Three pixels around each texture are that blending edge, and 48x48 wouldn't have given me enough room for it, so I had to go for 52x52. It'd never fit perfectly in the middle, so I had to mess about with placing the buttons over my inventory to determine where the textures as a whole were to be placed to get the button itself in the right place.

I might try less vivid colours also for the icons, as the bleeding one now seems right on, but the others too neon in glow.
  16:19:30  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890
Looking really good! And yes, some colours are a bit bright but, other than that, perfectly done
  18:27:35  8 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/08/2012 18:28:20
Messages: 1072
http://www.moddb.com/members/kaidonni/images/updated-icons-less-vivid

New update. Couldn't keep them as tga's (game crashed), so appended the end to dds files, but didn't save them as dds files (hopefully the spill-over is solved for now, will check up more on dds file settings in Photoshop so I don't have to use this 'solution').

Again the bleeding and radiation icons are flashing, don't think I caught them at their brightest.
  22:32:48  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
http://www.moddb.com/members/kaidonni/images/updated-icons-less-vivid

New update. Couldn't keep them as tga's (game crashed), so appended the end to dds files, but didn't save them as dds files (hopefully the spill-over is solved for now, will check up more on dds file settings in Photoshop so I don't have to use this 'solution').

Again the bleeding and radiation icons are flashing, don't think I caught them at their brightest.
---END QUOTATION---



What animation file are you using? i can make you a special one if you need?

i guess ui_slow_blinking_alpha
  23:18:52  8 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/08/2012 23:19:48
Messages: 1072
No need for a special animation file, but thanks anyway.

I'm using ui_slow_blinking_alpha. It's just when I take the screenshot.

Of course, the flashing icons don't actually match up in flashing (so if I start bleeding after being dosed with radiation, their flash cycles don't take place at the same time). I'd have to combine the different functions for that (such as one that checks for both bleeding and radiation, and it could select a particular texture made from a combination of the two sets of colour icons, but that'd be too fiddly).
  23:32:02  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890
True, too much hacking and oddly placed textures. It would screw up on 16:9 anyway.

Talking about that, did you already test this on widescreens?
  23:35:37  8 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/08/2012 23:37:33
Messages: 1072
Not yet, but once I've got the 4:3 version done, I'll look at the widescreen version. By then I'll have most features in place, so it'll simply be a matter of moving x-axis co-ordinates for the most part.
  23:49:16  8 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
Not yet, but once I've got the 4:3 version done, I'll look at the widescreen version. By then I'll have most features in place, so it'll simply be a matter of moving x-axis co-ordinates for the most part.
---END QUOTATION---



True, wish the dev's had a tool for this
  00:14:31  9 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/09/2012 0:17:38
Messages: 1072
Meh, Photoshop will do for that. I'll just have a canvas with the proportions of the base 16:9 screen, and work with that.

For that matter, what is the base 16:9 screen size? For COP, looking at the ui xml files there, it's 1280x768. What about SOC?
  01:07:55  9 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
Meh, Photoshop will do for that. I'll just have a canvas with the proportions of the base 16:9 screen, and work with that.

For that matter, what is the base 16:9 screen size? For COP, looking at the ui xml files there, it's 1280x768. What about SOC?
---END QUOTATION---



i think 1366x768. idk for sure
  00:57:44  10 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Generally speaking, 15.6" screens use 1366*768 native, 22" screens 1680*1050 or 1920*1080
  16:43:02  10 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890

---QUOTATION---
Generally speaking, 15.6" screens use 1366*768 native, 22" screens 1680*1050 or 1920*1080
---END QUOTATION---



?

how is this relevant to his question ket?

  20:47:31  10 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Always useful to know standard native resolutions when making stuff like this. You can make sure stuff like the text isn't too small even on smaller screens.
  17:12:25  11 April 2012
profilee-mailreply Message URLTo the Top
Cromm Cruac
Сделано в Чернобыле
(Resident)

 

 
On forum: 11/19/2009
Messages: 1143

---QUOTATION---
Meh, Photoshop will do for that. I'll just have a canvas with the proportions of the base 16:9 screen, and work with that.

For that matter, what is the base 16:9 screen size? For COP, looking at the ui xml files there, it's 1280x768. What about SOC?
---END QUOTATION---



You need to work on 1280x768 'matrix'. That's the only acceptable size for widescreen in all Stalker games. This resolution is scaled to all 16:10 and 16:9 screens.
Here is an image that explains how it works in Stk. It's about scopes but it works like that for all UI elements.
http://up.oblivionlost.pl/images/52099226436300436163.jpg
  00:26:57  12 April 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340

---QUOTATION---
You need to work on 1280x768 'matrix'. That's the only acceptable size for widescreen in all Stalker games. This resolution is scaled to all 16:10 and 16:9 screens.
Here is an image that explains how it works in Stk. It's about scopes but it works like that for all UI elements.
http://up.oblivionlost.pl/images/52099226436300436163.jpg
---END QUOTATION---


Holy hell. I'd spent weeks trying to work out how the **** GSC setup widescreen. You should see the pages of notes and calculations I've spent on this.
You sir are a legend

Now I can finally make all my custom UI's widescreen.
  00:54:08  12 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/12/2012 0:54:20
Messages: 1072
A highly useful resource indeed. Slightly confusing at first...mainly owing to the fact it's about varying widescreen monitors and not just 1280*768. Thanks.
  02:43:46  12 April 2012
profilee-mailreply Message URLTo the Top
Cromm Cruac
Сделано в Чернобыле
(Resident)

 

 
On forum: 11/19/2009
 

Message edited by:
Cromm Cruac
04/12/2012 2:46:42
Messages: 1143
The idea is very simple. It may be confusing what I told you before. Let me explain.
xRay has one 'matrix' of 1024x768. This matrix is scaled up (or down) to any resolution set in the options.
For widescreen (16:9, 16:10) all the elements have to be squeezed horizontally so 1280x768 pseudo-matrix (mentioned above - ie Photoshop UI build) must be fit into xRay 1024x768 matrix.
Basically the trick to make widescreen version is to multiply all the x and width values x0.8. Additionally for elements on the right hand side we must add 204 to x
  13:13:47  12 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/12/2012 13:14:45
Messages: 1072
Ah, so I'll have to take my current 1024x768 version and scale it by 0.8, and then place it on another canvass at least 1024x768 pixels in size.
  13:37:24  12 April 2012
profilee-mailreply Message URLTo the Top
Cromm Cruac
Сделано в Чернобыле
(Resident)

 

 
On forum: 11/19/2009
Messages: 1143
Not at least but exactly 1024x768
  15:14:45  12 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
I usually go for 1024*1024 so I have extra space for other items, such as buttons (e.g. the 'Exit' button for the inventory is in the same file as the main inventory texture, but below the 768 mark).
  14:30:51  13 April 2012
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4282
>> By xml tweak and overriding existing icons, I'm not entirely sure what you mean.

That's good, Kaidonni, because I confused the HUD display (with existing bleeding icons) with the inventory display. (I know the rule about not posting when I'm tired, but when I'm tired I don't remember the rule. )

I meant that since you added radiation icon blinking via XML tweak, you could do the same for bleeding, which I think you did.

>> So, db.actor:get_bleeding() does nothing, basically?

I gave you too much info. 1) You don't have to override the icons; see above. 2) The context of what I said for db.actor:get_bleeding(): "0 = no bleeding. This acts the same as the health actor 'property'. One can read it but changing it has no effect. The radiation property is more of a true get/set property."

I was noting the lack of consistency. Both radiation and health are game_object "properties" but only radiation acts like a true property per software conventional usage/definition.

As you figured out, the get_bleeding() function does the same thing for bleeding that db.actor.health does for health -- it tells you what the current value is, but that's it. When you are bleeding, the values are non-zero as noted by others. Zero means you are not bleeding. Meanwhile, health values start at 1 for perfect health and can drop to 0 (dead) if bleeding stays positive. But it is not a true property; you can't change it by assigning a value to "bleeding".

I'm under the impression that the game doesn't show certain icons until after a certain threshold is exceeded.

This is just some clarification. You seem to be making good progress despite the confusion, mainly because you are trying things out. I'm tired again, so be equally suspicious of this post!
__________

---QUOTATION---
Bit random but related, is there a way to add a "Deposit All" button? It gets really tedious having to move everything one by one.... especially when it comes to ammo.
---END QUOTATION---


I am thinking there are several ways to do this, ket. I was considering putting a button on a search/inventory screen that would pop up a dialog. The button itself would be shown on the screen per ui_* info_portion trigger as a dynamically-added CUIButton/CUIStatic or via AddDialogToRender() -- see the multiplayer scripts for examples of this. Remove it on ui_*_hide. Add the callback(s) and support them with code to do what you want.

The dialog I'd show would be like the ABC sleeping bag dialog, with options to move all of particular types of ammo, for example. It could even be dynamically generated. Or you could have a button to unload the weapons on a body or in a stash.

¯¯¯¯¯¯¯¯¯¯
Cromm Cruac, thanks for the useful standard/wide-screen dimensions/ratio info!
  16:34:16  13 April 2012
profilee-mailreply Message URLTo the Top
ket
Senior Resident
 

 
On forum: 01/13/2006
Messages: 1432
Thanks natvac, thats given me at least some idea but I suspect you will have added such a option before I get chance to even try. My to-do list is pretty massive atm and right at the bottom of it is to figure out why my code for spawning mutants doesn't work or outright crashes the game when I add it to bind_stalker (figured adding the code to bind_stalker was the best way to add mutant spawns so they wouldn't uncontrollably spawn every time the player enters a level, loads a save or dies)
  17:16:01  23 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/23/2012 20:47:54
Messages: 1072
Rumours of Scar succeeding in killing me are greatly exaggerated...

That is to say, I am still working on the UI. Had a bit of a rest since tweaking the inventory colour icons.

Now I'm almost finished with the trade and loot panels, with one small caveat as regards the trade panel...where is the code for the 'Not enough money' message that flashes up when clicking 'Trade' and well, the player doesn't have enough money? At the moment, it's appearing over an unused part of the panel (nothing will go in there, but it is an opaque surface so the text appearing over it looks rather out of place). If I could get it to appear over the description box, it would probably fit in better.

EDIT: More pics up now.
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-trade-and-loot-panels#imagebox
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-trade-and-loot-panels1#imagebox
  16:45:11  24 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/24/2012 16:56:27
Messages: 1072
The easiest part of the HUD by far...

http://www.moddb.com/members/kaidonni/images/dialogue-screen-for-cop-hud#imagebox
http://www.moddb.com/members/kaidonni/images/dialogue-screen-for-cop-hud1#imagebox

While I am still using OGSE as a base (you may have noticed the tasks in the screenshots are in OGSE), I will shortly be porting my work over to vanilla Stalker.

It's now time to tweak the HUD itself (PDA mini-map in top corner, covered with black texture when a weapon is drawn, and various HUD overlay effects). After that, the repair and sleep ui (except this is where I run into a problem - many mods use different designs for the sleeping bag ui).
  17:51:33  24 April 2012
profilee-mailreply Message URLTo the Top
LoNer1
Настоящий Cталкер, Русская Версия
(Resident)

 

 
On forum: 10/23/2009
Messages: 1890
I might reskin those... ill get back at you later.
  23:14:49  25 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/26/2012 0:07:48
Messages: 1072
I've had a brain fart...where the heck can I find the code for the NPC counter for the mini-map? I thought it was in zone_map.xml, but it doesn't seem to be. I can't remember where it is meant to be...

I actually can't remember how I solved this issue before in previous attempts to change the HUD back in 2010/2011. I think I just moved the map texture off the screen...

Take this as a lesson - never try to mod after playing a game of Scrabble!

EDIT: Nevermind, there wasn't ever any counter in the xml file. Meh, moving that element off-screen, it won't muck up the rest of the minimap anyway.
  01:13:52  26 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Now I can't find out where the dinamic_hud.script is called in OGSE...I need to make sure it is called in the correct order with the health, stamina and radiation overlays from the md_indicator.script (otherwise, the masks appear on top of those textures which defeats the whole purpose of the overlays...).
  16:17:03  26 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Still cannot figure out where to call the overlays...maybe they shouldn't have been called this way at all, via xml? They need to be called so they appear on top of the masks (so if the player is wearing a mask, the overlay won't be covered).
  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.
  00:33:34  28 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
If I disable the ui_main check and switch to one of those 4 slots then a texture appears on top of my minimap. That sounds like what you want.
  00:47:46  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 1:23:07
Messages: 1072
Well, I'll have to try again tomorrow. I removed the ui_maingame check also, but messed about with the script and it's getting late, so I'm probably doing something stupid that's causing it to not work for me... Thanks for the help. I'll come back to it in the morning.

EDIT: I lie...tried some more, but still nothing at all. I even tried the previous update function in ui_cop_pda where I had the check on ui_maingame (removing that in this instance) and calling the add_custom_inv() function in actor_binder:net_spawn(data). I have no idea why it just refuses to work...
  01:46:39  28 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
I don't know. You don't have both normal and _16 versions of the xml and making changes to wrong version?
  12:32:36  28 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
No _16 version yet. Still finishing the normal version. Definitely editing the correct xml files and correct script files.
  15:21:31  28 April 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
04/28/2012 15:21:54
Messages: 1902

---QUOTATION---
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...).

---END QUOTATION---



That mod seems the bioradar mod modified to show artifacts instead of mutants with the hud item usage added

What are you trying to do ? Overlay the minimap ? For that you can call the hud on level load no need for the update call in bind_stalker.
  16:26:29  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 17:08:02
Messages: 1072
Well, the overlay needs to turn on and off depending on the situation. It has to turn off with the bolt or binoculars out, or no active item. Unique to OGSE, since the blowouts affect the PDA itself, the overlay will need to also appear when a blowout hits (there is already something in OGSE I can call for that).

EDIT: Also, on the bioradar point...in theory, how difficult would it be to change it so that the bioradar detected artifacts with the correct 'map' equivalents to the detector panels from COP? A lot like in the video Loner posted?
  19:17:01  28 April 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
Add some debug in the script. Test the xml code independently of the script. I just know that using the the sample script (altered to use my xml file and texture) I can call and dismiss the texture to hud by changing active slot.

The only difference other than the xml is that I do not call the update in bind_stalker. I start the hud on map load and remove it on map destroy and use the update in the class definition to check the conditions and show or hide the textures.
  19:23:30  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/29/2012 0:27:27
Messages: 1072
I've not come across starting hud elements on map load. Using what I've been using for the other elements...doesn't look like it's any good for this one though. I've no idea which script to call it in...
  13:23:56  29 April 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
On another note, still not managed to get the dynamic health/stamina/radiation overlays to call so that they aren't covered by the suit masks...

Not sure if that's particularly game-breaking though. To be honest, it might simply be something that has to be tolerated so the overlays can be in at all. The consolation is that the overlays are most relevant as health and stamina reach critically low levels and radiation reaches high levels (they are fainter at safer levels), and they can still be seen covering the HUD when they reach these levels.
  12:30:58  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 17:40:11
Messages: 1072
So...how to load a HUD on map load then remove it on the game destroying the map?

EDIT: Also a quick experiment...
http://www.moddb.com/members/kaidonni/images/different-background-for-hud
Better or worse?
  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.
  15:52:30  6 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/06/2012 15:55:46
Messages: 1072
Further to the not using the update section of bind_stalker to update icons, is it possible for the following script to be called on level load also?


class "ui_cop_blood_empty" (CUIScriptWnd)

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

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


function ui_cop_blood_empty:Update()
  CUIScriptWnd.Update(self)
	
  local bleeding = db.actor:get_bleeding()

	--display texture overlay based on actor's radiation levels
  if bleeding >= 0 and has_alife_info("ui_inventory") then
    self.blood_empty:Show(true)
  else
    self.blood_empty:Show(false)
  end
end

local HUD = nil

function add_empty_blood()
  if HUD == nil then
    HUD = ui_cop_blood_empty()
    get_hud():AddDialogToRender(HUD)
  end
end

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




class "ui_cop_blood_green" (CUIScriptWnd)

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

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


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

	local bleeding = db.actor:get_bleeding()

	if bleeding > 0 and bleeding < 0.26 then 
		self.blood_green:Show(true)
	else
		self.blood_green:Show(false)
	end
end

  local HUD = nil

function add_blood_green()
   if HUD == nil then
     HUD = ui_cop_blood_green()
    get_hud():AddDialogToRender(HUD)
  end
end

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




class "ui_cop_blood_yellow" (CUIScriptWnd)

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

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


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

	local bleeding = db.actor:get_bleeding()

	if bleeding > 0.25 and bleeding < 0.51 then 
		self.blood_yellow:Show(true)
	else
		self.blood_yellow:Show(false)
	end
end

  local HUD = nil

function add_blood_yellow()
   if HUD == nil then
     HUD = ui_cop_blood_yellow()
    get_hud():AddDialogToRender(HUD)
  end
end

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




class "ui_cop_blood_orange" (CUIScriptWnd)

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

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


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

	local bleeding = db.actor:get_bleeding()

	if bleeding > 0.5 and bleeding < 0.76 then 
		self.blood_orange:Show(true)
	else
		self.blood_orange:Show(false)
	end
end

  local HUD = nil

function add_blood_orange()
   if HUD == nil then
     HUD = ui_cop_blood_orange()
    get_hud():AddDialogToRender(HUD)
  end
end

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



class "ui_cop_blood_red" (CUIScriptWnd)

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

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


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

	local bleeding = db.actor:get_bleeding()

	if bleeding > 0.75 then 
		self.blood_red:Show(true)
	else
		self.blood_red:Show(false)
	end
end

  local HUD = nil

function add_blood_red()
   if HUD == nil then
     HUD = ui_cop_blood_red()
    get_hud():AddDialogToRender(HUD)
  end
end

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



At the moment, I've got sections in the update section adding and removing the elements based on whether or not the inventory is open, as well as removing them in net_destroy. I've fiddled about a bit with the main script to see if I can add a check for
has_alife_info("ui_inventory")

, just on the empty icon for the moment, but it never appears (at all - I'd made sure to remove anything from bind_stalker's update section and only use the net_spawn and net_destroy sections).

I'm also wondering if Lijestina's scripts for calling the faction patches can have the same treatment? Or are the inventory icons and trade/loot faction patches an entirely separate issue, as they never appear unless a specific UI is open? It'd be great to not have the delay on textures appearing (most noticeable when trading with NPCs), although it's a minor issue at best.

Also, in case anyone is wondering why I divided the icons up like I did with the bleeding script, it's because I've tried them all together and they seem to overlap one another - that is, the player has to leave the inventory then come back to entirely remove the previous flashing icon, or it meshes with the present one being called in any given situation.
  16:56:16  6 May 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735
Use the single hud you created for the map texture, for your additions. You should be able to put the test for the current color of the icon in the update section.
  18:16:37  6 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/06/2012 19:36:45
Messages: 1072
One attempt that failed...


function ui_cop_health_empty:Update()
	CUIScriptWnd.Update(self)
	
	--display texture overlay based on actor's radiation levels
	local health = db.actor.health * 100
	if health >= 0 then
		if not has_alife_info("ui_inventory") then
			self.health_empty:Show(false)
		else
			self.health_empty:Show(true)
		end
	end
end



I've tried putting it other ways too, including with the info from the pda script. It just does not seem to want it to work.

EDIT: Another fail...


	if has_alife_info("ui_inventory") then
		if health >= 0 then
			self.health_empty:Show(true)
		end
	elseif not has_alife_info("ui_inventory") then
		if health >= 0 then
			self.health_empty:Show(false)
		end
	end
end



Not feeling too good at the moment, so it's probably not the best time to be messing about. Still, found an interesting bug while using the above - if the player turns the inventory on and off real fast a number of times, all the other colour icons and grey icons disappear, leaving just the above icon. LOL!

EDIT 2: Even tried...


	--display texture overlay based on actor's radiation levels
	if inventory_open ~= false then
		if health >= 0 then
			self.health_empty:Show(true)
		end
	else
		self.health_empty:Show(false)
	end
end

  20:05:29  6 May 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
 

Message edited by:
Nuor
05/06/2012 20:08:11
Messages: 735
Start by putting a debug statement in to test the values; health at least.
  20:16:22  6 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/06/2012 20:59:54
Messages: 1072
Well, the thing is, the health_empty icon does appear, but it seems only after turning the inventory on and off multiple times in quick succession, which is pretty odd...

Okay, debugging message added to amk.script:


  if ui_cop_health.ui_cop_health_empty then
    mylog("ui_cop_health script is valid")
  else
    mylog("ui_cop_health script is BROKEN")
  end



And it seems that it is valid. Er...okay. That is without referencing health.
  20:58:49  6 May 2012
profilee-mailreply Message URLTo the Top
Nuor
Senior Resident
 

 
On forum: 03/10/2009
Messages: 735

---QUOTATION---
Well, the thing is, the health_empty icon does appear, but it seems only after turning the inventory on and off multiple times in quick succession, which is pretty odd...
---END QUOTATION---



Part of the reason for putting the debug for health in is that it won't only tell you the value of health it will tell you when and if update is triggering.
  21:03:13  6 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/07/2012 1:07:25
Messages: 1072
Well, technically, no update should be triggering for this part of the UI except for when the inventory is open or closed. The health_empty is a grey button (one of those that Loner1 made), and it needs to be in there for the health_red icon as the xml entry for that texture makes it flash. I already know the other elements, the individual colour icons, work and update - it's just getting the part into the scripts where they only show when the inventory is open and not relying on bind_stalker for that.

EDIT: I just don't think it's going to work. These elements aren't always 'present' like the pda overlay, just waiting for a blowout or a weapon to be drawn, they are only made to appear when the inventory is opened. Given Lijestina's expertise in scripting and the fact he never questioned using bind_stalker update for turning the faction patches on and off, I'm assuming it simply isn't possible to load my inventory or trade/loot panel icons via net_spawn.
  15:56:02  7 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/08/2012 0:32:38
Messages: 1072
New issue...I cannot change the ui_hud_eat symbol in maingame.xml. Well, I can, but I can never change the position. For the bleeding overlay to work, icons_scroll_view must be set at x 0 and y 0, which causes a problem where the icons are in the top left corner. No issue there, the overlay covers the whole screen. Now comes the issue - I need the starvation_static, as there is no other way to check satiety, and I don't really want it in the top left corner. I've tried alternate textures, from a standalone texture file (1024x768) to extending ui_hud.dds to a full 2048x1024, and placing my eat icon where I want it to appear on the main HUD (in both cases I have made sure I referenced the texture in an xml file, the first my own and the latter ui_hud.xml), but it refuses altogether to allow this icon to appear. This doesn't really make much sense...

How do I get it to appear exactly where I want it to? I cannot change the position of icons_scroll view because it seems the individual elements themselves cannot be repositioned (I've tried). Either the eat icon appears in the top left, or there has to be a way to put it wherever I want it...

EDIT: In the meantime, new pics:
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-finished-ogse-version#imagebox
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-finished-ogse-version1#imagebox
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-finished-ogse-version2#imagebox
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-finished-ogse-version4#imagebox
http://www.moddb.com/members/kaidonni/images/cop-inspired-hud-finished-ogse-version6#imagebox

Note that the pic where I've moved the PDA minimap over for the eat icon is a later screenshot than the rest (which is why the minimap is closer to the left side of the screen in some pics). It might simply have to remain that way... It's just the way the game was coded, some things you can change, others you cannot (and some things you cannot change for some screens, whereas you can for others - the exit button for the inventory uses the same code as for the trade and loot panels, but the trade and loot panels seem to highlight the button differently, even with the seemingly responsible code from the relevant .xml files removed).

EDIT: Okay, so I can't have both the eat icon and the bleeding overlay using maingame.xml. The reason? Once the eat icon appears, the bleeding overlay moves down vertically, and a scroll bar appears. Whoops!

The following script as part of an attempt to fix this causes me trouble, though:


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

	local bleeding = db.actor:get_bleeding()

	if bleeding > 0 and not (db.actor:is_talking() or (has_alife_info("ui_inventory") or has_alife_info("ui_car_body") or has_alife_info("ui_pda"))) then
		self.blood_hud:Show(true)
	else
		self.blood_hud:Show(false)
	end
end



In bind_stalker I use net_spawn and net_destroy, not the update function. This, well...something causes a serious problem, probably in the above script. The xml code for the texture uses light_anim="ui_slow_blinking_alpha", and when opening the sleeping bag in the inventory, the sleeping bag ui keeps jumping between being on top of the inventory and behind it (the bits that overlap actually disappear behind the inventory texture). The other icons (the health, stamina, psy-health, bleeding and radiation buttons) also turn on and off (as in, they appear, then completely disappear, then re-appear). All of this is cyclical - in sync with the animation of the bleeding overlay. It also happens regardless of whether the player is bleeding or not.

Two possibilities - either the above code is faulty and needs something extra to prevent this, or I do away with the eat icon and just have the bleeding overlay. Not perfect, but better than a blood drop icon.

EDIT 2: It's a significant bug, as it happens with both the sleep and repair UI's. It might not matter so much for other mods, but then I can't be too sure about that...
  14:20:58  8 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/08/2012 17:09:39
Messages: 1072
I need help with the bleeding overlay, because the game refuses the aforementioned script. It keeps the flashing of the icons and sleep/repair boxes. I can't even seem to get a custom static in except through bind_stalker update, and that is unacceptable because there's a delay everytime it loads the overlay...

It won't even accept the following:


function hud_bleeding()
	local gcs = get_hud():GetCustomStatic("ui_hud_blood")
	if db.actor.get_bleeding() > 0 then
		if gcs == nil then get_hud():AddCustomStatic("ui_hud_blood") end
	else
		if gcs ~= nil then get_hud():RemoveCustomStatic("ui_hud_blood") end
	end
end



It simply wipes out the rest of the inventory icons. They never appear. The sleeping bag disappears on activating it.

EDIT: Here's the script at the moment, with the stupid flashing of the icons and sleep/repair UI :-

class "ui_cop_blood_hud" (CUIScriptWnd)

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

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


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

	local bleeding = db.actor:get_bleeding()

	if bleeding > 0 then
		if not has_alife_info("ui_inventory") or
		not has_alife_info("ui_car_body") or
		not has_alife_info("ui_trade") or
		not has_alife_info("ui_pda") or
		not has_alife_info("ui_talk") then
			self.blood_hud:Show(true)
		elseif has_alife_info("ui_inventory") or
		has_alife_info("ui_car_body") or
		has_alife_info("ui_trade") or
		has_alife_info("ui_pda") or
		has_alife_info("ui_talk") then
			self.blood_hud:Show(false)
		else
		end
	else
		self.blood_hud:Show(false)
	end
end

  local HUD = nil

function add_blood_hud()
   if HUD == nil then
     HUD = ui_cop_blood_hud()
    get_hud():AddDialogToRender(HUD)
  end
end

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



I've made it more complicated in the hopes that I could have avoided the bug, but it's still there... I really don't want to sacrifice the eating icon, though (I have to if I use maingame.xml for the bleeding overlay), as there is no other way to tell the player they must eat.
  23:56:36  9 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
A solution just occured to me if using a custom static or calling a texture the usual way can't work for the bleeding overlay - a post process effector. If it is a regular effect, then the colour could be tweaked to simulate the red flashing of the bleeding overlay.

All this so I can get the eat icon in...
  12:36:08  14 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Okay, after talking with Loner1 over email, unless anyone has any better ideas, it's bye-bye eat icon. Using a ppe won't do the job because only one can play at a time, and there is simply no way the game is going to accept the scripting for the overlay without screwing up the other icons in the inventory (and this would apply to any mod that incorporated a sleeping bag). I think it's because the xml code includes the slow blinking alpha animation, and it must not like loading this texture on level load. However, the point is to have it 'flashing', so that's that then...no eat icon.
  22:14:14  14 May 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
What are you trying to do ?

Custom static would show up but it will be bellow the inventory texture.

The eating icon needs to have a timer running on item use -> for the icon to show while the timer is on - in smp we used that for medhud anims and the script is a bit complicated.

If you haven't already add the CoP eating sound playing when food is used.
  12:34:50  15 May 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
05/15/2012 12:41:41
Messages: 1072
By eat icon, I mean the one that appears while the player is hungry (ui_hud_icon_eat in maingame.xml). The blood overlay I am using, however, seems to only want to work properly by taking the place of ui_hud_icon_drop in maingame.xml - but since the whole set of icons scrolls up/down when another appears, it looks really weird when the blood overlay is part off-screen with a long scroll bar on the side of the screen (and the eat icon was the only other icon in use for my HUD).

A custom static would be just fine, as we're talking about the HUD and nowhere else for the blood overlay. However, all the scripts do not want to accept it as a custom static or through a similar script to the inventory icons. The inventory icons are either completely disabled or when the sleeping bag/repair kit is open, jumping in front and behind the main inventory texture (disappearing then reappearing quite literally). I did attempt using bind_stalker update alone (there's a radiation warning in there, the text warning when it gets too high), but that's not a good idea - a delay is caused when the overlay is called.

EDIT: Oh, and indeed, both eat sounds and weapon holstering are in. Yes, weapon holstering - don't drink and shoot!
  16:26:07  2 June 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Okay, I'm planning to release my inventory mod sometime next week, certainly before I go on holiday. However, as far as the version for OGSE is concerned, there is a slight issue. When accessing the player's repair kit, the flashing bug happens again (it keeps jumping from being in front to behind the main inventory). I have no idea how to fix this, it's likely due to having the texture replacing ui_hud_drop_icon being animated so the bleeding overlay flashes (no eat icon I'm afraid, couldn't seem to get the game to accept any other method of showing a flashing bleeding overlay).

I also would like to ask if someone could adapt the UI to 16:9 (someone with a widescreen monitor).

I'll be releasing it as both an OGSE and vanilla compatible pack. It shouldn't be hard to merge it with other mods at all, at most a few .script files will need to be amended (instructions will be included).
  21:39:51  8 June 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Run into a little trouble merging the submod with vanilla xr_motivator. Not got time to fix it now, nor do I wish to do a rush job because I'll end up doing things wrong left, right, and centre, and get all frustrated, making even more mistakes. Two weeks won't hurt, anyway.
  01:59:23  9 June 2012
profilee-mailreply Message URLTo the Top
Kocayine
Senior Resident
 

 
On forum: 07/15/2010
Messages: 918
Boy, this has really turned out well! Wish I could use it, but I think it will cause some trouble with Narodnaya Solyanka.
  21:21:42  9 July 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
07/09/2012 21:48:47
Messages: 1072
Okay, I'm packaging both the vanilla compatible and OGSE 0.6.9.2 versions of the mod. However, only the 4:3 version - I need some assistance off someone who has a 16:9 monitor for the widescreen version.

Both should be up tomorrow some time, I'll post then. I'll be using Moddb to host the files.

The only textures not touched are the timers that appear during the Blowout at the CNPP when you first visit (during the military assault), and the dialogue boxes that appear when you change level. I can quickly change those tomorrow morning. Apart from that, I think I'm good to go with releasing it.
  12:35:38  11 July 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072
Downloads are up in the download section, hosting via Moddb.

Quick question...how do I obtain page info so I can link properly from one part of this forum to another?
  12:38:52  11 July 2012
profilee-mailreply Message URLTo the Top
SetaKat
Ex modder, Zones only ferret and will someday release a game
(Resident)

 

 
On forum: 02/20/2010
Messages: 6340
Right mouse click on the link you want, then open in new tab/window, and copy link.
  12:59:19  11 July 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
07/11/2012 18:07:28
Messages: 1072
Thanks.

Link for the download thread: https://www.gsc-game.com/index.php?t=community&s=forums&s_game_type=xr&thm_page=1&thm_id=21618&sec_id=17
  21:30:20  11 July 2012
profilee-mailreply Message URLTo the Top
Lyoko774
Senior Resident
 

 
On forum: 04/09/2007
 

Message edited by:
Lyoko774
07/11/2012 21:31:10
Messages: 170
Why do you need to reinstall stalker? the 1.0004 xr_motivator should be inside gamedata.dbc if I recall correctly...
Also, if you need help getting widescreen support to work (or more correctly a tester) I'd be glad to help, I have a 1080p monitor..
  22:01:11  11 July 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
 

Message edited by:
Kaidonni
07/11/2012 22:04:10
Messages: 1072
I don't know...I just use the extractor on the .db files, and since I was patched up to 1.0005, I just assumed there was only one way to access the 1.0004 xr_motivator. Besides, slight error made with the minimap background, so I had to re-upload. Anyone here who notices any part of that PDA background missing, make the following changes:

In ui_cop_pda.xml, change the width and height of the entry 'ui_cop_pda' to 283 & 194, respectively.

In motion_icon.xml, change the width and height of the background (at the top of the file) to 283 and 194 also.

Sorry about that...I just worked with the OGSE PDA as the background for the minimap for so long that, when I changed the texture for the vanilla version, I completely forgot about the xml entries. I didn't even notice when testing it.

And thanks for the offer to be a guinea pig for the widescreen version. I just need to get my head around changing the values. Even with the explanation earlier in this thread and the accompanying screenshot guide, yow...going over my head a bit. I think I need to place most of the relevant ui textures on to a 1280x768 canvas and then squish it to 1024x768 (actually 1024x1024, extra bits to fit in underneath for other ui elements), but do I? Is it just redone co-ordinates in the xml files instead? This would apply to the .script files since they also call certain textures.
  03:41:14  26 January 2013
profilee-mailreply Message URLTo the Top
FatalFunnel
(Senior)
 
On forum: 11/07/2011
Messages: 133
I've been trying out this mod since my old HUD changes screwed up the bleeding and hunger icons. Can I use it in my next release?

I made some slight modifications to the HUD part of it to suit my own needs, like removing the minimap, and all of the other indicators minus bleeding/hunger icons and the effectors it uses.

Overall, very good job, I'm impressed.
  19:37:50  27 January 2013
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072

---QUOTATION---
I've been trying out this mod since my old HUD changes screwed up the bleeding and hunger icons. Can I use it in my next release?

I made some slight modifications to the HUD part of it to suit my own needs, like removing the minimap, and all of the other indicators minus bleeding/hunger icons and the effectors it uses.

Overall, very good job, I'm impressed.
---END QUOTATION---



Permission granted, and thank you.

Good job I stopped by to check out the forums before returning to Skyrim.
  02:16:33  29 January 2013
profilee-mailreply Message URLTo the Top
FatalFunnel
(Senior)
 
On forum: 11/07/2011
Messages: 133

---QUOTATION---
Permission granted, and thank you.

Good job I stopped by to check out the forums before returning to Skyrim.
---END QUOTATION---



Thanks.
  10:25:17  31 December 2014
profilee-mailreply Message URLTo the Top
sherlokshan
(Novice)
 
On forum: 11/07/2009
Messages: 26
Alignment problem

guys any one can help me to solve the cop inspired inventory alignement is wrong. how to solve this and which file i should modified?
 
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.