Page 1 of 1
Question about event triggering.
Posted: Sat Dec 17, 2011 9:17 am
by dendwaler
Hi all,
I want to trigger events just by entering a region.
Not using a button, but just the fact that the avatar enters a defined "volume in space" it triggers a oneshot event.
Can be a sound or an animation.
Is that possible?
Can anyone give me a script for this?
Thx in advance.
Re: Question about event triggering.
Posted: Sat Dec 17, 2011 10:09 am
by D'Lanor
There is a
QuickScript for a region that triggers an avatar animation (oneshot).
Edit: And here is the longer version...
Code: Select all
<region>:
logic:
modifiers:
- flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
- type: responder
ref: <responder name>
This triggers a responder to which you can assign anything you want.
Re: Question about event triggering.
Posted: Sat Dec 17, 2011 10:30 am
by dendwaler
I am aware of that, but unfortunately its not the avatar that has to be animated.
To be more exact , I want a sound that starts to play when the avatar enters a space volume.
But the sound will still be heard when the avatar leaves this space.
This cannot be done with soundregions, because they will stop abruptly when you leave the region.
Edit,
Sorry I did not see your edit, because i was writing the post above.
Okay then I edit this post as well.
I think your answer, answers my question, I will give this a try.
Thx, ronal 'D
Re: Question about event triggering.
Posted: Sun Dec 18, 2011 4:44 am
by dendwaler
Me again,
Sorry , but my understanding of Alcscript and Python is still minimal.
I tried the following but it did not work.
Code: Select all
Rgn_Snd:
logic:
modifiers:
- flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
- type: responder
ref: Snd_Emit
Snd_Emit:
type: soundemit
sound:
flags:
- is3dsound
- localonly
file: <soundfile>
volume: 1
minfdist: 50
maxfdist: 100
type: ambient
I thought the code - ref: <responder name> -
should be : ref: :<responder name>
Or this line should be:
name: <random>
Then i made the next:
Code: Select all
Rgn_Snd:
logic:
modifiers:
- flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
- type: responder
ref: Music
responder:
states:
- cmds:
- type: soundmsg
params:
receivers:
- 0011:Snd_Emit
flags:
- detecttrigger
Snd_Emit:
type: soundemit
sound:
flags:
- is3dsound
- localonly
file: Cathedral_S_A
volume: 1
minfdist: 50
maxfdist: 100
type: ambient
Still no result.
Can you give me more clues?
Re: Question about event triggering.
Posted: Sun Dec 18, 2011 5:30 am
by D'Lanor
You did not define a responder to play the sound. It is not possible to run a sound emitter directly.
Code: Select all
Rgn_Snd:
logic:
modifiers:
- flags:
- multitrigger
activators:
- type: objectinvolume
triggers:
- enter
conditions:
- type: volumesensor
satisfied: true
direction: enter
actions:
- type: responder
ref: Resp_Snd
actions:
- type: responder
name: Resp_Snd
responder:
states:
- cmds:
- type: soundmsg
params:
receivers:
- 0011:Snd_Emit
cmds:
- play
waiton: -1
nextstate: 0
waittocmd: 0
curstate: 0
flags:
- detecttrigger
Sorry, I thought you had seen enough AlcScript by now to figure out the rest.
Re: Question about event triggering.
Posted: Sun Dec 18, 2011 7:49 am
by dendwaler
Sorry, I thought you had seen enough AlcScript by now to figure out the rest.
I wished , this was true.
Its realy very hard for me to understand Alcscript and python is even worse.
The mistakes i can make , I do make.
It withholds me a bit from making better puzzles in my ages, because i never get the code working.
Thx for your help again D'lanor, this one works as it should.
I can realy use this on many places.
So it helped me a lot.