Help in DX scripting
Help in DX scripting
Sunday, August 31, 2008 by DaRkFuSsIoOn | Discussion: WinCustomize Talk
Reply #2 Sunday, August 31, 2008 9:42 PM
You can then create a loop in your script and check for frame number 56
For i = 0 To 145
Object.CurrentFrame = i
If i = 56 Then
'play your sound here
End If
Next
Reply #3 Sunday, August 31, 2008 9:55 PM
The easiest way I can think of is to break it into two animations.
Animation1 being frames 0 to 55
Animation2 being frames 56 to 145
Depending on your animation settings then you'd do something like this:
* Note I haven't tested this
- ' Animation Image, Frames, Speed, Command
- Object.SetPicture "Animation1.png",56,100,&H00000001
- Object.SetTimer 1, 5600 ' Speed needs to equal length of first animation
- Sub Object_OnTimer1
- Object.Sound= "mysound.wav"
- Object.SetPicture "Animation2.png",89,100,&H00000001
- Object.KillTimer 1
- End Sub
If you're doing a continual loop animation then set up a second timer and call it from within timer 1, then call timer1 from inside timer 2.
Make sure to kill both timer's on exit
Reply #4 Monday, September 1, 2008 10:04 PM
State1 = animation 0-55
State2 = animation 56-70 ----> this is the animation with the sound
State3 = animation 70-145
And then "Mouse up" = a little loop animation of 17 frames
Is this posible ??
thankx for your help guys, but it does not works =S I'm new on this kind of code
Reply #5 Tuesday, September 2, 2008 12:19 AM
Reply #6 Tuesday, September 2, 2008 1:47 AM
It suposes to show and hide a little window with some link buttons, they will open some flash games as a targets, they are located in a folder, they already done.....and the State "4" is a "mouse up" state is a loop animation whit 17 frames, and this is the last animation for the mouse is only moving his legs and head.
I was thinking in make the animations as calling states at the end of the animations, but I dont know how, I was thinking in the events CuerrentFrame, something like this :
"for the animation1":
If object.CurrentFrame = 55 Then
desktopx.object("mouse").State = "Estado1"
function OnState1()
End If
"for the animation2":
Function OnState1
If object.CurrentFrame = 70 Then
desktopx.object("mouse").State = "Estado2"
function OnState2()
End If
End Function
"and this for animation3":
Function OnState2
desktopx.object("mouse").State = "Estado3"
End Function
I dont know how can I make the codes in DesktopX =S hope you can give me a hand
Reply #7 Tuesday, September 2, 2008 2:47 AM
Sub Object_OnLButtonUp(x,y,dragged)
If Not dragged Then
desktopx.object("mouse").State = "Estado1"
For i = 1 to 55
desktopx.object("mouse").Left = desktopx.object("mouse").Left + 1 '< for movement
Object.CurrentFrame = i
Next
desktopx.object("mouse").State = "Estado2" ' < assign the sound here in properties
For i = 1 to 15 ' < 56 to 70 = 15 frames
Object.CurrentFrame = i
Next
desktopx.object("mouse").State = "Estado3"
For i = 1 to 75 ' < 71 to 145 = 75 frames
Object.CurrentFrame = i
Next
desktopx.object("mouse").State = "Estado4"
Enf If
End Sub
This is the basic idea. It will also need logic to test if the mouse is visible or not so you can reset the position of the mouse back to the starting point. If the mouse is going to be the button then just put this script in the mouse.
Reply #8 Tuesday, September 2, 2008 5:14 AM
Instead of a For...Next loop, you should use a timer to control the animation, so you can define the time between frames and allow the object to remain responsive whilst animating.
To play a sound at frame 56, you can have a second (hidden) object which contains your sound. Give this object 2 states - the first state contains no sound (otherwise it will play the sound when dx loads), the 2nd state contains your sound effect. When your animation hits frame 56 then call
desktopx.object("soundeffects").State = "playsound"
For details of timers, scripted animation and other desktopx scripting information check out the desktopX scripting reference: https://www.stardock.com/products/desktopx/help/dev_guide_3b_script_reference.htm
Reply #9 Saturday, September 13, 2008 4:29 PM
I've make it !!! thank you very much guys ![]()
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Sunday, August 31, 2008 9:31 PM
Create an object with 145 states. Assign the correct image to each state. Assign your sound for state number 56. Then a short script like:
On command_executed
For i = 1 to 145
MyObject.State = i
next.
Since you already have your animation strip made there's probably a quicker way to wrtie the animation script and trap the 56 frame but, I don't know what it is.