How to find out which #RANDOMEFFECT was used?

Discuss any general programming issues here
Post Reply
nexus
Posts: 148
Joined: Sun Mar 07, 2010 11:54 am

How to find out which #RANDOMEFFECT was used?

Post by nexus »

Hi,

I tried to search the doku and also this forum but could not find the answer to my question.

I am using HideLayerFX & ShowLayerFX with type=#RANDOMEFFECT and async=True. Then I am using AsyncDrawFrame() to show/hide some image/brush.

However, sometimes

Code: Select all

GetAttribute(#ASYNCDRAW, id, #ATTRNUMFRAMES) 
returns a 0. I am wondering how that can be and which RANDOMEFFECT causes that?

Any clue?
User avatar
airsoftsoftwair
Posts: 5471
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to find out which #RANDOMEFFECT was used?

Post by airsoftsoftwair »

nexus wrote: Fri May 17, 2024 6:13 pm returns a 0. I am wondering how that can be and which RANDOMEFFECT causes that?
Good question. Normally that shouldn't happen. Have you got an MCVE that demonstrates the issue?
nexus
Posts: 148
Joined: Sun Mar 07, 2010 11:54 am

Re: How to find out which #RANDOMEFFECT was used?

Post by nexus »

Good question. Normally that shouldn't happen. Have you got an MCVE that demonstrates the issue?
Not yet. Actually, I could not re-produce it with Hollywood 10. However, I discovered it the first time (and afterwards regularly) with Hollywood 8. I programmed a workaround by re-calling the Show/HIdeLayerFx until the number of frames is >0.

That's why I asked how to find out which effect was chosen :)

I meanwhile also do not call #RANDOMEFFECT anymore but copied all possible FX from docu and re-implemented the random functionality including the possibility to map the FX Constant to a human readable string. So, when switching back to HW8, I should be able to see which FX is causing the issue :)

But first, another week of real work instead of fun -- unfortunately ;)

Cheers,
Tom
User avatar
airsoftsoftwair
Posts: 5471
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to find out which #RANDOMEFFECT was used?

Post by airsoftsoftwair »

nexus wrote: Mon May 20, 2024 9:37 pm Not yet. Actually, I could not re-produce it with Hollywood 10. However, I discovered it the first time (and afterwards regularly) with Hollywood 8.
Could be a bug in Hollywood 8. There were quite a number of fixes in the transition effects library in preparation for the Designer 6 and 7 releases.
nexus
Posts: 148
Joined: Sun Mar 07, 2010 11:54 am

Re: How to find out which #RANDOMEFFECT was used?

Post by nexus »

Uh, I got this now once for HW10, too. Pretty hard to reproduce though. If I can find a MCVE, I will post it here :)

cheers,
Tom
nexus
Posts: 148
Joined: Sun Mar 07, 2010 11:54 am

Re: How to find out which #RANDOMEFFECT was used?

Post by nexus »

Here we go. All #SCROLLXXX-Effects return a 0:

Code: Select all

fx: 47 [#SCROLLLEFT] - Number frames to draw: 0
fx: 48 [#SCROLLRIGHT] - Number frames to draw: 0
fx: 49 [#SCROLLTOP] - Number frames to draw: 0
fx: 50 [#SCROLLBOTTOM] - Number frames to draw: 0
fx: 51 [#SCROLLNOTHEAST] - Number frames to draw: 0
fx: 52 [#SCROLLSOUTHEAST] - Number frames to draw: 0
fx: 53 [#SCROLLSOUTHWEST] - Number frames to draw: 0
fx: 54 [SCROLLNORTHWEST] - Number frames to draw: 0

Code: Select all

@VERSION 8,0
@DISPLAY { Title = "Test", Width=800, Height=600, Mode="Windowed" }
EnableLayers()
EscapeQuit(True)

fxMap = {
   [#HSTRIPES2] = "#HSTRIPES2",
   [#HSTRIPES4] = "#HSTRIPES4",
   [#HSTRIPES16] = "#HSTRIPES16",
   [#HSTRIPES32] = "#HSTRIPES32",
   [#VSTRIPES2] = "#VSTRIPES2",
   [#VSTRIPES8] = "#VSTRIPES8",
   [#VSTRIPES16] = "#VSTRIPES16",
   [#VSTRIPES32] = "#VSTRIPES32",
   [#HBLINDS8] = "#HBLINDS8",
   [#HBLINDS16] = "#HBLINDS16",
   [#HBLINDS32] = "#HBLINDS32",
   [#HBLINDS64] = "#HBLINDS64",
   [#HBLINDS128] = "#HBLINDS128",
   [#VBLINDS8] = "#VBLINDS8",
   [#VBLINDS16] = "#VBLINDS16",
   [#VBLINDS32] = "#VBLINDS32",
   [#VBLINDS64] = "#VBLINDS64",
   [#VBLINDS128] = "#VBLINDS128",
   [#HOPENCURTAIN] = "#HOPENCURTAIN",
   [#HCLOSECURTAIN] = "#HCLOSECURTAIN",
   [#VOPENCURTAIN] = "#VOPENCURTAIN",
   [#VCLOSECURTAIN] = "#VCLOSECURTAIN",
   [#HLINES] = "#HLINES",
   [#HLINES2] = "#HLINES2",
   [#VLINES] = "#VLINES",
   [#VLINES2] = "#VLINES2",
   [#REVEALLEFT] = "#REVEALLEFT",
   [#REVEALRIGHT] = "#REVEALRIGHT",
   [#REVEALTOP] = "#REVEALTOP",
   [#REVEALBOTTOM] = "#REVEALBOTTOM",
   [#BARS] = "#BARS",
   [#QUARTERS] = "#QUARTERS",
   [#CROSSFADE] = "#CROSSFADE",
   [#RECTCENTER] = "#RECTCENTER",
   [#RECTNORTH] = "#RECTNORTH",
   [#RECTNORTHEAST] = "#RECTNORTHEAST",
   [#RECTEAST] = "#RECTEAST",
   [#RECTSOUTHEAST] = "#RECTSOUTHEAST",
   [#RECTSOUTH] = "#RECTSOUTH",
   [#RECTSOUTHWEST] = "#RECTSOUTHWEST",
   [#RECTWEST] = "#RECTWEST",
   [#RECTNORTHWEST] = "#RECTNORTHWEST",
   [#RECTBACKCENTER] = "#RECTBACKCENTER",
   [#RECTBACKNORTH] = "#RECTBACKNORTH",
   [#RECTBACKNORTHEAST] = "#RECTBACKNORTHEAST",
   [#RECTBACKEAST] = "#RECTBACKEAST",
   [#RECTBACKSOUTHEAST] = "#RECTBACKSOUTHEAST",
   [#RECTBACKSOUTH] = "#RECTBACKSOUTH",
   [#RECTBACKSOUTHWEST] = "#RECTBACKSOUTHWEST",
   [#RECTBACKWEST] = "#RECTBACKWEST",
   [#RECTBACKNORTHWEST] = "#RECTBACKNORTHWEST",
   [#STRETCHLEFT] = "#STRETCHLEFT",
   [#STRETCHRIGHT] = "#STRETCHRIGHT",
   [#STRETCHTOP] = "#STRETCHTOP",
   [#STRETCHBOTTOM] = "#STRETCHBOTTOM",
   [#HSTRETCHCENTER] = "#HSTRETCHCENTER",
   [#VSTRETCHCENTER] = "#VSTRETCHCENTER",
   [#ZOOMCENTER] = "#ZOOMCENTER",
   [#ZOOMNORTH] = "#ZOOMNORTH",
   [#ZOOMNORTHEAST] = "#ZOOMNORTHEAST",
   [#ZOOMEAST] = "#ZOOMEAST",
   [#ZOOMSOUTHEAST] = "#ZOOMSOUTHEAST",
   [#ZOOMSOUTH] = "#ZOOMSOUTH",
   [#ZOOMSOUTHWEST] = "#ZOOMSOUTHWEST",
   [#ZOOMWEST] = "#ZOOMWEST",
   [#ZOOMNORTHWEST] = "#ZOOMNORTHWEST",
   [#HFLOWTOP] = "#HFLOWTOP",
   [#HFLOWBOTTOM] = "#HFLOWBOTTOM",
   [#VFLOWLEFT] = "#VFLOWLEFT",
   [#VFLOWRIGHT] = "#VFLOWRIGHT",
   [#PUZZLE] = "#PUZZLE",
   [#DIAGONAL] = "#DIAGONAL",
   [#ROLLTOP] = "#ROLLTOP",
   [#WALLPAPERTOP] = "#WALLPAPERTOP",
   [#CLOCKWIPE] = "#CLOCKWIPE",
   [#STAR] = "#STAR",
   [#SPIRAL] = "#SPIRAL",
   [#SWISS] = "#SWISS",
   [#QUADRECT] = "#QUADRECT",
   [#HSPLIT] = "#HSPLIT",
   [#VSPLIT] = "#VSPLIT",
   [#UPNDOWN] = "#UPNDOWN",
   [#SUN] = "#SUN",
   [#DISSOLVE] = "#DISSOLVE",
   [#PIXELZOOM1] = "#PIXELZOOM1",
   [#ROLLLEFT] = "#ROLLLEFT",
   [#WATER1] = "#WATER1",
   [#WATER2] = "#WATER2",
   [#WATER3] = "#WATER3",
   [#WATER4] = "#WATER4",
   [#STRUDEL] = "#STRUDEL",
   [#WALLPAPERLEFT] = "#WALLPAPERLEFT",
   ; with arguments:
   [#FADE] = "#FADE", 
   [#BLEND] = "#BLEND", 
   [#SCROLLLEFT] = "#SCROLLLEFT", 
   [#SCROLLRIGHT] = "#SCROLLRIGHT", 
   [#SCROLLTOP] = "#SCROLLTOP", 
   [#SCROLLBOTTOM] = "#SCROLLBOTTOM",
   [#VSTRIPES] = "#VSTRIPES", 
   [#HSTRIPES] = "#HSTRIPES",
   [#SCROLLNORTHEAST] = "#SCROLLNOTHEAST",
   [#SCROLLSOUTHEAST] = "#SCROLLSOUTHEAST",
   [#SCROLLSOUTHWEST] = "#SCROLLSOUTHWEST",
   [#SCROLLNORTHWEST] = "SCROLLNORTHWEST",
}

Function p_Show(sLayer)
  For fx,fxstr In Pairs(fxMap)
    Local show = ShowLayerFX(sLayer, { Async = True, type = fx })
    Local num = GetAttribute(#ASYNCDRAW, show, #ATTRNUMFRAMES) 
    If num = 0
      DebugPrint("fx: "..fx.." ["..fxstr.."] - ".."Number frames to draw: "..num) 
    EndIf
    For Local k = 1 To num
      AsyncDrawFrame(show,k)
    Next
    FinishAsyncDraw(show)
  Next
EndFunction

; Photo taken from HW10 Examples
Local photo1$ = "Hollywood\\Examples\\Hollywood\\AsyncFX\\pics\\01.jpg"  
LoadBrush(1, photo1$ )
InsertLayer(1, #BRUSH, 1, #CENTER, #CENTER, True)
SetLayerName(1, "Photo1")
ShowLayer("Photo1")

p_Show("Photo1")

Repeat
	WaitEvent
Forever
User avatar
airsoftsoftwair
Posts: 5471
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: How to find out which #RANDOMEFFECT was used?

Post by airsoftsoftwair »

nexus wrote: Sat May 25, 2024 8:54 am Here we go. All #SCROLLXXX-Effects return a 0:
Thanks, clearly a bug. Will be fixed.
Post Reply