Comments (5)
callback.on_item_take
callback.on_item_drop
callback.take_item_from_box
Already work for stalker NPCs. Since corpse looting is a lua scripted action scheme it would be more appropriate to implement npc_take_item_from_corpse inside xr_corpse_detection.script; specifically inside the get_all_from_corpse function.
from xray-16.
Cool, I didn't know that.
I added the callback functions in xr_motivator.script and it works fine.
Is there a way to determine if the dropped item is physically being dropped (on the ground)? Seems that on_item_drop is called as soon as an object disappears from an NPC's inventory.
from xray-16.
Hi, I'm a little confused as I need the same function (npc_take_item_from_corpse). Are you saying to implement a new function that does that, or create lua code based on those other functions in order to call that scheme?
My scripter really needs such a function so if you wouldn't mind sharing I'd appreciate it.
from xray-16.
@denanden: Well, you can differentiate whether it is being traded to another npc or if it is being dropped to the ground. The parent_id will be 65535 if the object is being dropped on the ground.
@Swartz27: Corpse looting is a lua scripted action scheme. All you need to do is something like this in xr_corpse_detection.script: http://pastebin.com/yPw1hdHQ
Then your script function should look something like
function npc_get_all_from_corpse(npc,item,lootable)
end
It will be called for each and every item the npc takes from the corpse and you can manually check if it is actually lootable or not. You can probably enhance it to also pass the corpse object.
from xray-16.
@revolucas: My experiments have shown that all dropped weapons have parent() = the NPC that drops them.
My solution/workaround is to check if the dropped weapon is the same as parent NPC's active item. So far it has worked for me in every single case.
from xray-16.
Related Issues (20)
- Ability to download builds HOT 1
- Fatal error....error HOT 21
- BTR is only targeting actor HOT 1
- Missing MSVCP120.dll error HOT 6
- 'clsid' crash, _g.script HOT 6
- DirectX11 not working HOT 11
- 'Your video card doesn't meet game requirements' HOT 12
- DPI / HUD scaling independent of resolution? HOT 1
- Armor piercing HOT 1
- Compiling Latest Revision, lua.hpp missing HOT 4
- Utilizing 3rd person weapon animations HOT 1
- Is this fork dead? HOT 5
- Can't seem to compile HOT 8
- Game Over and Death Cam HOT 3
- Which repository choose? The original repository from OpenXRay or this fork? HOT 1
- Feature requests: OpenAL Soft & Stalkers dying in anomalies HOT 1
- Shotgun spread HOT 7
- A very strange idea
- xrCore.dll get this error in the console
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xray-16.