ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Clear Sky Forum » Mod discussion
NPC Looting Script fix

« Previous 10 events | 1 2 3 4 5 6 7 8 ... 11 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  07:41:21  5 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---

Have you managed to solve the problem with the script breaking the Limansk bridge mission?
---END QUOTATION---



can you be abit more specific on the problem, il see what i can do, i havnt reached there yet, in fact i should later on, just takeing breaks in-between.
  07:51:45  5 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
can you be abit more specific on the problem, il see what i can do, i havnt reached there yet, in fact i should later on, just takeing breaks in-between.
---END QUOTATION---



Sure, the problem with that mission is that all the squads tend to go off looting the dead bandits instead of doing what they're supposed to be doing. The CS squad also tend to walk across thin-air (where the bridge would be if it had been lowered) trying to get to the bodies on the other side.

The best way I can think of fixing it would be to somehow stop those squads from looting at all, although how you would do that I don't know
  08:02:54  5 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Hmm, just tried that code you suggested and it's not working at all for me, they still loot everything. Did you change anything else at all in the script? Or would you mind sending me your copy of watcher_act so I can have a look
  10:26:40  5 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
can you be abit more specific on the problem, il see what i can do, i havnt reached there yet, in fact i should later on, just takeing breaks in-between.

Sure, the problem with that mission is that all the squads tend to go off looting the dead bandits instead of doing what they're supposed to be doing. The CS squad also tend to walk across thin-air (where the bridge would be if it had been lowered) trying to get to the bodies on the other side.

The best way I can think of fixing it would be to somehow stop those squads from looting at all, although how you would do that I don't know
---END QUOTATION---



do the zombied loot or zombies, nope.

check this line out, you could add to it, who you add makes them not loot, i think.

local zombi=npc:character_community()=="zombied" or npc:character_community()=="trader" or npc:character_community()=="arena_enemy" or npc:name()=="mil_stalker0012" or npc:name()=="yantar_ecolog_general" or npc:name()=="mil_freedom_member0021"


you can check gameplay desc for that map, and add to the line, makes them not loot,

or

somewhere in here...

local dist_limit=1000
if bgwith(act_sec,"camper" then
dist_limit=5
end
local busy=bgwith(act_sec,"walker" or bgwith(act_sec,"combat" or bgwith(act_sec,"danger"
if res and self.st.block_search then
return true
end
timed(self.st,"tm1",5000+math.random()*10000, function () local min_dist=100000 local function check_item(o) local obj=o bject() if obj_owner[obj:id()] and (level.object_by_id(obj_owner[obj:id()])==nil or level.object_by_id(obj_owner[obj:id()]):alive()==false) then obj_owner[obj:id()]=nil end if (not self.st.disabled_objects[obj:id()]) and (obj arent()==nil or not IsStalker(obj arent())) and (obj_owner[obj:id()]==nil or obj_owner[obj:id()]==npc:id()) and npc:accessible(obj:level_vertex_id()) and (db.actor==nil or db.actor:alive()==false or db.actor osition():distance_to_sqr(obj osition())>6) then local valuable,corpse=isValuable(obj) if valuable then local value=3000 if not corpse then value=objValue(obj) end if value<=0 then value=0 end local max_dist=5+math.sqrt(value) if busy then max_dist=max_dist/5 end local dist=level.vertex_position(obj:level_vertex_id()):distance_to(npc osition()) local corrected_dist=dist if dist>5 then corrected_dist=5+(dist-5)/math.sqrt(value) end if dist<max_dist and corrected_dist<min_dist and dist<dist_limit then min_dist=corrected_dist claimGObject(npc,self.st,obj) res=true end end end end for o in npc:memory_visible_objects() do check_item(o) end for o in npc:memory_sound_objects() do check_item(o) end if res then end end ) return res end



as for the other prob, im still on it, wont be long.
  20:28:50  5 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
09/05/2009 20:29:09
Messages: 4387

---QUOTATION---
check this line out, you could add to it, who you add makes them not loot, i think.

local zombi=npc:character_community()=="zombied" or npc:character_community()=="trader" or npc:character_community()=="arena_enemy" or npc:name()=="mil_stalker0012" or npc:name()=="yantar_ecolog_general" or npc:name()=="mil_freedom_member0021"


you can check gameplay desc for that map, and add to the line, makes them not loot
---END QUOTATION---



Putting character id's / classes in there didn't work for me

However, putting the story_id for the bridge space restrictor seems to work perfectly

I'll do another couple of tests then post the code that worked...
  20:57:08  5 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
09/05/2009 23:00:54
Messages: 4387
Yep, seems to be working fine, all you need to change is the first line:


 if npc:story_id()~=501 or zombi then
	manager:add_evaluator(evid_see_stuff, property_evaluator_const(false))
	manager:add_evaluator(evid_see_body, property_evaluator_const(false))
	manager:add_evaluator(evid_near_stuff, property_evaluator_const(false))
	manager:add_evaluator(evid_position_corrected, property_evaluator_const(false))
 else



story_id 501 is the "red_bridge_comander_restr". I'll also look into sorting out the Yantar mission in the same way, as that has caused problems for me before (maybe the DV factory mission too).

EDIT: Actually, ignore what I just said, that code seems to break the script entirely, so no NPC's loot anything

Still working on it though...
  23:13:18  5 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Also, I've just discovered another problem with the script - if an NPC dies in an anomaly anyone nearby will walk blindly to their deaths trying to loot the corpse.

This may be even trickier to fix...
  01:33:03  6 September 2009
profilee-mailreply Message URLTo the Top
Ceano
Senior Resident
 

 
On forum: 03/02/2006
Messages: 4820
Yes that was a problem in SoC to, impossible to fix did they say back then.
  14:46:52  6 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/06/2009 15:04:13
Messages: 2433
@ RoboMook - apply those changes:

function add_to_binder(object, char_ini, scheme, section, st)
local npc = object
st.disabled_objects = {}
local manager = object:motivation_action_manager()
local zombi = npc:character_community() == "zombied" or npc:character_community() == "trader" or npc:character_community() == "arena_enemy" or npc:name() == "mil_stalker0012" or npc:name() == "yantar_ecolog_general" or npc:name() == "mil_freedom_member0021"
local scripted = false
if db.storage[ npc:id() ] ~= nil then
scripted = db.storage[ npc:id() ].squad_obj:hasScriptedTarget()
end

local prop_idlecombat = xr_evaluators_id.state_mgr + 3
local prop_contact = xr_evaluators_id.stohe_meet_base + 1
if npc:story_id()~=4294967296 or zombi or scripted then

Corrected

This should block the script for scripted squads. As far as I recall the CS squad near the RF bridge is scripted, check if this works.
  00:17:31  7 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
That code is giving me this CTD when I approach the bridge:

watcher_act.script:160: attempt to index field 'squad_obj' (a nil value)
 
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.: Clear Sky Forum » Mod discussion
 

All short dates are in Month-Day-Year format.


 

Copyright © 1995-2019 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.