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

« Previous 10 events | 1 2 3 4 5 6 7 8 9 ... 19 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  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.
 
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.