ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Determining weapon weight

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  21:23:56  29 August 2012
profilee-mailreply Message URLTo the Top
ddraig
Senior Resident
 

 
On forum: 06/19/2012
Messages: 158
Determining weapon weight

Is this possible to do via script? I'm trying to replicate the behaviors burers have in Call of Pripyat, where they will "pull" the weapon out of your hand (the best I've been able to come up with is to drop it)

This is the code:


if self.object:clsid()==clsid.burer_s and self.object:section()~="controller_tubeman_old" and BurerTimer < time_global() then
            local actor = db.actor
            local oTarget = self.object:get_enemy()
            local v1 = self.object:direction()
            local v2 = actor:direction()
            if oTarget and (oTarget:id()==0) and (v1.x*v2.x)+(v1.z*v2.z)<-0.6 and self.object:see(actor) and self.object:position():distance_to(actor:position())<25 then
	            BurerNum = 1 actor.power = -1.0
			    local active_slot = actor:active_slot()
                if active_slot==1 or active_slot==2 then actor:drop_item(actor:active_item()) end
	            BurerTimer = time_global() + 6000*(1+math.random(-0.2,0.2))
            end
        elseif BurerNum and BurerTimer < time_global() + 6000 then BurerNum = nil end



The "if active_slot==1" section is what determines if the weapon is dropped (i.e. if it's your pistol or main weapon). Is there a way to check to see what the weight of the weapon is, and only "drop" it if it is heavier than a certain amount. Burers in Call of Pripyat do something similar, I believe.

Anyone have any ideas?
  22:06:47  29 August 2012
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
 

Message edited by:
nashathedog
08/29/2012 22:08:39
Messages: 8353
In COP it is only pistols they don't grab, I'm not saying it isn't based on weight but I would think it is more likely based on category. I'm about to go in game so I will edit a pistol weight and see if it does anything when I confront the two burers in Jupiter.
  03:58:51  1 September 2012
profilee-mailreply Message URLTo the Top
nashathedog
Senior Resident
 

 
On forum: 01/31/2011
Messages: 8353
I got a desert eagle and put the weight upto 4 kg and the burer was able to pull it out my hand so I switched to a sig220 and he could not pull it which means I was totally wrong. I know it does not help you but I thought I would say it anyway. sorry.

I was using both pistols in the pistol slot when testing this so I don't know if knowing that helps but now you know.
  07:43:57  1 September 2012
profilee-mailreply Message URLTo the Top
ERForman
Senior Resident
 

 
On forum: 04/12/2007
Messages: 224
what the hell

I think you guys are in the wrong forum!
  12:11:34  1 September 2012
profilee-mailreply Message URLTo the Top
Kaidonni
First the Zone, then the world!
(Resident)

 

 
On forum: 08/30/2008
Messages: 1072

---QUOTATION---
what the hell

I think you guys are in the wrong forum!
---END QUOTATION---



Nope, ddraig is modding SOC, so a post on scripting the behaviour belongs in the SOC modding forum.
 
Each word should be at least 3 characters long.
Search:    
Search conditions:    - spaces as AND    - spaces as OR   
 
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
 

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


 

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