Page 1 of 1

Need help converting my C game to Hollywood, looking for suggestions.

Posted: Thu Aug 14, 2025 4:31 am
by MarisaG1967
First question:
What is the recommended method to convert structs to "hollywood method"

Will edit to add more questions as they come up...

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Thu Aug 14, 2025 2:09 pm
by Flinx
Tables.
You have two syntax variants. The second looks similar to the C struct access. From the manual:

Code: Select all

a = {} ; create empty table
a["name"] = "John Doe"  ; assign "John Doe" to index "name"
a.name = "John Doe"  ; assign "John Doe" to index "name"

b = a["name"]
b = a.name

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Fri Aug 15, 2025 10:54 am
by MarisaG1967
Thanks! Will give that a try!

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Fri Aug 15, 2025 9:07 pm
by MarisaG1967
I'm assuming that this will work as well:
typeofstruct.structinstance.structfield.fieldvalue

?

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Fri Aug 15, 2025 11:28 pm
by Flinx

Code: Select all

typeofstruct={}
typeofstruct.structinstance={}
typeofstruct.structinstance.structfield={}
typeofstruct.structinstance.structfield.fieldvalue=123
NPrint(typeofstruct.structinstance.structfield.fieldvalue)
ForEach(typeofstruct, NPrint)
ForEach(typeofstruct.structinstance, NPrint)
ForEach(typeofstruct.structinstance.structfield, NPrint)
NPrint("")

; shorter version:
typeofstruct={structinstance={structfield={fieldvalue=345}}}
NPrint(typeofstruct.structinstance.structfield.fieldvalue)
ForEach(typeofstruct, NPrint)
ForEach(typeofstruct.structinstance, NPrint)
ForEach(typeofstruct.structinstance.structfield, NPrint)

WaitLeftMouse()
Of course I don't know if it could be done better for your program. And I'm not perfect at many things in Hollywood either; I only know what I've already used. But keep asking, someone will answer :)

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Sat Aug 16, 2025 1:06 am
by MarisaG1967
Interesting suggestion, thanks!

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Sun Aug 17, 2025 6:40 pm
by Flinx
By the way, have you already decided how the game's graphics will be designed? As far as I can see, there are two fundamentally different approaches in Hollywood. The classic approach, where an image is constantly being rebuilt and synchronized with the vertical sync, and the later layer functions, which are more suited to more powerful graphics hardware. I've done everything with layers so far, but I've never built a game, and I didn't have the Amiga as my target platform for my current project..

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Sun Aug 17, 2025 9:50 pm
by MarisaG1967
It's a card game so animation will be minimal at first and maybe added on later. I'm thinking sprites for now. I'm targeting amiga/mac/Linux and maybe even windows.

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Mon Aug 18, 2025 10:51 am
by Flinx
For a card game, I think any approach will work.

Re: Need help converting my C game to Hollywood, looking for suggestions.

Posted: Wed Aug 20, 2025 12:56 pm
by Juan Carlos
To make a card game may be easier start it all from Hollywood, although it is true that the poker engines is more easy to try adapt it from C, I tryed to make a Texas Holdem Poker but it was a little complicated for me the CPU engine as rival and convert a example from C or Java is complicated. But to make a easy card game the best option is 100% Hollywood using layers to visual effects.