ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
Is it possible to add "detection" function to customized hud like when using binoculars?

« Previous 10 events | 1 2 | All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  16:07:40  10 March 2014
profilee-mailreply Message URLTo the Top
stalker2033
(Novice)
 
On forum: 03/05/2014
Messages: 3

---QUOTATION---
The xr_game.dll needs to be modified to allow weapons with scopes to use the NPC identification and to fire the weapon. Without the modification the weapon will not fire.
See the post I made regarding the cut xray_project or google it to modify the patch correct xr_game.dll for your needs.
B
---END QUOTATION---



can it be done with armors/helmet? like the way "anti-rads auto injection" works?
  17:31:44  10 March 2014
profilee-mailreply Message URLTo the Top
bamah
Senior Resident
 

 
On forum: 02/10/2008
 

Message edited by:
bamah
03/10/2014 17:32:25
Messages: 911
The helmut utilizing a certain hud would need to be defined as a
class = WP_BINOC
It would need to attach to the belt or an inventory script would need to be used to tell the game you have the item and to use it. Attaching to the belt would be better as you could have an array of different huds/helmuts.

Never considered it...I'm sure someone on the forum has.
I just added the crysis armor with a custom hud. I think I'll look at the possibility when time permits. Other than that I cannot answer.

The way I would start though would be to expand on the gas mask mod or Dynamic Hud mod and create helmets utilizing protection, huds etc. The gas mask is considered an artifact for it properties of protection and loss of endurance due to wearing the mask in the mod.
It would be like the dynamic hud mod but geared toward the helmet to need a specific suit to display a hud then comes the fun of implementing the relationship detection. In OGSE if you have a gas mask and put on a suit that has a helmet the mask is removed.
Just stuff to look at.
B

OGSE has a good example of it. Thunderfreak's gasmask mod and a lot of others.
Just tossing that out.
  20:25:07  10 March 2014
profilee-mailreply Message URLTo the Top
TKGP
Senior Resident
 

 
On forum: 01/25/2013
Messages: 454
@Daemonion

---QUOTATION---
I was more curious about how to set up a callback from scratch.
---END QUOTATION---


You can't add new engine-triggered callbacks; there's a pre-defined list of them that you can find in lua_help.script by searching for "C++ class callback {". Each of those can be enabled or disabled for each object binding in the scripts. Of course, the next best thing is to just hook a little logic into whatever engine callback suits your purposes, and in the case of inventory open/close that would be the inventory_info callback for the actor binding in bind_stalker.script, because the game automatically toggles a pair of infoportions when you toggle the inventory. By default this is registered to fire function actor_binder:info_callback, so all you need to do is add something like this in there:

if info_id == "ui_inventory" then --infoportion for inventory open
  whateverScript.inventoryOpen()
elseif info_id == "ui_inventory_hide" then --infoportion for inventory close
  whateverScript.inventoryClose()
end


And there you go, your very own callbacks.
  07:53:24  11 March 2014
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
03/11/2014 8:25:17
Messages: 567

---QUOTATION---
You can't add new engine-triggered callbacks; there's a pre-defined list of them that you can find in lua_help.script by searching for "C++ class callback
---END QUOTATION---


Thanks so much for that info; very helpful. Do you know what these functions do? I found them in lua_help

function AddCallback(string, number, const function<void>&, object);
function set_callback(enum GameObject::ECallbackType, const function<void>&, object);



Now I'll have to study how to use all these different callbacks ...


---QUOTATION---

Does device().fov work in SoC? If it does I can help you use it to play sound. Unless you are no longer interested, you seem only interested in my mention of callbacks.

---END QUOTATION---


Of course I am! I started a thread about it a while back, please check it out here (https://www.gsc-game.com/index.php?t=community&s=forums&s_game_type=xr&thm_page=1&thm_id=21849&sec_id=16) I feel like I have hijacked this thread enough. Sorry, Stalker2033!
  10:37:31  11 March 2014
profilee-mailreply Message URLTo the Top
NatVac
Senior Resident
 

 
On forum: 06/15/2007
Messages: 4302
AddCallback registers a callback function for an event related to a UI item like a button, while set_callback is the standard way of assigning a function so that it is called when a game event (e.g., item taken or dropped) triggers. Search for these in scripts\.

I vaguely recall there being a way to register new callbacks but it might be solely for the C++ engine.

Also, the device.fov() function won't help the original request of how to put the detection feature on the in-game HUD (where there is no change in FOV). It might be possible to have a smart facemask that is derived from wpn_binoc but doesn't zoom. I don't know how to avoid having it bound to a slot though.
 
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.