LogicBricks

Plugins LogicBricks

Thanks for the quick reply.
Not sure I fully understand the timer stuff. But I have a rough idea what you mean.
To avoid conflict with a potential official version 15 I removed the suggestion link in my previous post.

With the CPU performance I was less concerned about the LogicBricks.
Just thought it would be good to cut a "trigger chain" at near / at the root.
For large / complex trigger chains I sometimes observed a performance hit that is noticeable in the performance monitors script time.
However I suspect whatever is triggered at the end of a chain takes the most time anyway.
Will use "AcceptTrigger".
 
Last edited:
Is it possible to modify morph values using the StateMachine script? I am not able to find any way to set morphs under the "Add Discrete Atom" menu after I select the Person atom there. I am trying to modify expressions. Thanks.
 
Is it possible to modify morph values using the StateMachine script? I am not able to find any way to set morphs under the "Add Discrete Atom" menu after I select the Person atom there. I am trying to modify expressions. Thanks.
Just like anywhere else in VaM, morphs need to be marked as "Favorite" for them to appear under Person / geometry as a trigger. There is a little "Fav" checkbox for each morph in the in the Morphs tab of the character. You can either control them via a Timer-type trigger from OnEnter or OnExit of a state, or, if the state does have a duration, via the OnValue trigger.

However, you might want to have a look at IdlePoser, which is also a StateMachine, but way more suited for animation, including morphs. Its also possible to have a StateMachine brick control IdlePoser.
 
Just like anywhere else in VaM, morphs need to be marked as "Favorite" for them to appear under Person / geometry as a trigger. There is a little "Fav" checkbox for each morph in the in the Morphs tab of the character. You can either control them via a Timer-type trigger from OnEnter or OnExit of a state, or, if the state does have a duration, via the OnValue trigger.

However, you might want to have a look at IdlePoser, which is also a StateMachine, but way more suited for animation, including morphs. Its also possible to have a StateMachine brick control IdlePoser.
Thanks very much. I wasn't aware of the favouriting aspect of it.
 
I think there's a problem with the deltaTime. If the scene is really laggy, you can see how time slows down. That's more or less how I noticed it:
1. Create a state machine that will go to the next stage after 5 seconds
2. Create a 5 seconds long, non-loop animation on Timeline
3. If the scene is laggy, the animation will finish in 5 seconds, but the state machine will still be stuck somewhere in between 1~4s
 
I think there's a problem with the deltaTime. If the scene is really laggy, you can see how time slows down. That's more or less how I noticed it:
1. Create a state machine that will go to the next stage after 5 seconds
2. Create a 5 seconds long, non-loop animation on Timeline
3. If the scene is laggy, the animation will finish in 5 seconds, but the state machine will still be stuck somewhere in between 1~4s
Yes, because LogicBricks uses game time, while Timeline uses real time by default. Not a bug.
If you like the StateMachine to stay synced with Timeline (or anything else) use the TriggerSync feature. Set the duration of your State to zero (or at least significanty shorter than the Timeline anim) and enable Wait for TriggerSync for that State. On the Timeline side add a trigger track and trigger "TriggerSync" on the StateMachine at the time the State is supposed to be finished.
 
Hi, extensive user of your plugin. Usually I use the SequenceMachine. Today the use for a StateMachine came up, and I don't know if my scene is the cause or what's going on with the plugin. I can add states, but I can't select between them. I'm assuming it's supposed to have a state selector like SeqM. has.
GIF 21-01-2024 01-58-26.gif
 
Hi, extensive user of your plugin. Usually I use the SequenceMachine. Today the use for a StateMachine came up, and I don't know if my scene is the cause or what's going on with the plugin. I can add states, but I can't select between them. I'm assuming it's supposed to have a state selector like SeqM. has.
Note sure whats happening, state selector should be always there. It's added during plugin initialization, there is nothing that could prevent that while still adding the rest of the UI. I would have to assume you either have some other plugin interfering by doing weird stuff with the UI, not cleaning up after itself...or that you made modifications to LogicBricks 14 and broke it?

Always worth a shot in such cases: I recommend to try restarting VaM.
 
I tried adding it to an Empty atom instead, and then it works. It must be the built-in CyberpunkTablet that was the issue. So I'll be avoiding putting plugins on that in the future.
 
It must be the built-in CyberpunkTablet that was the issue
Ah, yeah. Managed to reproduce the issue here in an empty scene with just that CyberpunkTablet. Must be somerthing weird going on with that atom's UI that prevents the filter popup to be used, no clue 🤷‍♂️ The normal (non searchable) popup works. Maybe because that atom has those extra tabs? Just guessing. Don't see anything LogicBricks is doing wrong there, I blame some VaM bug :unsure:

Workaround: As you already figured out...put your plugins on some other atom, e.g. add some Empty atom nearby.
 
Hi! Your logic brick plugin just amazing. I dont do anithing without them. triggering animation behavior etc... BUT ,,,..i have a question for you. is there a way to add triggerable on/off function for random timer? I use this timer with toggle button( enabled ) but canot drive with trigger. For explain: i use in my scene idle poser as a base. near to 100 pose already in. This poses changed with random choice as lying, sitting etc. the random choce contains a similar poses as groups and chage bethwen as well. I used many of them. The random choice driven with random timers. Evry choice has each own timer. That mean if i turning off the timer, the choce group will be inactiv and i can turn on another one but only with toggle button right now.
 
is there a way to add triggerable on/off function for random timer?
You can enable/disable the RandomTimer plugin via it's "enabled" trigger:
1707741776726.png

Note that disabling LogicBricks has the side-effect off breaking the proper function of Timer-type triggers, since the trigger source is responsible for taking care of those, which is isn't possible when having the plugin disable. I talking about the build-in VaM feature, not LogicBricks with "Timer" in their name. I mean those in the screenshot below. If you don't use those (at least not from the LogicBrick you want to turn off) you are fine.
1707742021007.png


This poses changed with random choice as lying, sitting etc. the random choce contains a similar poses as groups and chage bethwen as well. I used many of them. The random choice driven with random timers. Evry choice has each own timer.
I can't be sure from your description, but it sounds your setup would be a LOT simpler if you would use a StateMachine brick. Because it sounds like you are trying to build the concept of a "StateMachine" with lots of RandomTimer and RandomChoice. I strongly recommend you have a look at the StateMachine tutorial videos: https://hub.virtamate.com/resources/macgrubers-video-tutorials.7313/
 
@MacGruber I can't only express my admiration and infinite gratitude for this amazing work! One question, I am using the PlaySoundFromAB and files clip after only a few seconds of playing... any idea what may I be doing wrong? Thank you!
 
files clip after only a few seconds of playing
By "clip" you mean it stops playing after a few seconds, but the audio file is actually longer than that? I would guess something in the scene is playing other audio on the same audio source. If you want multiple sound files playing at once, you need one AudioSource for each.

Classic example: You try to play voice lines on a Person (which has a HeadAudioSource) while at the same time you use some breathing plugin (e.g. Life) that also tries to play breathing sounds on the same AudioSource. Doesn't work, you need to add another audio source, e.g. move it near the mouth and parent it to the head. (And yes, Life is missing the option to have it play on another audio source than the Person's own one...had some big plans on a voice integration into Life, so it would actually integrate all together instead of playing on top of each other...actually spent several weekends on that like a year ago, but never got around to finish it...no time, no way)
 
By "clip" you mean it stops playing after a few seconds, but the audio file is actually longer than that? I would guess something in the scene is playing other audio on the same audio source. If you want multiple sound files playing at once, you need one AudioSource for each.

Classic example: You try to play voice lines on a Person (which has a HeadAudioSource) while at the same time you use some breathing plugin (e.g. Life) that also tries to play breathing sounds on the same AudioSource. Doesn't work, you need to add another audio source, e.g. move it near the mouth and parent it to the head. (And yes, Life is missing the option to have it play on another audio source than the Person's own one...had some big plans on a voice integration into Life, so it would actually integrate all together instead of playing on top of each other...actually spent several weekends on that like a year ago, but never got around to finish it...no time, no way)
Spot on! that was exactly the issue. You are extremely kind. Thank you!!
 
@MacGruber just getting into VaM recently and am slowly learning the tools. Really grateful for your efforts on this.

Quick question - is there a way to pause a sound that's playing or scrub to a given point? I can't find anyone else who seems to have this use case or can't find logical targets/parameters to control such a feature. If these isn't, I don't suppose you'd consider adding it in the future? :)

My specific use case is perhaps a bit of laziness - I have an audio recording that I'm trying to sync up to an animation but it certainly would be nice to include some pauses as the recording, as fantasy, doesn't necessarily correlate to actual physical movement - nor would animating those transitions really be worth the effort.

Alternatively, some scenes/transitions might want to just to start mid-song or something like that on a trigger, or you could functionally create a in-scene music player with a scrubber feature.

Pardon my ignorance if this is easy but my google-fu is failing to find anyone else that's asked this.

Thanks again!
 
Timeline handles that natively : )
I think he's referring to the SoundfromAB plugin in Logicbricks, which currently does not have the functionality to pause the playing audio source. However, you can always use the game's global freeze sound/motion feature to achieve a pause... @Syke
 
Last edited:
I think he's referring to the SoundfromAB plugin in Logicbrick, which currently does not have the functionality to pause the playing audio source. However, you can always use the game's global freeze sound/motion feature to achieve a pause... @Syke
I was actually just going to load a single file into scene audio. AB would certainly be more flexible though.

As for global freeze, I suppose that could serve for fade-to-black transitions, but there may be moments where I want to extend a scene beyond the narrative audio, thus I would want to only selectively pause the narrative track. Thus, even a plugin which I came across which splits freezing motion and sound wouldn't suffice.
 
I was actually just going to load a single file into scene audio. AB would certainly be more flexible though.

As for global freeze, I suppose that could serve for fade-to-black transitions, but there may be moments where I want to extend a scene beyond the narrative audio, thus I would want to only selectively pause the narrative track. Thus, even a plugin which I came across which splits freezing motion and sound wouldn't suffice.
In this case, the best and simplest method is to control the playback of audio using a timeline, utilizing the built-in pause trigger of the timeline. However, as mentioned before, this method is not suitable for AB; you need to load the audio into the scene in a traditional way.
 
In this case, the best and simplest method is to control the playback of audio using a timeline, utilizing the built-in pause trigger of the timeline. However, as mentioned before, this method is not suitable for AB; you need to load the audio into the scene in a traditional way.
Tyvm. I feel like this is getting off topic re: logic bricks but...

I think I've got something somewhat working. I've loaded the scene audio and trigger to play on load. In timeline, I can target it and add pause/unpause triggers. I cannot figure out how to scrub with triggers (i.e. reference the Scene Animation's Animation Current Position variable) - can't seem to find a parent atom which has this.

Also, reading the 6.0.0 timeline patchnotes pretty much says the feature I want... but I cannot figure out how to sync the timeline version of audio. I see in the wiki/guide that you're supposed to be able to select 'live' triggers but I cannot for the life of me find these, nor references in any guide thus far.

Should I re-ask the question separately to keep this thread clean? Or ask in the timeline discussion... lol
 
Tyvm. I feel like this is getting off topic re: logic bricks but...

I think I've got something somewhat working. I've loaded the scene audio and trigger to play on load. In timeline, I can target it and add pause/unpause triggers. I cannot figure out how to scrub with triggers (i.e. reference the Scene Animation's Animation Current Position variable) - can't seem to find a parent atom which has this.

Also, reading the 6.0.0 timeline patchnotes pretty much says the feature I want... but I cannot figure out how to sync the timeline version of audio. I see in the wiki/guide that you're supposed to be able to select 'live' triggers but I cannot for the life of me find these, nor references in any guide thus far.

Should I re-ask the question separately to keep this thread clean? Or ask in the timeline discussion... lol
What you're looking to achieve can actually be done quite easily with the audio triggers in Timeline. However, yeah, it would be better to discuss this in the Timeline discussion.:ROFLMAO:
 
What you're looking to achieve can actually be done quite easily with the audio triggers in Timeline. However, yeah, it would be better to discuss this in the Timeline discussion.:ROFLMAO:
Omg... I figured it out. :LOL: It's using the specific audio track trigger rather than having a separate trigger. I just couldn't find any documentation which describes the difference. I suppose the 'live triggers' must be obsoleted by this track instead...

TYVM... and sorry to the thread for being so off topic but leaving this here if anyone else needs it.
 
@Syke Just for the record: The recommended/proper solution would be to cut your audio into pieces that you can play at the appropriate time. Jumping around in a single file is a really weird, inefficient and labour intense (setup-wise) solution. Once you cut the audio it is much more straight forward to trigger appropriately named audio files instead of having to remember which time index was what in your audio file. In the long run that will be less error-prone and therefore much more time efficient.

You can cut audio easily with free / open-source software....for example Audacity.
 

Similar threads

Back
Top Bottom