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

1 2 3 4 5 ... 11
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  23:04:34  31 August 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
08/31/2009 23:04:58
Messages: 4387
NPC Looting Script fix

I'm sure a lot of you have seen the NPC looting script (if not you can get it here: http://www.sendspace.com/file/7pxmh5), it apparently came from the AMK mod for SHoC, although I'm not sure who ported it to CS.

There's a few problems with this mod though, and I'm wondering if any of you scripters out there know how to fix them

The first problem should be realatively simple, the problem is that NPC's will loot any and all items from a corpse, including quest items, which causes problems if an NPC gets to a mission-critical PDA before you. I'm guessing this could be fixed by adding a part to the script that checks against a list of quest items and either stops them from looting or makes them leave that item.

The other one is probably much harder to fix, and it's the fact that certain missions get broken because the NPC's are ignoring what they're supposed to be doing in favour of scavenging. I've had this happen once during the factory mission in Yantar, although after a re-load it worked ok. But the main issue is the Limansk bridge mission - you're Clear Sky buddies ignore the enemy and proceed to walk backwards and forwards across thin-air in an attempt to loot the dead bandits on the other side. When the bridge comes down they get stuck underneath, so you can't complete the mission.

This problem would I guess be much harder to fix, but is there anyone who feels like having a go? I'm sure a lot of people would appreciate it
  23:51:28  31 August 2009
profilee-mailreply Message URLTo the Top
Ceano
Senior Resident
 

 
On forum: 03/02/2006
 

Message edited by:
Ceano
08/31/2009 23:52:25
Messages: 4820
The last one could that be fixed with adding some script that checks if they are in a fight or not, they only loot if not in a fight situation or no enemy alive in a certain area.
  23:57:43  31 August 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
09/01/2009 0:01:13
Messages: 4387

---QUOTATION---
The last one could that be fixed with adding some script that checks if they are in a fight or not, they only loot if not in a fight situation or no enemy alive in a certain area.
---END QUOTATION---



It already does that, combat mode will always take precedence over looting. I think the problem is that when the Csky squad are attacking the bridge they aren't actually in combat mode, they're performing certain scripted actions, so there's nothing to stop the looting script from kicking-in.

EDIT: maybe one way of approching it would be to have certain specific squads (i.e. the CS squad at the bridge) ignore the looting script, although how you would achieve this I don't know. I guess you would have to add some sort of 'tag' to those squads, and add a part to the looting script that aborts the looting state if the tag is present.
  23:58:44  31 August 2009
profilee-mailreply Message URLTo the Top
Ceano
Senior Resident
 

 
On forum: 03/02/2006
Messages: 4820
aha...OK.
  03:03:43  1 September 2009
profilee-mailreply Message URLTo the Top
MacBradley
Senior Resident
 

 
On forum: 02/09/2009
Messages: 890

---QUOTATION---
NPC Looting Script fix
The first problem should be realatively simple, the problem is that NPC's will loot any and all items from a corpse, including quest items, which causes problems if an NPC gets to a mission-critical PDA before you. I'm guessing this could be fixed by adding a part to the script that checks against a list of quest items and either stops them from looting or makes them leave that item.

---END QUOTATION---



This first problem has a very easy fix, and it makes the game more fun IMO. You take the quest status off the quest items that are in the game and then put them as an item that will show up in a stalker's inventory when trading with them. Give it a nice high price tag, and it makes it so the player has to decide whether he is willing to pay the price, or try to off the stalker and pry the PDA from the looters cold dead fingers.
  03:55:47  1 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
NPC Looting Script fix
The first problem should be realatively simple, the problem is that NPC's will loot any and all items from a corpse, including quest items, which causes problems if an NPC gets to a mission-critical PDA before you. I'm guessing this could be fixed by adding a part to the script that checks against a list of quest items and either stops them from looting or makes them leave that item.


This first problem has a very easy fix, and it makes the game more fun IMO. You take the quest status off the quest items that are in the game and then put them as an item that will show up in a stalker's inventory when trading with them. Give it a nice high price tag, and it makes it so the player has to decide whether he is willing to pay the price, or try to off the stalker and pry the PDA from the looters cold dead fingers.
---END QUOTATION---



Yeah I did think about making the quest items tradeable, the only problem I can see with this is that if one of the bandits / Duty squad members loots the compass in the Red forest it's possible that they could die before you get to them and their corpse get 'cleaned-up', meaning you can't progress further. I guess it may be possible to make the engine keep corpses containing quest items, but that would probably be just as tricky to implement. Same thing could happen with any of the pda's if you didn't go and get it straight-away after recieving the mission, since any npc's passing by will go out of their way to loot bodies.
  04:44:52  1 September 2009
profilee-mailreply Message URLTo the Top
MacBradley
Senior Resident
 

 
On forum: 02/09/2009
Messages: 890

---QUOTATION---
NPC Looting Script fix
The first problem should be realatively simple, the problem is that NPC's will loot any and all items from a corpse, including quest items, which causes problems if an NPC gets to a mission-critical PDA before you. I'm guessing this could be fixed by adding a part to the script that checks against a list of quest items and either stops them from looting or makes them leave that item.


This first problem has a very easy fix, and it makes the game more fun IMO. You take the quest status off the quest items that are in the game and then put them as an item that will show up in a stalker's inventory when trading with them. Give it a nice high price tag, and it makes it so the player has to decide whether he is willing to pay the price, or try to off the stalker and pry the PDA from the looters cold dead fingers.

Yeah I did think about making the quest items tradeable, the only problem I can see with this is that if one of the bandits / Duty squad members loots the compass in the Red forest it's possible that they could die before you get to them and their corpse get 'cleaned-up', meaning you can't progress further. I guess it may be possible to make the engine keep corpses containing quest items, but that would probably be just as tricky to implement. Same thing could happen with any of the pda's if you didn't go and get it straight-away after recieving the mission, since any npc's passing by will go out of their way to loot bodies.
---END QUOTATION---



I've played all the way up until the part where you find the compass artifact and I was fine. I know it is not the perfect fix, but you're probably going to get to the body or stalker with the quest item long before they die and their body disappears.
  05:36:20  1 September 2009
profilee-mailreply Message URLTo the Top
smrtphoneusr
Senior Resident
 

 
On forum: 03/29/2009
 

Message edited by:
smrtphoneusr
09/01/2009 5:38:26
Messages: 3058
i recently put (bring me..)quest items in the inventory of some army guys but the result was a ctd as soon as those npcs got killed (and the body disappeared) so that's probably not the best idea.
Btw i noticed massive console spamming whenever they looted while i was testing the mod (game version v1.510), can't remember exactly what it said, parent not found or sth similar. Also the looting should be way more random. The whole squad went nuts as soon as an enemy hit the ground, it looked kinda funny.^^
  06:02:54  1 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
i recently put (bring me..)quest items in the inventory of some army guys but the result was a ctd as soon as those npcs got killed (and the body disappeared) so that's probably not the best idea.
Btw i noticed massive console spamming whenever they looted while i was testing the mod (game version v1.510), can't remember exactly what it said, parent not found or sth similar. Also the looting should be way more random. The whole squad went nuts as soon as an enemy hit the ground, it looked kinda funny.^^
---END QUOTATION---



Yeah, I think there should be a 'dice roll' as to wheather an NPC goes into looting mode, and maybe squad leaders should always ignore looting and go to their post, would be a bit more realistic.

It really needs a proper tuning-up to make it work properly with CS, apart from the few problems it's a very cool mod, and goes a long way to solving the problem of over-abundant supplies.

My other wish would be for someone to do a good port of the mod that makes NPC's clear bodies from camp-fires
  00:04:31  2 September 2009
profilee-mailreply Message URLTo the Top
zoust
(Senior)
 
On forum: 10/19/2008
Messages: 57

---QUOTATION---
This problem would I guess be much harder to fix, but is there anyone who feels like having a go? I'm sure a lot of people would appreciate it
---END QUOTATION---



+1
  04:04:18  2 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
here is most of the problem and solutions to all the above.

its in the watcher ltx file
its this line

local valuable_clsid={ [clsid.art_bast_artefact]=true, [clsid.art_black_drops]=true, [clsid.art_dummy]=true, [clsid.art_electric_ball]=true, [clsid.art_faded_ball]=true, [clsid.art_galantine]=true, [clsid.art_gravi]=true, [clsid.art_gravi_black]=true, [clsid.art_mercury_ball]=true, [clsid.art_needles]=true, [clsid.art_rusty_hair]=true, [clsid.art_thorn]=true, [clsid.art_zuda]=true, [clsid.artefact_s]=true, [clsid.device_detector_simple]=true, [clsid.device_pda]=true, [clsid.device_torch_s]=true, [clsid.equ_exo]=true, [clsid.equ_military]=true, [clsid.equ_scientific]=true, [clsid.equ_stalker_s]=true, [clsid.obj_antirad]=true, [clsid.obj_attachable]=true, [clsid.obj_bandage]=true, [clsid.obj_bolt]=true, [clsid.obj_bottle]=true, [clsid.obj_food]=true, [clsid.obj_medkit]=true, [clsid.wpn_ak74_s]=true, [clsid.wpn_ammo]=true, [clsid.wpn_ammo_m209]=true, [clsid.wpn_ammo_og7b]=true, [clsid.wpn_ammo_vog25]=true, [clsid.wpn_binocular_s]=true, [clsid.wpn_bm16_s]=true, [clsid.wpn_fn2000]=true, [clsid.wpn_fort]=true, [clsid.wpn_groza_s]=true, [clsid.wpn_hpsa_s]=true, [clsid.wpn_knife_s]=true, [clsid.wpn_lr300_s]=true, [clsid.wpn_pm_s]=true, [clsid.wpn_rg6_s]=true, [clsid.wpn_rpg7_s]=true, [clsid.wpn_scope_s]=true, [clsid.wpn_shotgun_s]=true, [clsid.wpn_silencer]=true, [clsid.wpn_svd_s]=true, [clsid.wpn_svu_s]=true, [clsid.wpn_usp45_s]=true, [clsid.wpn_val_s]=true, [clsid.wpn_vintorez_s]=true, [clsid.wpn_walther_s]=true, [clsid.wpn_wmagaz]=true, [clsid.wpn_wmaggl]=true }


notice the Soc stuff, you must redo them into CS, then add false or nil not sure, to quest stuff or pda's.
i only noticed this 2 days ago, but havnt got time my self to redo. i got to releas emergency patch for my mod, and im already 24hours late

but chek it out, hope it helps, il be cheking it out my self, later on.
  04:18:35  2 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Ah, well spotted Spartan

So I guess that's a list of all items that the script will consider, and presumably the true/false determines if they will take them or not.

If this works then the first problem should be solved completely

I'll have a bash at it tomorrow, ty for taking a look at it
  17:16:55  2 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Actually, looking more closely at that it seems they are 'classes' defined for use in one of the scripts, so it's not going to be a simple true/false switch, I'm still looking into it though...
  02:47:10  3 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
Actually, looking more closely at that it seems they are 'classes' defined for use in one of the scripts, so it's not going to be a simple true/false switch, I'm still looking into it though...
---END QUOTATION---



maybe true or nil ?

im actaully going to run some test my self, i just cant renember where the list of clsid was, i came across them before. but forgot.
example the list where it has a _s on end of certain items or weopons or monsters. like in the line above.

in fact ive sort of solved the other probs mentioned, but only from non watcher file stuff,m example distance ,vision other. works fine, you got to find balance, if i could solve this part, (line shown above) im pretty much 100 percent.

please keep us posted, and il post here what i find.

  04:04:22  3 September 2009
profilee-mailreply Message URLTo the Top
zoust
(Senior)
 
On forum: 10/19/2008
Messages: 57

---QUOTATION---
Actually, looking more closely at that it seems they are 'classes' defined for use in one of the scripts, so it's not going to be a simple true/false switch, I'm still looking into it though...
---END QUOTATION---



Yeah, I noticed this too. Classes of items are specified in the respectives .ltx files. I noticed there was a "shotgun" class for example, but the bm16 have his own class, so it's not very clear for me. I hope you guys can fix this mod, specialy during the factory mission and the bridge one.
  04:21:29  3 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Well I found all the classes in lua_help.script, but setting any to 'false' or 'nil' has no effect on looting

Still experimenting though...
  13:57:59  4 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
ok i think i found it, notice they dont pick up the "bolt"
and its in this line
local cnt=0 obj:iterate_inventory(function (dummy, item) if item:section()~="bolt" then cnt=cnt+1 end end, nil) corpse_checked[obj:id()]=cnt>0 return corpse_checked[obj:id()] end return false end

what if you add say "bolt", "add here", "add here"

the "addhere" is what ever you want, it shouldnt pick it up, like the bolt.
and yup, the bolt is still a item, onlt the slot ranks change the system of how you see the bolt.
so in the watcher file, it needs to by bass the bolt, or you will have a useless bolt"with wrong icon" in your invetory.

my guess is the script writer thought the bolt to be the problem, forgeting about quest items.

im on my way to test this my self, il add foods to see if it works, if it does, im adding whole bunch of stuff

hope it help.
  14:03:22  4 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
as for this problem to work, the line i showed you above

this one
local valuable_clsid={ [clsid.art_bast_artefact]=true, [clsid.art_black_drops]=true, [clsid.art_dummy]=true, [clsid.art_electric_ball]=true, [clsid.art_faded_ball]=true, [clsid.art_galantine]=true, [clsid.art_gravi]=true, [clsid.art_gravi_black]=true, [clsid.art_mercury_ball]=true, [clsid.art_needles]=true, [clsid.art_rusty_hair]=true, [clsid.art_thorn]=true, [clsid.art_zuda]=true, [clsid.artefact_s]=true, [clsid.device_detector_simple]=true, [clsid.device_pda]=true, [clsid.device_torch_s]=true, [clsid.equ_exo]=true, [clsid.equ_military]=true, [clsid.equ_scientific]=true, [clsid.equ_stalker_s]=true, [clsid.obj_antirad]=true, [clsid.obj_attachable]=true, [clsid.obj_bandage]=true, [clsid.obj_bolt]=true, [clsid.obj_bottle]=true, [clsid.obj_food]=true, [clsid.obj_medkit]=true, [clsid.wpn_ak74_s]=true, [clsid.wpn_ammo]=true, [clsid.wpn_ammo_m209]=true, [clsid.wpn_ammo_og7b]=true, [clsid.wpn_ammo_vog25]=true, [clsid.wpn_binocular_s]=true, [clsid.wpn_bm16_s]=true, [clsid.wpn_fn2000]=true, [clsid.wpn_fort]=true, [clsid.wpn_groza_s]=true, [clsid.wpn_hpsa_s]=true, [clsid.wpn_knife_s]=true, [clsid.wpn_lr300_s]=true, [clsid.wpn_pm_s]=true, [clsid.wpn_rg6_s]=true, [clsid.wpn_rpg7_s]=true, [clsid.wpn_scope_s]=true, [clsid.wpn_shotgun_s]=true, [clsid.wpn_silencer]=true, [clsid.wpn_svd_s]=true, [clsid.wpn_svu_s]=true, [clsid.wpn_usp45_s]=true, [clsid.wpn_val_s]=true, [clsid.wpn_vintorez_s]=true, [clsid.wpn_walther_s]=true, [clsid.wpn_wmagaz]=true, [clsid.wpn_wmaggl]=true }


notice bolt is in the list. lol now im confused, and its on true, tho he still created a line to not grab the bolt. so iether we add to the "bolt" line.

and i think you dont add false or nil, i think you just delete that part from comer to comer(of course)

il be right back with tests
  07:07:59  5 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
ok i figuered out how not to make them pick up certain objects, still in test , but seems fine.

try this

item:section()~="bolt" or item:section()~="XXXX" or item:section()~="XXXX"

where i showed you above, XXXX been a item object, npc wont pick it up.
also further down the watcher ltx file, its also there again, do the same there, and all shall be good.
  07:17:14  5 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
ok i figuered out how not to make them pick up certain objects, still in test , but seems fine.

try this

item:section()~="bolt" or item:section()~="XXXX" or item:section()~="XXXX"

where i showed you above, XXXX been a item object, npc wont pick it up.
also further down the watcher ltx file, its also there again, do the same there, and all shall be good.
---END QUOTATION---



Awesome, I'll give it a try now, good work

Have you managed to solve the problem with the script breaking the Limansk bridge mission?
  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)
  01:23:42  7 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/07/2009 1:29:12
Messages: 2433

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



It never works the first time I'm gonna give it another look.

[EDIT]

Ok, try this:

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 and db.storage[ npc:id() ].squad_obj ~= 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

tell me if it works.
  02:59:47  7 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Nope, 'fraid not

Looks like it's the same line causing problems though, the error I got this time was:

attempt to call method 'hasScriptedTarget' (a nil value)
  03:54:21  7 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
mm intresting, i think i know this one,(u guys are testing) il brb later with the positive tests, wont waste your time with negative ones.
so far ive sorted out few things, and also belive its actually more simple than what we think.
ok brb
  10:34:46  7 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
Nope, 'fraid not

Looks like it's the same line causing problems though, the error I got this time was:

attempt to call method 'hasScriptedTarget' (a nil value)
---END QUOTATION---



Ok, let's try a different method, try this one:

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 board = sim_board.get_sim_board()
local scripted = false
if board ~= nil and board.squads ~= nil then
for i,squad in pairs(board.squads) do
for a,checked_npc in pairs(squad.squad_npc) do
if checked_npc:name() == npc:name() then
if squad:hasScriptedTarget() then
scripted = true
end
end
end
end
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 or (board.squads == nil) then



Revert to the original version of the file and then add the changes. Let's hope it works this time.
  12:13:54  7 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
would this work, an if not, how would i disable certain items, im not really getting crashes, just not working, i havnt tryed this yet.. going now

class "act_grab_item" (action_base)
function act_grab_item:__init (action_name, st) super (nil, action_name) self.st = st end
function act_grab_item:initialize() action_base.initialize(self) local npc=self.object npc:set_item(object.idle,nil) npc:set_movement_type(move.walk) npc:set_mental_state(anim.danger) npc:set_body_state(move.crouch) npc:movement_enabled(true) local gi=getGObject(self.st) npc:set_sight(look.danger,nil,0) self.st.block_search=true if gi then if(IsStalker(gi) or IsMonster(gi)) then self.tt=time_global()+3000 else self.tt=time_global()+1000 utils.send_to_nearest_accessible_vertex(npc,gi:level_vertex_id()) end end self.force=vector():set(0,0,0) end
function act_grab_item:execute() action_base.execute(self) local npc=self.object local gi=getGObject(self.st) if not gi then return end if self.tt<time_global() then if gi and gi arent()==nil then gi:transfer_item(gi,npc) npc:enable_memory_object(gi,false) end clearGObject(self.st) end end
function act_grab_item:finalize() local npc=self.object self.st.block_search=nil npc:set_sight(look.danger,nil,0) trigger_timed(self.st,"tm1" self.st.dest_lvid=nil action_base.finalize(self) end
local nonos=item:section()~="bread" or item:section()~="bread2"
if nonos then
manager:add_action (actid_grab_item, (false))
end

nonos are the code word, for that trigger, the trigger is only thing that should trigger it.


as for your prob, i think you can just add the the Zombi triiger, on the list, exa

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"

just add the actaul spawned names or codes from that particalaur area, dont forget the descr and misc\script for names and codes.

you might even have to open all.spawn and get the actual number codes, not sure, i still stuck on disabling items

brb
  17:00:45  7 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433
I've cleared up the watcher_act.script a bit, I think it's going to be easier to read now.

Here's a link:

http://www.megaupload.com/?d=SRP12C9F

I havn't tested it though.

I also added two state restrictions, one for scripted squads and one for squads that are on the move, I don't know how will that turn out in practice. I know that one consequence is that squads will only start loonting if they find bodies on their final destination.
  20:09:53  7 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
I also added two state restrictions, one for scripted squads and one for squads that are on the move, I don't know how will that turn out in practice. I know that one consequence is that squads will only start loonting if they find bodies on their final destination.
---END QUOTATION---



That sounds beneficial to me, it should stop the whole squad from committing suicide when one of them walks into an anomaly whilst travelling between points

Also, having them loot along the way can cause problems with the faction wars, it's yet another thing to distract NPC's on their way to capture a point. So that's a good move in my book.

I'll give it a test shortly...
  21:00:52  7 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Ok that new one gives me this CTD:

watcher_act.script:516: attempt to index local 'checked_npc' (a number value)

The script looks nice and tidy now though, good work
  23:02:51  7 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
Ok that new one gives me this CTD:

watcher_act.script:516: attempt to index local 'checked_npc' (a number value)

The script looks nice and tidy now though, good work
---END QUOTATION---



Yeah, apart from the fact that it's not working

Try this one:

http://www.megaupload.com/?d=EFWZV682
  23:16:57  7 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Thats giving me:


---QUOTATION---
attempt to call method 'hasScriptedTarget' (a nil value)
---END QUOTATION---



still doesn't seem to like that one
  03:26:07  8 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
nice file clean, il give it a few shots at it, i think i know that error,

the item\obj disabling im sort of figuered it out about 90 percent, its the damn tests take long,
ok il be back.

PS; i really dont want to remove looting from my mod, im not giveing up, damn it.
  12:59:03  8 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
Thats giving me:

attempt to call method 'hasScriptedTarget' (a nil value)

still doesn't seem to like that one
---END QUOTATION---



strange, it works fine in my game.
  13:16:55  8 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
Thats giving me:

attempt to call method 'hasScriptedTarget' (a nil value)

still doesn't seem to like that one
---END QUOTATION---



i get same.
  23:00:13  8 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/09/2009 0:18:11
Messages: 2433
I am so SORRY! I was using a modified sim_squad_generic. It's natural that you don't have "hasScriptedTarget" defined.

There, this should prevent scripted squads from looting.

http://www.megaupload.com/?d=4KCUBL0D

RoboMook, what I changed is a global condition, meaning that it is set only once when the squad is spawned. Determining if squad is moving or not would be a dynamic condition because it changes frequently and I still don't know where those are set, so this will have to wait.

[EDIT]

I believe that conditions for "looting trigger" are defined in this function:

function ev_see_stuff:evaluate()

this part to be exact:

if (not npc:alive()) or xr_wounded.is_wounded(npc) or npc:best_enemy() or bad_danger(npc) or (actsch and db.storage[npc:id()][actsch].no_loot) then
if res then
freeGObject(self.st)
end
return false
end

default breaking conditions are:

not npc:alive() - looting npc is dead

xr_wounded.is_wounded(npc) - looting npc is squeaking on the ground

npc:best_enemy() - looting npc has a target

bad_danger(npc) - looting npc has enemies nearby

(actsch and db.storage[npc:id()][actsch].no_loot) - I believe that this means that looting npc cannot cary anything. This probably refers to "dont_spawn_character_supplies" command but I wouldn't bet money on it.

So, any more breaking conditions needed?

[EDIT2]

Checked, it works.

I added a condition that when squads are moving to another location then they won't stop to loot. Don't know if you want that one in or not.


There is one thing that bugs me though... Apparently the Hunting Rifle is higher in weapon hierarchy then any other Assault Rifle. Consequently npcs equip it whenever they pick up one. I really hate it when my Freedom guys in exos are running around with two shot peashooter. I tried to check it out but apparently this is handled by a hard-coded function "best_weapon()" so it would require to write a whole new script with a complete list of weapons and add each weapon some kind of value and weapons with bigger value would get selected first. After realising this I gave up on this idea.
  02:35:32  9 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
I added a condition that when squads are moving to another location then they won't stop to loot. Don't know if you want that one in or not.
---END QUOTATION---



I'd certainly at least want to try that out, as it may help out with some undesirable behaviour (eg wandering into anomalies or hanging around looting instead of capturing the target).



---QUOTATION---
There is one thing that bugs me though... Apparently the Hunting Rifle is higher in weapon hierarchy then any other Assault Rifle. Consequently npcs equip it whenever they pick up one. I really hate it when my Freedom guys in exos are running around with two shot peashooter. I tried to check it out but apparently this is handled by a hard-coded function "best_weapon()" so it would require to write a whole new script with a complete list of weapons and add each weapon some kind of value and weapons with bigger value would get selected first. After realising this I gave up on this idea.
---END QUOTATION---



I'm still rather confused about exactly how the game ranks weapons for NPC's - the three things that I suspect are involved are the class, ef_weapon_type & ef_mainweapon_type specified in the weapon configs, and possibly mp_ranks.ltx (it certainly references that file when NPC's are deciding weather to pick-up a weapon).

The reason they like shotguns so much may well be that they are a higher ef_weapon_type (shotguns are all 7, assault rifles are 6), the only thing higher is sniper rifles.

Here's the ef_weapon_type ranks as I understand them:

1 - knife
5 - pistols
6 - assault rifles (inc. PKM)
7 - shotguns
8 - sniper rifles (inc. vintorez)
9 - ??
10 - thrown grenades

The ef_mainweapon_type value only exists in the 'main weapon' configs, not the pistols. Don't know what it does, it seems to be set the same for similar weapons, so maybe it has some bearing on how NPC's use a weapon (fire mode, distances, etc), I'm going to do some tests on this and see if I can clarify it's purpose.

Not entirely sure if the class has any bearing on it or not, but there are some patterns, for example the Groza & FN2000 have a class of their own (wp_groza), they also both have built-in grenade launchers, so the weapon class may have some bearing on NPC behaviour or preference. Again I need to test this, and also how mp_ranks is involved (if indeed it is).

I'll get back with (hopefully) some answers
  02:50:04  9 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/09/2009 2:51:10
Messages: 2433
@ RoboMook - did the file I uploaded work for scripted squads?

Here is the script with "move" condition blocker:

http://www.megaupload.com/?d=M3Y5NKPZ
  02:51:44  9 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
@ RoboMook - did the file I uploaded work for scripted squads?

Here is the script with "move" condition blocker:

http://www.megaupload.com/?d=M3Y5NKPZ
---END QUOTATION---



Just about to try it out (been offline for a while).

Will get back to you in a moment...
  03:01:36  9 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
@ RoboMook - did the file I uploaded work for scripted squads?

Here is the script with "move" condition blocker:

http://www.megaupload.com/?d=M3Y5NKPZ
---END QUOTATION---



Well, I just fired-up the Limansk bridge mission and I didn't get any CTD's or console errors, but it didn't stop the CS squad from looting

I used the second one you posted btw.
  12:32:12  9 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/09/2009 15:42:19
Messages: 2433

---QUOTATION---
@ RoboMook - did the file I uploaded work for scripted squads?

Here is the script with "move" condition blocker:

http://www.megaupload.com/?d=M3Y5NKPZ

Well, I just fired-up the Limansk bridge mission and I didn't get any CTD's or console errors, but it didn't stop the CS squad from looting

I used the second one you posted btw.
---END QUOTATION---



Hmm, now I see that the CS squad near the bridge is actually not scripted. I cannot find any scripted CSky squads in squad_descr_redforest.ltx. How the hell did they do this?

Are the bridge CSky npcs actually a squad or just a bunch of individual npcs? Check the PDA map if they have a squad dot.

[EDIT]

I added a condition to prevent looting for individual npcs anyway as almost all of them are suppose to be part of the storyline and some arn't suppose to move at all.

http://www.megaupload.com/?d=TX405OO5

Check if this one works, and still tell me if the csky guys near the bridge are a squad or not. And if there is a squad dot tell me if there are more then 5 csky guys around.

[EDIT2]

@ RoboMook - You're right about the weapon_type thing.
The higher the number the more preferable the weapon is. I wouldn't change the value in there though as changing the weapon type value might influence the way in which a given weapon is used by npc. I'm going to have to go around it somehow. :/
  15:45:08  9 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
09/10/2009 9:33:50
Messages: 1971

---QUOTATION---
@ RoboMook - did the file I uploaded work for scripted squads?

Here is the script with "move" condition blocker:

http://www.megaupload.com/?d=M3Y5NKPZ

Well, I just fired-up the Limansk bridge mission and I didn't get any CTD's or console errors, but it didn't stop the CS squad from looting

I used the second one you posted btw.

Hmm, now I see that the CS squad near the bridge is actually not scripted. I cannot find any scripted CSky squads in squad_descr_redforest.ltx. How the hell did they do this?

Are the bridge CSky npcs actually a squad or just a bunch of individual npcs? Check the PDA map if they have a squad dot.

[EDIT]

I added a condition to prevent looting for individual npcs anyway as almost all of them are suppose to be part of the storyline and some arn't suppose to move at all.

http://www.megaupload.com/?d=TX405OO5

Check if this one works, and still tell me if the csky guys near the bridge are a squad or not. And if there is a squad dot tell me if there are more then 5 csky guys around.
---END QUOTATION---



look in misc\script not desc.

or its in all.spawn. il look in all.spawn see if i can find, i only from now, have time to check looting script, altho i did try this, and will finish the res of test tomoro(had comp probs all day, plus i got to release v0.3 of add'on)
mmm il see what happens, and il specificly find the squads for you.

st.disabled_objects = {
item:section() ~= "bread"=true,
item:section() ~= "bread2"=true,
item:section() ~= "kolbasa"=true,
item:section() ~= "kolbasa2"=true
}

ive paced this at bottom of script, it was left blank, so i belive here you add the items\obj you dont want them to pick up.
i think here or maybe in the other, il test this and report.

PS; i got 2 types of bread and sausage, so its just test to see if they dont pick those up, later il fill it in properly.

hope this works.
  22:25:37  9 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
I added a condition to prevent looting for individual npcs anyway as almost all of them are suppose to be part of the storyline and some arn't suppose to move at all.

http://www.megaupload.com/?d=TX405OO5

Check if this one works, and still tell me if the csky guys near the bridge are a squad or not. And if there is a squad dot tell me if there are more then 5 csky guys around.
---END QUOTATION---



That one seems to have a problem, it blocks all NPC's from looting, and also has a massive performance hit - I was getting about 10fps in the Swamps, but everything was fine with the script removed, so maybe there's a 'loop' in the script

Btw, the CS squad at the bridge aren't actually a squad - there's 7 of them including Lebedev, and no squad leader, so I have no idea how they are spawned
  22:39:45  9 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/09/2009 22:40:05
Messages: 2433

---QUOTATION---
I added a condition to prevent looting for individual npcs anyway as almost all of them are suppose to be part of the storyline and some arn't suppose to move at all.

http://www.megaupload.com/?d=TX405OO5

Check if this one works, and still tell me if the csky guys near the bridge are a squad or not. And if there is a squad dot tell me if there are more then 5 csky guys around.

That one seems to have a problem, it blocks all NPC's from looting, and also has a massive performance hit - I was getting about 10fps in the Swamps, but everything was fine with the script removed, so maybe there's a 'loop' in the script

Btw, the CS squad at the bridge aren't actually a squad - there's 7 of them including Lebedev, and no squad leader, so I have no idea how they are spawned
---END QUOTATION---



It works, check again, the consequence of "on_move" condition is that squads will loot only after reaching their final destination.
  00:27:30  10 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
09/10/2009 0:27:39
Messages: 4387

---QUOTATION---
It works, check again, the consequence of "on_move" condition is that squads will loot only after reaching their final destination.
---END QUOTATION---



Just tested again, you are quite right, they do indeed loot when they're at their target, good stuff

Still having the other problem though, getting unplayable framerates with the script installed. It was barely noticeable in red forest, but on any maps with lots of NPC's I get 10fps at best

Is there maybe a function that's constantly repeating?
  00:37:38  10 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
It works, check again, the consequence of "on_move" condition is that squads will loot only after reaching their final destination.

Just tested again, you are quite right, they do indeed loot when they're at their target, good stuff

Still having the other problem though, getting unplayable framerates with the script installed. It was barely noticeable in red forest, but on any maps with lots of NPC's I get 10fps at best

Is there maybe a function that's constantly repeating?
---END QUOTATION---



Repeating functions wouldn't be a problem, there are tousends actually in vanilla. But the function that monitors if there are any bodies around could strain the cpu a bit.
  00:57:04  10 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
09/10/2009 1:16:08
Messages: 4387

---QUOTATION---
Repeating functions wouldn't be a problem, there are tousends actually in vanilla. But the function that monitors if there are any bodies around could strain the cpu a bit.
---END QUOTATION---



Ah ok, as you may have guessed I'm cluless when it comes to scripting

Definately something weird happening here though, the original looting script had no noticeable performace impact for me, but this new one makes the game unplayable for me - it's like there's a constant stutter happening, and everything lags behind. Reducing the graphics settings had no effect either, so I'm assumin there's something specific in the script that is causing problems for me.

Anyone else tried it?

EDIT: just tried starting a new game, performance is fine until you leave the CS base for the second time - seems as soon as there's some bodies to be looted the stuttering starts. Is the ev_see_stuff:evaluate function still using the distance limit correctly?
  02:53:04  10 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/10/2009 2:54:43
Messages: 2433

---QUOTATION---
Repeating functions wouldn't be a problem, there are tousends actually in vanilla. But the function that monitors if there are any bodies around could strain the cpu a bit.

Ah ok, as you may have guessed I'm cluless when it comes to scripting

Definately something weird happening here though, the original looting script had no noticeable performace impact for me, but this new one makes the game unplayable for me - it's like there's a constant stutter happening, and everything lags behind. Reducing the graphics settings had no effect either, so I'm assumin there's something specific in the script that is causing problems for me.

Anyone else tried it?

EDIT: just tried starting a new game, performance is fine until you leave the CS base for the second time - seems as soon as there's some bodies to be looted the stuttering starts. Is the ev_see_stuff:evaluate function still using the distance limit correctly?
---END QUOTATION---



Revert to the original watcher_act.script and tell me if the problem is gone. Just to be sure if this is the case.
  03:00:23  10 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
Revert to the original watcher_act.script and tell me if the problem is gone. Just to be sure if this is the case.
---END QUOTATION---



Just tried it again, I don't get this problem with the original script, only the new one.

Weird...
  08:52:58  10 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
Revert to the original watcher_act.script and tell me if the problem is gone. Just to be sure if this is the case.

Just tried it again, I don't get this problem with the original script, only the new one.

Weird...
---END QUOTATION---



do you have a script release body manager, if so check to see the number, i think default is 15. mines on 30 i think(from Spartan mod)
and i do get bit of lag, but i got my card boosted up.

the ltx played out the same for me, but with the lag, il retest abit and brb.
  09:21:40  10 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
 

Message edited by:
RoboMook
09/10/2009 9:22:21
Messages: 4387

---QUOTATION---
do you have a script release body manager, if so check to see the number, i think default is 15. mines on 30 i think(from Spartan mod)
and i do get bit of lag, but i got my card boosted up.
---END QUOTATION---



Nope, I still have the default 15. It's weird, it isn't the normal kind of lag you get when your settings are too high and your computer is struggling, it's more like a regular 'stutter', much worse than if I were to set everything on max and watch the sun-shafts in the morning.

Btw, did you get anywhere with the other problem Spartan?
  09:21:49  10 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
09/10/2009 9:43:11
Messages: 1971

---QUOTATION---

The ef_mainweapon_type value only exists in the 'main weapon' configs, not the pistols. Don't know what it does, it seems to be set the same for similar weapons, so maybe it has some bearing on how NPC's use a weapon (fire mode, distances, etc), I'm going to do some tests on this and see if I can clarify it's purpose.

---END QUOTATION---



pistols are ranked the same, but i belive you could re rank them, adding numbers and lines.
the reson may be because the pistols are 1st slot, and that the 1st slot aint that important in genral weopon use for ai.
but ,they do use pistols, in my mod, many times,
it could be also that the ai might pick up by acording to power, but thats wrong, because in my mod, they use various, i must of tweaked things, that seamed small, but work huge in game, example leg and body shot anim where not defined, and leg o arm shots regestered in body anim shots, wich wouldnt show because of the undefined fixes.
small fix, huge in game, list goes on, and have observed weird ai actions, but not glitches, like the harmonica, i had to refix about 3 files, and 2 lines in that file where simple wrong, almost like sabotage. the rest was simple.

any way, il test this further also, cause im at the point of leaving this on next patch, yet again, lol.
or i wont get to the reported errors, lol.
anyway, il be back.
test few more.

ok im back.

ef_main_weapon_type always over rides ef_weapon_type

notice the ef main w type is got 3 numbers 1 to 3
and the other as you mentioned.
shoties and weak weopons are 1
assault 2
and sniper 3
this 1st over rides the other.

so if you want a pistol to be a main, just add ef_main_weapon_type
and a number
use 1 to 3 to be safe, or test higher number pattern(i will)
if no ef_main_weapon_type like pistols, means its a single slot weopon, thus now im going to fix all the changes.
if you have a mp5 in single slot(modded) ,then remove the ef_main_weapon_type
and the ai will even more recognize the weopon, (i had slot probs in my mod early, and this will help, going now to fix, i totally forgot, but it is a issue, this wont help looting, but all other addresed.

and mp_rank dont play a part i belive, thats for MP(multiplayer)
there was only 1 use for mp_rank ltx,,,,, to create new weopons, and to not have conflict.

again il go test brb.

PS; if ef_main_weapon_type are equal, then the ef_weapon_type
comes in play.
  09:25:00  10 September 2009
profilee-mailreply Message URLTo the Top
zoust
(Senior)
 
On forum: 10/19/2008
Messages: 57

---QUOTATION---
It works, check again, the consequence of "on_move" condition is that squads will loot only after reaching their final destination.

Just tested again, you are quite right, they do indeed loot when they're at their target, good stuff

Still having the other problem though, getting unplayable framerates with the script installed. It was barely noticeable in red forest, but on any maps with lots of NPC's I get 10fps at best

Is there maybe a function that's constantly repeating?
---END QUOTATION---



awesome, guys ! thank you for your hardwork and the time you spend on it
  10:31:29  10 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
Guys, wouldnt it be easier, if we made a , if"trigger" that says, if map_blah blah, then distance(the distance they see body)
to some rediculess number???

in fact, if i wanted AI to only check bodies , say at 15 meters or so.
what would the line changes be, that whay i might have a solution.

hopefully.
  11:41:35  10 September 2009
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1704
The script works just fine, if a little bit stuttery as RoboMook mentioned. I did get a red console-error in the Swamps though:
! ERROR: SV: can't find children [32669] of parent [302740720]

I'm not sure if this is serious or not, but would anyone have a clue as to what this could mean? BTW great work with the script smoq2!

[shameless plug]

Do you think you could take a look at the money looting script I posted today?

[/shameless plug]
  13:16:45  10 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
The script works just fine, if a little bit stuttery as RoboMook mentioned. I did get a red console-error in the Swamps though:
! ERROR: SV: can't find children [32669] of parent [302740720]

I'm not sure if this is serious or not, but would anyone have a clue as to what this could mean? BTW great work with the script smoq2!

[shameless plug]

Do you think you could take a look at the money looting script I posted today?

[/shameless plug]
---END QUOTATION---



I will, once I optimise this one.
  13:30:29  10 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
do you have a script release body manager, if so check to see the number, i think default is 15. mines on 30 i think(from Spartan mod)
and i do get bit of lag, but i got my card boosted up.

Nope, I still have the default 15. It's weird, it isn't the normal kind of lag you get when your settings are too high and your computer is struggling, it's more like a regular 'stutter', much worse than if I were to set everything on max and watch the sun-shafts in the morning.

Btw, did you get anywhere with the other problem Spartan?
---END QUOTATION---



no not really, im all over the place haha
got fils everywhere, i lost track of whats what, and i can only say that the changes ive done are not fully tested, theres no crashes.

im sort of doing 2 - 3 things at once(saves me time)
and the changes ive done to looting, iv havnt gone to there yet, lol
so its going to take time.
damn it
  14:02:02  10 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/10/2009 15:06:32
Messages: 2433
I don't know what could it be that strains the game so much... My changes were only slight. Changing the parameters for sight distance, etc won't remedy the problem.

[EDIT]

There, I optimised the script as much as I could. I also marked the changes I've made.

http://www.megaupload.com/?d=LY79RAC1

I'm having trouble testing it though as I don't see any impact on game performance and my PC is not top of the line.
  15:40:33  10 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
I don't know what could it be that strains the game so much... My changes were only slight. Changing the parameters for sight distance, etc won't remedy the problem.

[EDIT]

There, I optimised the script as much as I could. I also marked the changes I've made.

http://www.megaupload.com/?d=LY79RAC1

I'm having trouble testing it though as I don't see any impact on game performance and my PC is not top of the line.
---END QUOTATION---


il give it a full test in morning. im poooped
give you a full report.
  17:26:48  10 September 2009
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1704

---QUOTATION---
There, I optimised the script as much as I could. I also marked the changes I've made. http://www.megaupload.com/?d=LY79RAC1
---END QUOTATION---


Smoq2, I didn't get any noticeable lag with the version linked to above. Good work!

  17:28:02  10 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
There, I optimised the script as much as I could. I also marked the changes I've made. http://www.megaupload.com/?d=LY79RAC1
Smoq2, I didn't get any noticeable lag with the version linked to above. Good work!


---END QUOTATION---




YEY!

If you have any more ideas where and when npcs should stop looting write them in this thread, I'll be checking it frequently.
  02:27:33  11 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Hmmm, something very weird happening here...

I still get horrible stuttering with that new script, but the original one works fine.

I even tried on static lighting mode with all the details turned down, still stutters, and when you walk anywhere the grass details take about 3 seconds to fill-in fully.

It almost reminds me of the issues I had trying to get Deus Ex to run on a dual-core CPU.

Has anybody else noticed this stuttering effect with the new script?
  05:24:28  11 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
Hmmm, something very weird happening here...

I still get horrible stuttering with that new script, but the original one works fine.

I even tried on static lighting mode with all the details turned down, still stutters, and when you walk anywhere the grass details take about 3 seconds to fill-in fully.

It almost reminds me of the issues I had trying to get Deus Ex to run on a dual-core CPU.

Has anybody else noticed this stuttering effect with the new script?
---END QUOTATION---



im on it now, just woke up, got the coffee ready, and il be back
  07:18:15  11 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
ok, it works a treat WD

i even pumped up my vid setting to full blast to see, it even works better than the laggy one, apart from lag, it now does what it should.
ive tested it on its own, and with my mod(fully updated).
so im extreamly happy, solves hell'ov'a'lot for me.

well done all.

ok, next thing is simple.

would this work.

local disabled_objects = {}
or
st.disabled_objects = {}

wich one do i put in certain obj\items\weopns
and if so.
how would i write the line in between brackets. ive posted somewhere a example previous posts.

also 1 more thing, we disable certain AI from doing what not, but in this line..
local corpse_checked = {}

can we add certain charactors that hold quest items, and if so.
is that how, and how would we write the line.

for me, i think those last questions would finalize the looting script for me.

until further tests.

any help on this???
or questions??

  11:03:56  11 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
^^ This script still hates me and I don't know why

Tried it on a new game with no mods in static lighting mode, and it runs fine up until a few bodies hit the ground, then it's just unplayable lag & stuttering.

Definately not a perfomance issue as such, my comp is pretty low-end (2.2ghz dual-core amd, 9500gt, 2gig ram) but it runs perfectly smoothly on dx9 enhanced, and the original version of the script works fine, so there's definately a very specific problem I'm having - I just can't work out what it is
  11:44:29  11 September 2009
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1704

---QUOTATION---
local corpse_checked = {}
any help on this???
---END QUOTATION---


In function checkCorpse(obj), it looks like if there is an object id inside the corpse_checked table, then the function will cause NPCs to ignore that corpse by returning corpse already checked to the script:
		if corpse_checked[obj:id()] ~= nil then
			return corpse_checked[obj:id()]
		end

... Or at least that's how I'm interpreting the function. Thus, it should be possible to make certain corpses ignorable, by adding the quest corpse ids into the table:
local corpse_checked = 	{
				"mar_recover_item_1_corpse",
				"mar_recover_item_3_stalker",
				"mar_recover_item_4_corpse"
			}

However, I'm more interested in the local disabled_objects = {} table, because I think it might be possible to add quest objects in there, and thus to circumvent issues where the quest corpse is allocated randomly (for instance, in the Military Warehouses Fetch Item quest "mil_additional_quest_3").
  11:57:14  11 September 2009
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1704

---QUOTATION---
Definately not a perfomance issue as such, my comp is pretty low-end (2.2ghz dual-core amd, 9500gt, 2gig ram) but it runs perfectly smoothly on dx9 enhanced
---END QUOTATION---


x_Spartan_x & smoq2, could you both please post your PC specs so that we can do a little comparison? I'm not convinced that this is a hardware performance issue on your end, RoboMook, but it would still be worthwhile to see if there are noticeable difference in our configs which could be attributed for causing performance deviations. My specs: Q6600, HD4870, 4GB RAM.

BTW: Have you tried disabling a core, and then re-enabling it? I don't think this will solve the problem, but it could be worth a shot. Also, have you tried monitoring your RAM usage? I'm not sure how this script would affect it, but if your RAM is being filled up more quickly then you might be experiencing trashing, i.e. lag caused by swapping between virtual memory and physical memory. Then again, static lighting should dramatically reduce the amount of memory used, so I don't think this is it either.
  12:04:15  11 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
local corpse_checked = {}
any help on this???
In function checkCorpse(obj), it looks like if there is an object id inside the corpse_checked table, then the function will cause NPCs to ignore that corpse by returning corpse already checked to the script:
		if corpse_checked[obj:id()] ~= nil then
			return corpse_checked[obj:id()]
		end

... Or at least that's how I'm interpreting the function. Thus, it should be possible to make certain corpses ignorable, by adding the quest corpse ids into the table:
local corpse_checked = 	{
				"mar_recover_item_1_corpse",
				"mar_recover_item_3_stalker",
				"mar_recover_item_4_corpse"
			}

However, I'm more interested in the local disabled_objects = {} table, because I think it might be possible to add quest objects in there, and thus to circumvent issues where the quest corpse is allocated randomly (for instance, in the Military Warehouses Fetch Item quest "mil_additional_quest_3").
---END QUOTATION---



so i should not use
st.disabled_objects = {}

but add my changes in
local disabled_objects = {}

as for the corpse diable, il give it a shot.

my specs are
win xp 64
2gig ram
radeon hd4800 series
intel core 2 duo

but i doubt its a vid thing, case i pumped it up, np.
  12:10:02  11 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/11/2009 12:16:05
Messages: 2433

---QUOTATION---
ok, it works a treat WD

i even pumped up my vid setting to full blast to see, it even works better than the laggy one, apart from lag, it now does what it should.
ive tested it on its own, and with my mod(fully updated).
so im extreamly happy, solves hell'ov'a'lot for me.

well done all.

ok, next thing is simple.

would this work.

local disabled_objects = {}
or
st.disabled_objects = {}

wich one do i put in certain obj\items\weopns
and if so.
how would i write the line in between brackets. ive posted somewhere a example previous posts.

also 1 more thing, we disable certain AI from doing what not, but in this line..
local corpse_checked = {}

can we add certain charactors that hold quest items, and if so.
is that how, and how would we write the line.

for me, i think those last questions would finalize the looting script for me.

until further tests.

any help on this???
or questions??


---END QUOTATION---



Actually adding objects to disabled_objects won't help as it is a table with dynamic values. I think that "potential" object to pick up is assigned to object variable in all __init functions with lines self.st = st. I believe that the path could be broken here.


or...


maybe adding items to


function isValuable(obj)
	local sec = obj:section()
	if sec == "amk_metka" [or sec == "kolbasa" or sec == "bread"] then
		return false,false
	end
	if valuable_clsid[obj:clsid()] then
		return true, false
	end
	return bgwith(sec,"ammo_") or bgwith(sec,"wpn_") or bgwith(sec,"energy_") or checkCorpse(obj), IsStalker(obj) or IsMonster(obj)
end



I've added an example in [...]

But I'm afraid that only works on objects on the ground. I think that in case of corpses the corpse inventory is just stripped clean with one command.
  12:17:11  11 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
09/11/2009 12:22:15
Messages: 1971
ive tryed tthis at start, when i 1st looked at the script, it dint work...but.

il go re try it, because i think i wrote the line a bit difrent, il be back in 30min, also want to recheck the lag issue for RoboMook

brb


opps forgot, dindt notice the last line you wrote,

il see if it works on items on ground.

so then, if the corpse line work, then i dont really need the specific item check, but the ground looting is usefull.

PS;
would the body searching looting, specific be in this line, note, bolt is not ground item...

function checkCorpse(obj)
if (IsStalker(obj) or IsMonster(obj)) and obj:alive() == false then
if corpse_checked[obj:id()] ~= nil then
return corpse_checked[obj:id()]
end
local cnt = 0
obj:iterate_inventory(function (dummy, item) if item:section() ~= "bolt" then cnt = cnt + 1 end end, nil)
corpse_checked[obj:id()] = cnt > 0
return corpse_checked[obj:id()]
end
return false
end

???

brb
  13:06:41  11 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
ive tryed tthis at start, when i 1st looked at the script, it dint work...but.

il go re try it, because i think i wrote the line a bit difrent, il be back in 30min, also want to recheck the lag issue for RoboMook

brb


opps forgot, dindt notice the last line you wrote,

il see if it works on items on ground.

so then, if the corpse line work, then i dont really need the specific item check, but the ground looting is usefull.

PS;
would the body searching looting, specific be in this line, note, bolt is not ground item...

function checkCorpse(obj)
if (IsStalker(obj) or IsMonster(obj)) and obj:alive() == false then
if corpse_checked[obj:id()] ~= nil then
return corpse_checked[obj:id()]
end
local cnt = 0
obj:iterate_inventory(function (dummy, item) if item:section() ~= "bolt" then cnt = cnt + 1 end end, nil)
corpse_checked[obj:id()] = cnt > 0
return corpse_checked[obj:id()]
end
return false
end

???

brb
---END QUOTATION---



then try adding it there like this item:section() ~= "bolt" and item:section() ~= "bread" and ...
  13:39:32  11 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387

---QUOTATION---
BTW: Have you tried disabling a core, and then re-enabling it? I don't think this will solve the problem, but it could be worth a shot. Also, have you tried monitoring your RAM usage? I'm not sure how this script would affect it, but if your RAM is being filled up more quickly then you might be experiencing trashing, i.e. lag caused by swapping between virtual memory and physical memory. Then again, static lighting should dramatically reduce the amount of memory used, so I don't think this is it either.
---END QUOTATION---



I did try that actually, also tried running on only one core, didn't help. Ram is fine, was still getting the lag with about 700mb free.

I do suspect the CPU is the problem here, there may be some kind of sync issue between cores, I heard somewhere that Stalker uses one core for main gameplay stuff and the other for managing graphics stuff (hence it tends to use one core more than the other), so that's the only thing I can think of to blame at the moment. I did try removing the unecessary AMD dual-core optimizer I had installed, didn't help.

Still, seems weird that such a small part of a script could cause this behaviour, I'm rather perplexed
  13:49:45  11 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
09/11/2009 14:04:58
Messages: 1971

---QUOTATION---
ive tryed tthis at start, when i 1st looked at the script, it dint work...but.

il go re try it, because i think i wrote the line a bit difrent, il be back in 30min, also want to recheck the lag issue for RoboMook

brb


opps forgot, dindt notice the last line you wrote,

il see if it works on items on ground.

so then, if the corpse line work, then i dont really need the specific item check, but the ground looting is usefull.

PS;
would the body searching looting, specific be in this line, note, bolt is not ground item...

function checkCorpse(obj)
if (IsStalker(obj) or IsMonster(obj)) and obj:alive() == false then
if corpse_checked[obj:id()] ~= nil then
return corpse_checked[obj:id()]
end
local cnt = 0
obj:iterate_inventory(function (dummy, item) if item:section() ~= "bolt" then cnt = cnt + 1 end end, nil)
corpse_checked[obj:id()] = cnt > 0
return corpse_checked[obj:id()]
end
return false
end

???

brb

then try adding it there like this item:section() ~= "bolt" and item:section() ~= "bread" and ...
---END QUOTATION---


yup it worked with the other you mentioned, they dont pick that up from floor or out of the body, good example the artifact, we dont want the ai grabing a quest items out of dead bodies, i think there is a few..
so, that part is closed and ready for adding in blanks.

ok the thing you mentioned above, in this post reply, i think ive tryed that also, but, yet again, il re try.
if it doesnt work, it doesnt matter, im happy with check corpse fix.
in fact i might remove the other fix, with squads, if it needs better than dual core, but like it is, it is weird the lag, the only glitch i cop, is at start, some ai dont spawn properly, explain that, its got nothing to do with it,lol a reload fixes it, but.

brb, im drunk as a skunk, lmao.

PS

will this work?

if sec == "amk_metka" or sec == "quest_items" then

or would the quest_item line be other?
  14:07:40  11 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---


PS

will this work?

if sec == "amk_metka" or sec == "quest_items" then

or would the quest_item line be other?
---END QUOTATION---




sorry, but I don't think so.
  17:55:07  11 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---


PS

will this work?

if sec == "amk_metka" or sec == "quest_items" then

or would the quest_item line be other?


sorry, but I don't think so.
---END QUOTATION---



np, i thought so, i suppose i got to put in each one indervidaully.

so my last question is.
wich files or ltx can i find these type lines(there for corpses that are quests Ai that died of caurse.
like the other post help
exa

local corpse_checked = {
"mar_recover_item_1_corpse",
"mar_recover_item_3_stalker",
"mar_recover_item_4_corpse"
}

just wondering, make it easier for me.
and that would wrap it up on my part, then il post you guys the file, so you can add or whatever. np. but thats in morning, nite nite.
  05:34:28  12 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
these are my note, for new patch(my mod, not looting mod, you guys own that, and il credit you guys in notes, WD)
------------
O;Looting fixes include, important quest AI dont get searched. Various quest and
other now dont get looted(taken) wich are not found on dead AI, good example the
Compas artifact quest item, this will not be touched by looting. (Squads loot only
after reaching way points, AI dont loot on way paths.) plus various small fixes.
------------------


ok, the bit in brackets, will solve a few small probs but might cause probs for small end cpus(i still goto do final test on that also) plus it aint inportant now, that i can disable certain corpses and the AI wont touch quest items out of AI dead bodies, i belive this is enoufgh, and the whole thing will work fine.

now i can finish the rest of my ltx.

TY guys, and il credit your looting script.

  11:43:34  12 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
ok heres is my 1st line fixes, this will make AI not pick up from out of the corpse items\obj\things in sourounding.

in the below, they wont touch all the quest items, devises such as pdas and flash cards , and other minor quest items wich are not on corpses.
im going now to fill in the corpses lines,brb

heres the chages

function isValuable(obj)
local sec = obj:section()
if sec == "amk_metka" or sec == "mar_quest_wpn_pm_1" or sec == "mar_quest_wpn_ak74u_1" or sec == "mar_quest_novice_outfit_1" or sec == "esc_quest_akm47" or sec == "esc_quest_luky_detector" or sec == "gar_quest_wpn_wincheaster1300" or sec == "gar_quest_wpn_desert_eagle" or sec == "gar_quest_novice_outfit" or sec == "gar_quest_wpn_pm" or sec == "val_quest_scope_x8" or sec == "val_quest_guitar_serg" or sec == "agr_quest_wpn_spas12" or sec == "agr_quest_duty_abakan" or sec == "yan_quest_ammo_sleep" or sec == "red_quest_tank_minigun" or bgwith(sec,"esc_trader_" or bgwith(sec,"device_" or bgwith(sec,"dev_" or bgwith(sec,"af_" or bgwith(sec,"red_quest_" or bgwith(sec,"red_forest_" or bgwith(sec,"yan_quest_" or bgwith(sec,"agr_mechanic_" or bgwith(sec,"agr_map_" or bgwith(sec,"agr_pda_" or bgwith(sec,"agr_quest_" or bgwith(sec,"val_quest_" or bgwith(sec,"sect_gar_quest_" or bgwith(sec,"gar_quest_" or bgwith(sec,"esc_mechanic_" or bgwith(sec,"esc_quest_" or bgwith(sec,"mil_device_" or bgwith(sec,"mar_quest_" or bgwith(sec,"mil_quest_" then
return false,false
end
if valuable_clsid[obj:clsid()] then
return true, false
end
return bgwith(sec,"ammo_" or bgwith(sec,"wpn_" or bgwith(sec,"energy_" or checkCorpse(obj), IsStalker(obj) or IsMonster(obj)
end



feel free to add it, and test it, it works 100 percent, also notice some are indervidual(sec= other is in group(bg "xxx" both work and tested.

and off corse do your own thing..
  11:52:39  12 September 2009
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
 

Message edited by:
Decane
09/12/2009 11:55:34
Messages: 1704

function isValuable(obj)
	local sec = obj:section()
	if sec == "amk_metka"
	or sec == "mar_quest_wpn_pm_1"
	or sec == "mar_quest_wpn_ak74u_1" 
	or sec == "mar_quest_novice_outfit_1"
	or sec == "esc_quest_akm47"
	or sec == "esc_quest_luky_detector" 
	or sec == "gar_quest_wpn_wincheaster1300"
	or sec == "gar_quest_wpn_desert_eagle" 
	or sec == "gar_quest_novice_outfit"
	or sec == "gar_quest_wpn_pm"
	or sec == "val_quest_scope_x8" 
	or sec == "val_quest_guitar_serg"
	or sec == "agr_quest_wpn_spas12"
	or sec == "agr_quest_duty_abakan" 
	or sec == "yan_quest_ammo_sleep"
	or sec == "red_quest_tank_minigun"
	or bgwith(sec,"esc_trader_") 
	or bgwith(sec,"device_")
	or bgwith(sec,"dev_")
	or bgwith(sec,"af_")
	or bgwith(sec,"red_quest_") 
	or bgwith(sec,"red_forest_")
	or bgwith(sec,"yan_quest_")
	or bgwith(sec,"agr_mechanic_") 
	or bgwith(sec,"agr_map_")
	or bgwith(sec,"agr_pda_")
	or bgwith(sec,"agr_quest_") 
	or bgwith(sec,"val_quest_")
	or bgwith(sec,"sect_gar_quest_")
	or bgwith(sec,"gar_quest_") 
	or bgwith(sec,"esc_mechanic_")
	or bgwith(sec,"esc_quest_")
	or bgwith(sec,"mil_device_") 
	or bgwith(sec,"mar_quest_")
	or bgwith(sec,"mil_quest_") then
		return false,false
	end
	if valuable_clsid[obj:clsid()] then
		return true, false
	end
	return bgwith(sec,"ammo_") or bgwith(sec,"wpn_") or bgwith(sec,"energy_") or checkCorpse(obj), IsStalker(obj) or IsMonster(obj)
end

Looks a bit nicer!
  04:29:39  13 September 2009
profilee-mailreply Message URLTo the Top
zoust
(Senior)
 
On forum: 10/19/2008
Messages: 57
i think the scripts are causing troubles in patrol path of npcs : i begin a new game two times and got this every time a few minutes after taking the renegade hq. npcs must be looting somewhere, so they are not on the good path ??

! ERROR: SV: can't find children [14971] of parent [312516608]
! [LUA][ERROR] ERROR: NPC with name sim_default_csky_027394 can't present in PatrolManager[mar_smart_terrain_10_7_to_mar_smart_terrain_10_5_patrol_1_walk]

FATAL ERROR

[error]Expression : fatal error
[error]Function : CScriptEngine::lua_error
[error]File : E:\priquel\sources\engine\xrServerEntities\script_engine.cpp
[error]Line : 180
[error]Description : <no expression>
[error]Arguments : LUA error: ....t.a.l.k.e.r. - clear sky\gamedata\scripts\_g.script:975: bad argument #2 to 'format' (string expected, got nil)
  04:35:27  13 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Have you got any mods installed that might affect faction files? I think this can happen if there's too many squads at an ST (there's not enough jobs for them).
  10:37:11  13 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
 

Message edited by:
smoq2
09/13/2009 10:56:21
Messages: 2433

---QUOTATION---
Have you got any mods installed that might affect faction files? I think this can happen if there's too many squads at an ST (there's not enough jobs for them).
---END QUOTATION---



Now I know what was causing the PatrolManager crash in TFW...

Oh and about my specs, I've got a Samsung r560 lappy, just google it for specs.
  14:45:01  13 September 2009
profilee-mailreply Message URLTo the Top
zoust
(Senior)
 
On forum: 10/19/2008
Messages: 57

---QUOTATION---
Have you got any mods installed that might affect faction files? I think this can happen if there's too many squads at an ST (there's not enough jobs for them).
---END QUOTATION---



damn you're absolutely right , i set the squad max members from 20 to 25, but was far to imagine this can cause that kind of bug. ok i'll revert and see if that works. thank you
  20:07:20  13 September 2009
profilee-mailreply Message URLTo the Top
zoust
(Senior)
 
On forum: 10/19/2008
Messages: 57
so i removed all files affecting factions, start a new game (again!) and i still got the same patrol path bug.
this time it happens even earlier, but there was a lot of bodies to loot (for 3 times, i got the task "defend the fishing hamlet" so npcs don't leave the smart terrain immediately), so i don't know if it's related to this mod or not. did you experience something similar on your side ?
  14:01:55  15 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
ok ive fixed few more things and added more to list above.
ty for tideing it up, lol those smiles.

im actaully found these values

local corpse_checked = {
"mar_recover_item_1_corpse",
"mar_recover_item_3_stalker",
"mar_recover_item_4_corpse"
}

to the full, wich are found in all.spawn
so im going threw them all, and will post the finishe script, you guys can take it from there.

see yas tomoro.
  14:13:41  15 September 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
ok ive fixed few more things and added more to list above.
ty for tideing it up, lol those smiles.

im actaully found these values

local corpse_checked = {
"mar_recover_item_1_corpse",
"mar_recover_item_3_stalker",
"mar_recover_item_4_corpse"
}

to the full, wich are found in all.spawn
so im going threw them all, and will post the finishe script, you guys can take it from there.

see yas tomoro.
---END QUOTATION---



There is still the problem of corpses spawned via all.spawn. One is the Duty member corpse in one of the buildings near Stalker Camp in Agroprom. The corpse is surrounded by electro anomalies and entire squads just get shocked to death trying to get to it. Not to mention there are many more corpses around the Zone that are in dangerouns locations. Might be worth to look into.
  15:25:55  15 September 2009
profilee-mailreply Message URLTo the Top
RoboMook
Senior Resident
 

 
On forum: 11/12/2008
Messages: 4387
Good point, there's probably quite a few of those dotted around, I'll make a note of any I come across.

Btw, I don't suppose you've looked into enemy anomaly detection at all?

I remember several of the SHoC AI mods improved things to some degree, at least to the point that all the Stalkers in the Zone weren't completely suicidal
  15:48:23  15 September 2009
profilee-mailreply Message URLTo the Top
Ceano
Senior Resident
 

 
On forum: 03/02/2006
Messages: 4820
You should take a look at Stalkers are not blind v0.99 by Red75 for SoC
  17:05:13  15 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971
will do. il chek it out.

also, il be adding ALL the corpses. just to make sure.
  07:37:35  16 September 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
09/16/2009 7:55:51
Messages: 1971
here you go guys, this will stop AI from looting these bodies below, they wot run into anomolies or throw of the squad game.
just add this to script.

local corpse_checked = {
"mar_recover_item_1_corpse",
"mar_recover_item_3_stalker",
"mar_recover_item_4_corpse",
"mar_recover_item_1_corpse_0000",
"mar_recover_item_1_corpse_0001",
"mar_recover_item_1_corpse_0002",
"mar_recover_item_1_corpse_0003",
"mar_recover_item_1_corpse_0004",
"mar_recover_item_1_corpse_0005",
"mar_recover_item_1_corpse_0006",
"mar_recover_item_1_corpse_0007",
"yan_recover_item_1_corpse",
"yan_recover_item_2_corpse",
"gar_recover_item_4_corpse",
"gar_recover_item_1_corpse",
"gar_recover_item_2_corpse",
"gar_recover_item_5_corpse",
"gar_stalker_corpse",
"gar_stalker_corpse_0000",
"gar_stalker_corpse_0001",
"gar_stalker_corpse_0002",
"gar_stalker_corpse_0003",
"gar_stalker_corpse_0004",
"gar_stalker_corpse_0005",
"gar_stalker_corpse_0006",
"gar_stalker_corpse_0007",
"esc_recover_item_4_corpse",
"esc_recover_item_2_corpse",
"esc_recover_item_3_corpse",
"esc_stalker_corpse",
"esc_stalker_corpse_0000",
"esc_stalker_corpse_0001",
"esc_stalker_corpse_0002",
"esc_stalker_corpse_0003",
"esc_stalker_corpse_0004",
"esc_stalker_corpse_0005",
"val_recover_item_1_spawn",
"val_recover_item_2_spawn",
"val_stalker_corpse",
"val_stalker_corpse_0000",
"val_stalker_corpse_0001",
"val_stalker_corpse_0002",
"val_stalker_corpse_0003",
"val_stalker_corpse_0004",
"mar_recover_item_2_box",
"mar_recover_item_5_box",
"agr_recover_item_2_corpse",
"agr_recover_item_3_corpse",
"agr_recover_item_1_corpse",
"agr_recover_item_4_corpse",
"agr_stalker_corpse",
"agr_stalker_corpse_0001",
"agr_stalker_corpse_0002",
"agr_stalker_corpse_0000",
"agr_stalker_corpse_0004"
}


hope that helps
  00:46:12  5 November 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
11/05/2009 1:42:27
Messages: 1971
sorry about the "BUMP"


BUMP haha

some one asked about the looting fixes.

  22:19:42  5 November 2009
profilee-mailreply Message URLTo the Top
Crew 900
Senior Resident
 

 
On forum: 05/13/2007
Messages: 604
give me a mod that NPC can use medkits and bangages , and heal each other etc . like xStream mod for Shadow of chernobyl
  20:32:50  8 November 2009
profilee-mailreply Message URLTo the Top
Dopper
(Novice)
 
On forum: 09/22/2009
Messages: 20
can you post a link with the file with the fixes you have been making i find it dificult to copy-pasting all the changes you made throught the tread xD
  12:01:44  26 November 2009
profilee-mailreply Message URLTo the Top
Firmament
Senior Resident
 

 
On forum: 06/02/2009
 

Message edited by:
Firmament
11/26/2009 12:02:21
Messages: 268
Smog2, you did an awesome job. It's been a little while now since I'm using your script, and it's a great one. However I can't help pointing out that it removes the ability NPCs have to seek *weapons* on the ground (not just corpses).

In the AMK script, NPCs used to behave with corpses exactly as they used to behave with weapons, they were clearly looking for and picking them up everywhere. With your script, it is sad to see that NPCs just ignore even the excellent weapons on the ground and prefer to loot some semi-experienced stalker's corpse instead :/
They only pick up weapons if these ones happen to be standing *exactly* on their path, if no, they seem not to see them. I really wonder if this can't be fixed, because while I fully understand the purpose of that new looting script, I don't see in which way that "seek weapons" feature should harm it

I know it's a bit late, but who knows...
Anyway, despite this, I'm still using your nice fix; again, thank you a lot for it
  02:24:29  29 November 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
Messages: 1971

---QUOTATION---
Smog2, you did an awesome job. It's been a little while now since I'm using your script, and it's a great one. However I can't help pointing out that it removes the ability NPCs have to seek *weapons* on the ground (not just corpses).

In the AMK script, NPCs used to behave with corpses exactly as they used to behave with weapons, they were clearly looking for and picking them up everywhere. With your script, it is sad to see that NPCs just ignore even the excellent weapons on the ground and prefer to loot some semi-experienced stalker's corpse instead :/
They only pick up weapons if these ones happen to be standing *exactly* on their path, if no, they seem not to see them. I really wonder if this can't be fixed, because while I fully understand the purpose of that new looting script, I don't see in which way that "seek weapons" feature should harm it

I know it's a bit late, but who knows...
Anyway, despite this, I'm still using your nice fix; again, thank you a lot for it
---END QUOTATION---



i think your useing one of the test ones, try get the actaul fixed new one.
sorry, i dont have the link.
go threw the whole thread, its somewhere in here.
  11:51:38  30 November 2009
profilee-mailreply Message URLTo the Top
Firmament
Senior Resident
 

 
On forum: 06/02/2009
Messages: 268
I'm dead certain I'm using the right one, the one he posted when saying "I tried to optimize it as much as I could...". Do you mean your script allows NPCs to pick up weapons normally? If so, then that could mean there's something wrong in my gamedata folder (I'm currently modding a lot), but what? And why would the original amk watcher_act script work perfectly then...?
I don't get it
  12:45:04  30 November 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
I'm dead certain I'm using the right one, the one he posted when saying "I tried to optimize it as much as I could...". Do you mean your script allows NPCs to pick up weapons normally? If so, then that could mean there's something wrong in my gamedata folder (I'm currently modding a lot), but what? And why would the original amk watcher_act script work perfectly then...?
I don't get it
---END QUOTATION---



I didn't change anything in the script to disallow picking up items from the ground. The only thing I did change is to ignore corpses/objects close to anomalies and prevent going into loot mode when the squad is traveling to another point. Maybe your squad is ignoring items because they are moving through the zone?
  16:37:45  30 November 2009
profilee-mailreply Message URLTo the Top
Firmament
Senior Resident
 

 
On forum: 06/02/2009
Messages: 268

---QUOTATION---
I didn't change anything in the script to disallow picking up items from the ground. The only thing I did change is to ignore corpses/objects close to anomalies and prevent going into loot mode when the squad is traveling to another point. Maybe your squad is ignoring items because they are moving through the zone?
---END QUOTATION---



Unfortunately, some testing I did before proved it: NPCs really won't pick up items at all (unless they're standing in front of them), anomalies or not, travelling or not. The test I'm talking about was quite simple, I dropped some weapon in the clear sky base, where there was absolutely no nearby danger; with your script, no one cared, with AMK's, an NPC immediately started moving to the weapon to pick it up, even if the weapon was not exactly close to him...
  17:19:44  30 November 2009
profilee-mailreply Message URLTo the Top
smoq2
Forklift operator
(Resident)

 

 
On forum: 09/08/2008
Messages: 2433

---QUOTATION---
Unfortunately, some testing I did before proved it: NPCs really won't pick up items at all (unless they're standing in front of them), anomalies or not, travelling or not. The test I'm talking about was quite simple, I dropped some weapon in the clear sky base, where there was absolutely no nearby danger; with your script, no one cared, with AMK's, an NPC immediately started moving to the weapon to pick it up, even if the weapon was not exactly close to him...
---END QUOTATION---



Strange, I did the same thing and it worked a-ok. I don't know if anyone else havn't made any changes that might cause this though. I know I didn't.
  18:03:32  30 November 2009
profilee-mailreply Message URLTo the Top
Firmament
Senior Resident
 

 
On forum: 06/02/2009
Messages: 268
That's really weird, but if it works for you, then I assume it could work for me as well... Are using the mod called "looting clear sky" as the one from where your fix is meant to work? If not, could you please link me the actual looting mod you have downloaded and use as a basis?
  02:09:16  1 December 2009
profilee-mailreply Message URLTo the Top
x_Spartan_x
Whos got the Kokoretsi?
(Resident)

 

 
On forum: 07/07/2009
 

Message edited by:
x_Spartan_x
12/01/2009 2:17:52
Messages: 1971
lol
(at base camps, not out of camps)there not supposed to pick up, if they are currently on a ai script, meaning, if a npc is not doing anything(ai script)(or job) then he will pick up weopon, this is cause of the added feture when only at terrain spots they loot, this also is less likly in base camps, mainly cause every ones booked out, but, if you drop a weopon at base, if they dont pick it up, eventually someone will, when swapping jobs, also, in my Spartan 11:11 mod, i get np, in fact, i added special weopons and ect, tested and works.

PS; altho im removing the looting , because its a great mod for small compilations or less worked mods, in my mod i got to remove it, because of various extras that clash with looting mod ect(long story short) i have alot new factions ,respawing and new terrain clashes ect.
  22:19:22  3 April 2018
profilee-mailreply Message URLTo the Top
Pavel_Fonfara
(Novice)
 
On forum: 07/22/2017
Messages: 11
need npc looting mod

Can someone upload CS npc looting mod? I cant find it anywhere and if possible the fixed/optimized version from this topic.
 
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-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.