ProjectsWhat's NewDownloadsCommunitySupportCompany
Forum Index » S.T.A.L.K.E.R.: Shadow of Chernobyl Forum » Mod discussion
"Repair" a Destructible Physics Object?

Posted by/on
Question/AnswerMake Newest Up Sort by Descending
  09:49:59  17 February 2013
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567
"Repair" a Destructible Physics Object?

I created a destructible megaphone using this script:

[logic]
active = ph_sound@bandit_mega
on_hit = hit

[ph_sound@bandit_mega]
snd = bandit_mega
on_info = {+bandit_megaphone_off} nil | ph_idle@repair
on_signal = sound_end|ph_idle@wait

[ph_idle@wait]
on_timer = 1000| ph_sound@bandit_mega
on_info = {+bandit_megaphone_off} nil | ph_idle@repair

[ph_idle@repair]
on_timer = 1000 | %-bandit_megaphone_off% ph_sound@bandit_mega

[hit]
on_info = %+bandit_megaphone_off%

The idea is that, if the speaker is hit, it will be repaired after a certain amount of time and start playing again. However, just changing the info_portion to false doesn't work.

Is this possible?
  10:38:56  17 February 2013
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1705
Try this:

[logic]
active = ph_sound@bandit_mega
on_hit = hit

[ph_sound@bandit_mega]
snd = bandit_mega
on_info = {+bandit_megaphone_off} ph_idle@repair
on_signal = sound_end | ph_idle@wait

[ph_idle@wait]
on_timer = 1000 | ph_sound@bandit_mega
on_info = {+bandit_megaphone_off} ph_idle@repair

[ph_idle@repair]
on_timer = 1000 | ph_sound@bandit_mega %-bandit_megaphone_off%

[hit]
on_info = %+bandit_megaphone_off%
  11:24:36  17 February 2013
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567

---QUOTATION---
Try this:

[logic]
active = ph_sound@bandit_mega
on_hit = hit

[ph_sound@bandit_mega]
snd = bandit_mega
on_info = {+bandit_megaphone_off} ph_idle@repair
on_signal = sound_end | ph_idle@wait

[ph_idle@wait]
on_timer = 1000 | ph_sound@bandit_mega
on_info = {+bandit_megaphone_off} ph_idle@repair

[ph_idle@repair]
on_timer = 1000 | ph_sound@bandit_mega %-bandit_megaphone_off%

[hit]
on_info = %+bandit_megaphone_off%

---END QUOTATION---


It works, thanks! I guess my issue was nil?
  12:53:35  17 February 2013
profilee-mailreply Message URLTo the Top
Decane
Senior Resident
 

 
On forum: 04/04/2007
Messages: 1705
Yes, "nil" always terminates a script. In other words, a script ceases to be read whenever "nil" is called. FYI, the syntax of on_info is like this:

on_info = {conditions} a@b %effects%

The vertical bar, "|", is not a valid operator for on_info.
  12:54:51  17 February 2013
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
Messages: 567

---QUOTATION---
Yes, "nil" always terminates a script. In other words, a script ceases to be read whenever "nil" is called. FYI, the syntax of on_info is like this:

on_info = {conditions} a@b %effects%

The vertical bar, "|", is not a valid operator for on_info.
---END QUOTATION---


Oh, that is quite helpful. Thank you, once again.
  14:16:30  17 February 2013
profilee-mailreply Message URLTo the Top
insanelazarez
Yeah, Good Luck With That...
(Resident)

 

 
On forum: 01/31/2009
Messages: 1070

---QUOTATION---
Try this:

[logic]
active = ph_sound@bandit_mega
on_hit = hit

[ph_sound@bandit_mega]
snd = bandit_mega
on_info = {+bandit_megaphone_off} ph_idle@repair
on_signal = sound_end | ph_idle@wait

[ph_idle@wait]
on_timer = 1000 | ph_sound@bandit_mega
on_info = {+bandit_megaphone_off} ph_idle@repair

[ph_idle@repair]
on_timer = 1000 | ph_sound@bandit_mega %-bandit_megaphone_off%

[hit]
on_info = %+bandit_megaphone_off%

It works, thanks! I guess my issue was nil?
---END QUOTATION---



Yes... because 'nil' turns the file obsolete... other than that, it's seems ok.
  05:45:00  22 February 2013
profilee-mailreply Message URLTo the Top
Daemonion
All About Audio
(Resident)

 

 
On forum: 09/27/2011
 

Message edited by:
Daemonion
02/22/2013 5:45:40
Messages: 567
Just FYI - I changed the sound theme (named bandit_mega in sound_theme.script) for the megaphone to include multiple song files.

So, I changed the code to this, and it works perfectly:

--script by Daemonion for LURK 1.2
--Thanks to Decane for assistance

[logic]
active = ph_sound@bandit_mega
on_hit = hit

[ph_sound@bandit_mega]
snd = bandit_mega
random = true
looped = false
on_info = {+bandit_megaphone_off} ph_idle@repair

;simulate the bandit's "fixing" the speaker after 120min real time
[ph_idle@repair]
on_timer = 100000 | ph_sound@bandit_mega %-bandit_megaphone_off%

[hit]
on_info = %+bandit_megaphone_off%

 
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-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.