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?

1 2 | Next 10 events »| All Messages
Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  05:38:52  5 March 2014
profilee-mailreply Message URLTo the Top
stalker2033
(Novice)
 
On forum: 03/05/2014
Messages: 3
Is it possible to add "detection" function to customized hud like when using binoculars?

(hoping i'm posting this in the right place)

hi dear mod gurus, i'm wandering if it's possible to add "detection" function as when using binoculars in the dynamite huds comes with amk mod.

this is just a brief idea, i'm not asking for detailed howto since i'm still learing the game engine and how it works a simple "yes" or "no, you just can't" is all i needed.

thanks

ps: sorry for the rude question, there are way too many info regrading modding/scripts on the internet and i just haven't the time for google
  08:14:43  7 March 2014
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567
I tried this once. Hilarious, but terrible, results.

http://youtu.be/hd84oIDcjLc

I tested this because I have been trying to figure out a way to play an sound file when the player brings up the iron sights on their weapons. The binoculars do this already, so I tried setting the Makarov as class BINOC. Enjoy.


Short answer: No, I don't think so
  14:50:39  8 March 2014
profilee-mailreply Message URLTo the Top
stalker2033
(Novice)
 
On forum: 03/05/2014
Messages: 3

---QUOTATION---
I tried this once. Hilarious, but terrible, results.

http://youtu.be/hd84oIDcjLc

I tested this because I have been trying to figure out a way to play an sound file when the player brings up the iron sights on their weapons. The binoculars do this already, so I tried setting the Makarov as class BINOC. Enjoy.


Short answer: No, I don't think so
---END QUOTATION---



Thank you putting guns in BINOC class seems a interesting idea, i'll try do more testing on top of that
  18:40:48  8 March 2014
profilee-mailreply Message URLTo the Top
bamah
Senior Resident
 

 
On forum: 02/10/2008
Messages: 911
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
  20:29:06  8 March 2014
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
 

Message edited by:
Alundaio
03/08/2014 20:31:28
Messages: 2230

---QUOTATION---
I tried this once. Hilarious, but terrible, results.

http://youtu.be/hd84oIDcjLc

I tested this because I have been trying to figure out a way to play an sound file when the player brings up the iron sights on their weapons. The binoculars do this already, so I tried setting the Makarov as class BINOC. Enjoy.


Short answer: No, I don't think so
---END QUOTATION---



http://pastebin.com/yjKU3Nk1

You can tell when player zooms weapon with device().fov. This is cut from my axr_main.script. I created my own callbacks for actor_on_weapon_zoom_in and out. Works for binoculars and scoped weapons. FoV check may need adjusted if you use FoV crack.
  09:13:19  9 March 2014
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567

---QUOTATION---
http://pastebin.com/yjKU3Nk1

You can tell when player zooms weapon with device().fov. This is cut from my axr_main.script. I created my own callbacks for actor_on_weapon_zoom_in and out. Works for binoculars and scoped weapons. FoV check may need adjusted if you use FoV crack.
---END QUOTATION---


I realize this is off topic, but could you explain your script more for more? What are callbacks and how do they work?
  00:51:52  10 March 2014
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
 

Message edited by:
Alundaio
03/10/2014 1:21:15
Messages: 2230
If device().fov works in SoC, I'm not sure if this is something that was added later to engine. device().fov returns the current camera FOV value. By default it should be 55. If it's lower then 55 it means the actor is zooming in with a weapon.

Callback just means it executes when an event occurs, something only relevant to my own uses. What would be important to you is the actor_on_update function and how I use device().fov to check if either binoc is zoomed in or weapon with a scope is zoomed in.

To test if device().fov even works just put this in bind_stalker:update() method:


printf("current fov = "..device().fov)



assuming you have a printf function, use rulix's or zrps or whatever you have. I currently do not have SoC installed, otherwise I would check. If it does work I could probably help you further. If it doesn't work then sorry for getting your hopes up for nothing.
  04:10:32  10 March 2014
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567

---QUOTATION---
Callback just means it executes when an event occurs
---END QUOTATION---


I'm sure I can figure it out by looking at your own code, but how can I make my own callbacks?

Do I need to have my own script stashed somewhere (say, daemonion_scripts.ltx), and have a reference to it in update in bind_stalker? How do I create the part where if X happens, do Y?
  04:49:53  10 March 2014
profilee-mailreply Message URLTo the Top
Alundaio
Sad Clown
(Resident)

 

 
On forum: 04/05/2010
 

Message edited by:
Alundaio
03/10/2014 5:13:08
Messages: 2230
Well, yeah you would need to set it up yourself. Doesn't ZRP have xs_s.script or am I thinking of AMK? If so you could just use that or expand it. All it is, is an easy way to modulate scripts by having them register for events without leaving a bunch of code in a single place. For example instead of 10 different mods using bind_stalker: on_item_take() method, you could have a single external function call on_item_take for each of those 10 mods. It's still all limited by what is possible script-side of the engine. This is not something you need to do if you want to play sound when actor zooms in his scope.

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.
  05:34:08  10 March 2014
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
03/10/2014 5:35:28
Messages: 567
I'll check on that - but I was more curious about how to set up a callback from scratch.

For example (I'm picking something arbitrary here), setting up a callback to a script when the player opens their inventory menu. Or, when a certain info_portion becomes true.

I'm very intrigued by this idea because it seems like I can use callbacks to better implement a lot of my ideas. Thanks a lot for your time!
 
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.