How to get Hollywood programs running under MacOS?

Find quick help here to get you started with Hollywood
Post Reply
GoemonIshikawa
Posts: 3
Joined: Tue Aug 13, 2024 1:27 am

How to get Hollywood programs running under MacOS?

Post by GoemonIshikawa »

Hello all, Goemon here!
Last time I spoke here I was trying to use and make a small calculator program that just printed text and would have music playing and would wait for the enter key.
I still want to do that but I wanted to make a program like the picture program in the tutorials, but only this time with music.
I have the following code and I would like to know if this is all correct. @LINKER {Files = {"3.mp3"}}
/*Hello, and welcome to my second attempt at programming.
this time I'll hopefully try to make a mini music player.
All it's supposed to do is play 6 files when the left and rite arrow keys are pressed. */
Print("Hello and welcome to the small music player.")
Print("Press left mouse button to continue!")
WaitLeftMouse()
Print("After you press the left mouse button, you should hear music and it should be in Japanese.")
Print("Press left mouse button to continue.")
WaitLeftMouse()
;This music thing better work dam it!
Local Function P_WaitSecs(s)
Wait(5, #Seconds)
EndFunction
OpenMusic(1, "3.mp3")
SetMusicVolume(1, "30%")
PlayMusic(1)
WaitLeftMouse()
End()
Another thing if it's not too much trouble, does someone know how I could get this running under MacOS? It didn't run under a friend's computer saying that it could not open the app.
Thanks so much for any help.
plouf
Posts: 589
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: How to get Hollywood programs running under MacOS?

Post by plouf »

hollywood is one of the few so much crossplatformer and yes it can run under macos, but you have to create a MacOS executable file

from IDE select File->Complie for single platform-> macos (probably Macos (x64) should be ok for MOST macos computers today )
it will create a macos compatible executable and then send it to your friend
Christos
Flinx
Posts: 263
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: How to get Hollywood programs running under MacOS?

Post by Flinx »

A Hollywood program for the Mac must be made executable, and maybe the first time it has to be started with Ctrl-click and “open”.
If it's not too complicated for you (because the page starts with a table), you can take a look at the setup instructions for my player: Setup
Further below is a section "How can you make the program executable on the Mac".

Apart from that your simple program works, but there are things to improve:
All text output using Print is written in a row. But I think that you want them to start on a new line, so NPrint() would be better.
The function P_WaitSecs(s) has no effect because it is not used. If you want to wait before the music starts, all you need is the Wait().
And if this function is to be used, then it should certainly not contain the number 5, but rather the value passed in s, so in the Wait() line an s instead of the 5.
User avatar
Juan Carlos
Posts: 921
Joined: Mon Sep 06, 2010 1:02 pm

Re: How to get Hollywood programs running under MacOS?

Post by Juan Carlos »

GoemonIshikawa wrote: Mon Sep 02, 2024 7:31 pm Hello all, Goemon here!
Last time I spoke here I was trying to use and make a small calculator program that just printed text and would have music playing and would wait for the enter key.
I still want to do that but I wanted to make a program like the picture program in the tutorials, but only this time with music.
I have the following code and I would like to know if this is all correct. @LINKER {Files = {"3.mp3"}}
/*Hello, and welcome to my second attempt at programming.
this time I'll hopefully try to make a mini music player.
All it's supposed to do is play 6 files when the left and rite arrow keys are pressed. */
Print("Hello and welcome to the small music player.")
Print("Press left mouse button to continue!")
WaitLeftMouse()
Print("After you press the left mouse button, you should hear music and it should be in Japanese.")
Print("Press left mouse button to continue.")
WaitLeftMouse()
;This music thing better work dam it!
Local Function P_WaitSecs(s)
Wait(5, #Seconds)
EndFunction
OpenMusic(1, "3.mp3")
SetMusicVolume(1, "30%")
PlayMusic(1)
WaitLeftMouse()
End()
Another thing if it's not too much trouble, does someone know how I could get this running under MacOS? It didn't run under a friend's computer saying that it could not open the app.
Thanks so much for any help.
Hello for you little project an idea, instead of use Print, use TextOut, with this you can select the text position in the window program, also with other text functions as FontSize, UseFont(x) etc. the visual text will gain in attractiveness, also you can use other music formats using the plugins for example ogg or mods.
GoemonIshikawa
Posts: 3
Joined: Tue Aug 13, 2024 1:27 am

Re: How to get Hollywood programs running under MacOS?

Post by GoemonIshikawa »

Hello all! Thanks so much for the help, and now to some replies.
plouf wrote: Tue Sep 03, 2024 6:56 am hollywood is one of the few so much crossplatformer and yes it can run under macos, but you have to create a MacOS executable file

from IDE select File->Complie for single platform-> macos (probably Macos (x64) should be ok for MOST macos computers today )
it will create a macos compatible executable and then send it to your friend
That's what I did, but I was more meaning how to get it to run once it's compiled, but thanks for the help anyways!
Flinx wrote: Tue Sep 03, 2024 11:16 am A Hollywood program for the Mac must be made executable, and maybe the first time it has to be started with Ctrl-click and “open”.
If it's not too complicated for you (because the page starts with a table), you can take a look at the setup instructions for my player: Setup
Further below is a section "How can you make the program executable on the Mac".

Apart from that your simple program works, but there are things to improve:
All text output using Print is written in a row. But I think that you want them to start on a new line, so NPrint() would be better.
The function P_WaitSecs(s) has no effect because it is not used. If you want to wait before the music starts, all you need is the Wait().
And if this function is to be used, then it should certainly not contain the number 5, but rather the value passed in s, so in the Wait() line an s instead of the 5.
Hello Flinx, thanks so much for the help! I was able to read the table just fine with my screen reader, and that's why my friend said he couldn't open the app.
I will show him how to make it run through the command line via show package contents, thanks so much.
I didn't know how the print command actually prints text, and I thought that NPrint was for Next Print hahaha.
So if I want to make it look more better after the first print statement do I just use NPrint from then on?
About the function dam, so that's why it felt so off to me.
You can actually call wait for a certain number of time with out calling a function? Or does the function have to be used.
Juan Carlos wrote: Tue Sep 03, 2024 11:19 am
GoemonIshikawa wrote: Mon Sep 02, 2024 7:31 pm Hello all, Goemon here!
Last time I spoke here I was trying to use and make a small calculator program that just printed text and would have music playing and would wait for the enter key.
I still want to do that but I wanted to make a program like the picture program in the tutorials, but only this time with music.
I have the following code and I would like to know if this is all correct. @LINKER {Files = {"3.mp3"}}
/*Hello, and welcome to my second attempt at programming.
this time I'll hopefully try to make a mini music player.
All it's supposed to do is play 6 files when the left and rite arrow keys are pressed. */
Print("Hello and welcome to the small music player.")
Print("Press left mouse button to continue!")
WaitLeftMouse()
Print("After you press the left mouse button, you should hear music and it should be in Japanese.")
Print("Press left mouse button to continue.")
WaitLeftMouse()
;This music thing better work dam it!
Local Function P_WaitSecs(s)
Wait(5, #Seconds)
EndFunction
OpenMusic(1, "3.mp3")
SetMusicVolume(1, "30%")
PlayMusic(1)
WaitLeftMouse()
End()
Another thing if it's not too much trouble, does someone know how I could get this running under MacOS? It didn't run under a friend's computer saying that it could not open the app.
Thanks so much for any help.
Hello for you little project an idea, instead of use Print, use TextOut, with this you can select the text position in the window program, also with other text functions as FontSize, UseFont(x) etc. the visual text will gain in attractiveness, also you can use other music formats using the plugins for example ogg or mods.
Hey there Juan! There is a reason why I use Print.
I'm a blind user to Hollywood, and that means I have no concept of colour or how text works in relation to the screen. and because Hollywood has no accessibility features that means that I will have to go with what everyone can see so that if I run into errors, I can get help with them with out worrying too much about how the screen looks.
Hollywood's Print function doesn't even expose itself to the screen reader so to be 100% sure I am printing text and it's on the screen I use Print.
But that doesn't mean that the TextOut idea won't work, infact that could help me much later when I get good at Hollywood so that way I can see if I could make accessibility features for Hollywood for Win Mac and Linux that use RapaGui along with the functions of screen readers. Because honestly I like Hollywood for its hand holding nature, but not seeing what's on my screen isn't jelling quite so good hahahah.
Anyway yall thanks so much for the feedbak, and I'll be sure to edit the program to changes as well as maybe change to .ogg, as that can loop if I need it to.
Flinx
Posts: 263
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: How to get Hollywood programs running under MacOS?

Post by Flinx »

GoemonIshikawa wrote: Tue Sep 03, 2024 1:12 pm So if I want to make it look more better after the first print statement do I just use NPrint from then on?
Use it for the first one too. NPrint() simply adds a newline to the string, so the next Print() or NPrint() starts on a new line (on the left).
You could have the same effect by inserting a backslash character and a n at the end of the string for Print().
GoemonIshikawa wrote: Tue Sep 03, 2024 1:12 pm You can actually call wait for a certain number of time with out calling a function? Or does the function have to be used.
Use only the Wait() command exactly in the form you have it in your function. This line is enough and the function does not make much sense for this.
Of course the function would work, if you would use it with the appropriate call, in your case

Code: Select all

P_WaitSecs(5)
But as a general rule: Write functions above your main program. So for your example I would have placed the function before the first Print command.
Flinx
Posts: 263
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Output for Screen Reader

Post by Flinx »

I thought again about the screen reader. It's hard for me to imagine how to write a program without looking at the text, because I can't hold many lines at once in my brain, but it's obviously possible.
To check the program output from NPrint(), which only appears graphically in the Hollywood window, you could try to replace NPrint() with ConsolePrint(). ConsolePrint() does almost the same as NPrint(), but the text is sent in the IDE into the Hollywood output window; and in a compiled program, a console window opens with the text. In both cases, this text should then be readable by your screen reader.
And to be able to easily change the output type in the entire program, a separate function would be useful, which could look like this:

Code: Select all

Const #CONSOLEOUTPUT=True ; Determine how the output should be made.

Function p_myNPrint(...)
	If #CONSOLEOUTPUT
		ConsolePrint(Unpack(arg))
	Else
		NPrint(Unpack(arg))
	EndIf
EndFunction

; Start of main program
p_myNPrint("Three:", 3) ; Example output
Wait(10,#SECONDS)
Post Reply