Quick Sign In:  

Forum: VirtualDJ Technical Support

Topic: ONINITs don't work anymore (Skin)

This topic is old and might contain outdated or incorrect information.

Hi!

I constantly worked on my custom skin during the last years and everything worked always fine.

Since a few of the last early access updates I discovered that all of the 'oninit'-commands in the beginning of the skin don't get executed anymore.
(Yes, I have several 'oninit'-commands sorted by categories: Performance, Decks, Mixer, Skin Colors, etc.).
Because there are several 'timers' and queries in the commands, they have to be splitted in order to be executed (or is there an easier/smarter way?)

However, the fact that there are more than one 'oninits' didn't seem to make any problems...
But to be sure I tried it with a single 'oninit'-command too, but it didn't work either.
So my next step was to ask here.

Has anybody any idea?
 

Posted Sun 23 Jun 19 @ 2:19 am
djdadPRO InfinityDevelopment ManagerMember since 2005
Try using <onload action="" /> instead. The behavior of the <oninit> has recently changed and if not mistaken should only work only the first time you load the skin.
 

Posted Sun 23 Jun 19 @ 2:51 am
Aaaaaah, ok...
Now it makes sense.

Thanks for the advice! I'll try it right now!
 

Posted Sun 23 Jun 19 @ 7:36 am
Yaaaaap, works!
Thanks once again!
 

Posted Sun 23 Jun 19 @ 7:51 am
djdad wrote :
Try using <onload action="" /> instead. The behavior of the <oninit> has recently changed and if not mistaken should only work only the first time you load the skin.


I'm having the same issue. When I first launch virtual DJ my ONINIT actions are not getting executed with the exception of a track that I have auto-load to Deck 4. That always executes but the rest of the commands do not. If I open settings and put the cursor at the end of the ONINIT command string and hit "Enter" on my keyboard all of the actions execute. Why are these commands not executing when I launch virtual DJ? Here is my ONINIT attached to my keyboard mapper

deck 1 effect_active 2 on & deck 2 effect_active 2 on & deck 3 effect_active 2 on & deck 4 effect_active 2 on & deck 4 effect_active 4 on & headphone_mix 100% & sampler_volume_master 50% & deck 4 load "/Music Crate/DJ FX/Scratch FX - Scratch Kit 2.mp3"



 

Posted Wed 22 Jan 20 @ 2:29 am
gabrieldiggs wrote :
djdad wrote :
Try using <onload action="" /> instead. The behavior of the <oninit> has recently changed and if not mistaken should only work only the first time you load the skin.


I'm having the same issue. When I first launch virtual DJ my ONINIT actions are not getting executed with the exception of a track that I have auto-load to Deck 4. That always executes but the rest of the commands do not. If I open settings and put the cursor at the end of the ONINIT command string and hit "Enter" on my keyboard all of the actions execute. Why are these commands not executing when I launch virtual DJ? Here is my ONINIT attached to my keyboard mapper

deck 1 effect_active 2 on & deck 2 effect_active 2 on & deck 3 effect_active 2 on & deck 4 effect_active 2 on & deck 4 effect_active 4 on & headphone_mix 100% & sampler_volume_master 50% & deck 4 load "/Music Crate/DJ FX/Scratch FX - Scratch Kit 2.mp3"


Please don't mind if I ask... But if you experience the same issue, (and already found this post here) why don't you use the same solution to solve your problem?
I had the exact same situation where only the first command of the first oninit was executed...
But since I got this advice here I changed all of the ONINITs to ONLOAD and never had a similar problem again.
So why aren't you simply doing the same?
 

Posted Wed 22 Jan 20 @ 3:55 am
Quote :
Please don't mind if I ask... But if you experience the same issue, (and already found this post here) why don't you use the same solution to solve your problem?
I had the exact same situation where only the first command of the first oninit was executed...
But since I got this advice here I changed all of the ONINITs to ONLOAD and never had a similar problem again.
So why aren't you simply doing the same?


So you're saying in the controller options I would rename this command to ONLOAD instead of ONINIT? I got confused with your suggestion because I only have one ONINIT command and under that command I list a bunch of actions. Please see my image and let me know if that's what you mean:-)


 

Posted Sun 26 Jan 20 @ 6:01 pm
AdionPRO InfinityCTOMember since 2006
ONINIT is executed during program start, while ONLOAD is executed on every song load, so they are not the same at all, and it will depend on your use if ONLOAD is also suited.
The reason some actions might not work during ONINIT for some actions is because they might be executed a bit too soon, before virtualdj has fully initialized, thus later overriding some of the actions.
You should be able to find ONLOAD in the Key dropdown btw.
 

Posted Sun 26 Jan 20 @ 6:24 pm
locoDogPRO InfinityModeratorMember since 2013
therefore you could add a delay to the ONINIT with a single shot repeat_start script

repeat_start "rsSomeName" 500ms & YOUR SCRIPT
 

Posted Sun 26 Jan 20 @ 7:10 pm
LudekPRO InfinityMember since 2005
just tested:
<oninit action = "repeat_start 'wait' 500ms 2 & skin_pannel 'scratchmixer' on & set '$fx1multi' 1 & set '$fx2multi' 1"/>
It works only after manualy switching skin in setting, not after VDJ start. Why?
 

Posted Tue 26 Jan 21 @ 6:18 am
LudekPRO InfinityMember since 2005
Any other tip how to ensure that my script runs every time when VDJ starts? The trick with repeat_start doesn't work..
 

Posted Thu 28 Jan 21 @ 5:55 pm
locodog wrote :
therefore you could add a delay to the ONINIT with a single shot repeat_start script

repeat_start "rsSomeName" 500ms & YOUR SCRIPT


Thank you Locodog that worked perfectly, previously had given up trying to the controllers ONINIT to work.
(the Keyboard ONINIT , with same action, would work, when the controller was NOT attached.

Now with that repeat_start added in front of original actions in the controllers ONINIT Mapping, it also works perfectly.

Again thank you.

PS
I did find that it needed to be set to run 1 time, else it seemed to continuously repeat.

ie:
repeat_start "rsSomeName" 500ms 1 & YOUR SCRIPT

----------------

Ludek wrote :
just tested:
<oninit action = "repeat_start 'wait' 500ms 2 & skin_pannel 'scratchmixer' on & set '$fx1multi' 1 & set '$fx2multi' 1"/>
It works only after manualy switching skin in setting, not after VDJ start. Why?


I tested
repeat_start 'wait' 500ms 2 & MY SCRIPT

and that worked also for me, (sharing my experience). Does that script, after the delay, work when testing with a custom button? If so maybe increasing the delay time may help.

------------------

And to be clear, I am modifying/using the ONINIT in the Mappers, NOT in a skin.
 

Posted Fri 29 Jan 21 @ 9:47 am


(Old topics and forums are automatically closed)