Richmond's Yule Project
Forum rules
Be kind.
Be kind.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Richmond's Yule Project
I am going to go through the stages of making a keyboard, and/or, mouse controlled game in OXT.
For this I shall use Open Source resources from Battle for Wesnoth: https://www.wesnoth.org/
Free troll sprites from: https://craftpix.net/
- - - -
GIMP: https://www.gimp.org/
and, of course, OXT Lite.
For this I shall use Open Source resources from Battle for Wesnoth: https://www.wesnoth.org/
Free troll sprites from: https://craftpix.net/
- - - -
GIMP: https://www.gimp.org/
and, of course, OXT Lite.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
I will START the game with a plain grass background exported from Wesnoth and then reduced to 50% of it size.
- -
Craftpix sets come in extremely generous ZIP files with images at vast sizes and in all sorts of poses:
- -
I shall select the sequences I wish to use and resize them to 10% of their original size.
- -
I shall rename them for my own requirements.
- -
Craftpix sets come in extremely generous ZIP files with images at vast sizes and in all sorts of poses:
- -
I shall select the sequences I wish to use and resize them to 10% of their original size.
- -
I shall rename them for my own requirements.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
We can start things rolling by finding out how to animate a character in a game.
I have started with a simple stack, a contrasting background image and a series of still images derived from Craft Pix images.
- -
What I now need is a 'frame' to exhibit these images within:
https://en.wikipedia.org/wiki/Multiplane_camera
-
I have started with a simple stack, a contrasting background image and a series of still images derived from Craft Pix images.
- -
What I now need is a 'frame' to exhibit these images within:
https://en.wikipedia.org/wiki/Multiplane_camera
-
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
Let's drag a Rectangle Graphic from the Tools palette to our stack:
- - - -
You will see that I have:
1. renamed the rectangle graphic to 'gFRAME'.
2. made the rectangle graphic transparent.
3. made the border of the rectangle graphic have a width of 0 do it is invisible.
- - - -
You will see that I have:
1. renamed the rectangle graphic to 'gFRAME'.
2. made the rectangle graphic transparent.
3. made the border of the rectangle graphic have a width of 0 do it is invisible.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
Here is a simple right-to-left animation controlled by the 'a' and 's' keys:
- -
The card Script is this:
Stack deletedas better version now available.
- -
The card Script is this:
Code: Select all
on keyDown
put empty into fld "fTRAP"
end keyDown
on keyUp QUAY
if fld "fTRAP" contains "x" then
-- do nothing
else
if QUAY is "a" then
if the left of grc "gFRAME" < 80 then
--- do nothing
else
put fld "FRM" into FRMX
if FRMX < 9 then
put (FRMX + 1) into fld "FRM"
put item 1 of the loc of grc "gFRAME" into LATERAL
put item 2 of the loc of grc "gFRAME" into ALTITUDE
subtract 40 from LATERAL
set the height of grc "gFRAME" to the height of image ("T1L0" & (FRMX + 1) & ".png")
set the width of grc "gFRAME" to the width of image ("T1L0" & (FRMX + 1) & ".png")
set the backGroundPattern of grc "gFRAME" to the ID of image ("T1L0" & (FRMX + 1) & ".png")
move grc "gFRAME" to LATERAL, ALTITUDE
else
put -1 into fld "FRM"
put fld "FRM" into FRMX
put (FRMX + 1) into fld "FRM"
put item 1 of the loc of grc "gFRAME" into LATERAL
put item 2 of the loc of grc "gFRAME" into ALTITUDE
subtract 40 from LATERAL
set the height of grc "gFRAME" to the height of image ("T1L0" & (FRMX + 1) & ".png")
set the width of grc "gFRAME" to the width of image ("T1L0" & (FRMX + 1) & ".png")
set the backGroundPattern of grc "gFRAME" to the ID of image ("T1L0" & (FRMX + 1) & ".png")
move grc "gFRAME" to LATERAL, ALTITUDE
end if
put "x" into fld "fTRAP"
end if
end if
----
if QUAY is "s" then
if the right of grc "gFRAME" > 1120 then
--- do nothing
else
put fld "FRM2" into FRMZ
if FRMZ < 9 then
put (FRMZ + 1) into fld "FRM2"
put item 1 of the loc of grc "gFRAME" into LATERAL
put item 2 of the loc of grc "gFRAME" into ALTITUDE
add 40 to LATERAL
set the height of grc "gFRAME" to the height of image ("T1R0" & (FRMZ + 1) & ".png")
set the width of grc "gFRAME" to the width of image ("T1R0" & (FRMZ + 1) & ".png")
set the backGroundPattern of grc "gFRAME" to the ID of image ("T1R0" & (FRMZ + 1) & ".png")
move grc "gFRAME" to LATERAL, ALTITUDE
else
put -1 into fld "FRM2"
put fld "FRM2" into FRMZ
put (FRMZ + 1) into fld "FRM2"
put item 1 of the loc of grc "gFRAME" into LATERAL
put item 2 of the loc of grc "gFRAME" into ALTITUDE
add 40 to LATERAL
set the height of grc "gFRAME" to the height of image ("T1R0" & (FRMZ + 1) & ".png")
set the width of grc "gFRAME" to the width of image ("T1R0" & (FRMZ + 1) & ".png")
set the backGroundPattern of grc "gFRAME" to the ID of image ("T1R0" & (FRMZ + 1) & ".png")
move grc "gFRAME" to LATERAL, ALTITUDE
end if
put "x" into fld "fTRAP"
end if
end if
end if
end keyUp
https://richmondmathewson.owlstown.net/
- overclockedmind
- Posts: 363
- Joined: Sat Apr 30, 2022 9:05 pm
- Location: Midwest US
- Contact:
Re: Richmond's Yule Project
I have a TON of assets I have purchased for this exact thing.
... you're teaching me something I wanna DO, here.
Can we add controller support? Just a thought... and a question to multiple people.
... you're teaching me something I wanna DO, here.
Can we add controller support? Just a thought... and a question to multiple people.

System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win10 Pro, Current)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
Thank you so much for "rising to the bait".Can we add controller support?

If by controllers you mean these kinds of things:
- -
4 out of 7 of my 'devices'.
then they ALL send rawKey signals to both MacOS and Linux (and,I assume Windows).
I am, however, going to take a discussion about input devices to a different thread.
------------------
Oddly enough
having stated the above, the 2 devices on the left are NOT sending detectable key signals via MacOS 15.2.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
HOWEVER,in the light of this:
- -
It might be sensible to change the RIGHT animation to the 'd' key.
- -
Stack deleted as better version now available.
- -
It might be sensible to change the RIGHT animation to the 'd' key.
- -
Stack deleted as better version now available.
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
However, the example is 2 dimensional and fairly boring.
So, here is another stack where the troll will move to wherever you click (with a mouse) in the stack:
-
So, here is another stack where the troll will move to wherever you click (with a mouse) in the stack:
-
- Attachments
-
- Animation Demo #2.oxtstack.zip
- (951.09 KiB) Downloaded 29 times
https://richmondmathewson.owlstown.net/
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
Feeling frolicsome:
-
Code: Select all
-- skipping --
if Quay is "w" then
put item 1 of the loc of grc "gFRAME" into LATERAL
put item 2 of the loc of grc "gFRAME" into ALTITUDE
put (ALTITUDE - 25) into ALTITUDE
move grc "gFRAME" to LATERAL, ALTITUDE
put (ALTITUDE + 25) into ALTITUDE
wait 10 ticks
move grc "gFRAME" to LATERAL, ALTITUDE
put "x" into fld "fTRAP"
end if
- Attachments
-
- Animation Demo #1.oxtstack.zip
- (1.15 MiB) Downloaded 27 times
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Richmond's Yule Project
Could you adjust to use non-blocking repeat loops, as these will currently block subsequent input until the character has finished moving.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
That will ONLY be necessary when I start work on the proper game stack.
The stacks I have uploaded are JUST pedagogical things to show a few ways to animate a 'troll'.
Certainly non-blocking is necessary when, for the sake of argument a troll is chasing a robot, and while the robot is jinking around according to some semi-randomised something our end-user/gamer is trying to clobber it with the troll.
The stacks I have uploaded are JUST pedagogical things to show a few ways to animate a 'troll'.
Certainly non-blocking is necessary when, for the sake of argument a troll is chasing a robot, and while the robot is jinking around according to some semi-randomised something our end-user/gamer is trying to clobber it with the troll.
https://richmondmathewson.owlstown.net/
- overclockedmind
- Posts: 363
- Joined: Sat Apr 30, 2022 9:05 pm
- Location: Midwest US
- Contact:
Re: Richmond's Yule Project
Let me know when you spin off that "controller" sub-thread. You've got some fairly standard stuff there... some a bit more esoteric, but hey, controllers are "USB human input devices" so surely, there's got to be some standard we can code against.
... surely?
Anyway I'd like to follow that, and I'm following right along with this, too. MANY thanks for writing it!
... surely?
Anyway I'd like to follow that, and I'm following right along with this, too. MANY thanks for writing it!
System76 serv12 (64GB RAM, 2TB SSD, 2TB HD, Win10 Pro, Current)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
MBA (Early 2015, 8GB/512G SSD, Monterey 12.7.2 and Linux Mint)
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Richmond's Yule Project
Started this controller thread, as I originally hijacked Richmond's post. Instead, I've moved the posts here.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
If by 'hijacking' you end up developing gamepad controllers, then hijack away to you heart's content. 
The fact that I cannot, at present use this with OXT on MacOS 15 is annoying:
- -
after all, it cost me £5.
AND if you are hard put to imagine any advantage to living in Bulgaria, over, say, England: look no further than Amazon:
- -
That IS, of course, the ONLY reason I live here: cheaper gamepads . . . ROFL.
HOWEVER: having 'hijacked' this thread: it will now degenerate into not just a simple instruction thread, but full-on nausea.
As OXT is NOT multithreaded, to effect
which is NOT mentioned in the Dictionary, but SHOULD BE. 
The next stack will feature:
1. A 'person' who moves independently of the end-user.
2. A 'person' that is controlled by the end-user.
And neither of these 'people' should block the movement of the other.

The fact that I cannot, at present use this with OXT on MacOS 15 is annoying:
- -
after all, it cost me £5.

AND if you are hard put to imagine any advantage to living in Bulgaria, over, say, England: look no further than Amazon:
- -
That IS, of course, the ONLY reason I live here: cheaper gamepads . . . ROFL.

HOWEVER: having 'hijacked' this thread: it will now degenerate into not just a simple instruction thread, but full-on nausea.
As OXT is NOT multithreaded, to effect
one has to usenon-blocking
Code: Select all
without waiting

The next stack will feature:
1. A 'person' who moves independently of the end-user.
2. A 'person' that is controlled by the end-user.
And neither of these 'people' should block the movement of the other.
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Richmond's Yule Project
At the time (a couple of years ago), that Saitek controller was off a car-boot sale. It cost me all of £1 in a box of assorted computer bits. I actually got 2 for £2 (they didn't even offer me a discount for taking both of them!)
...not that I'm still bitter about it at all you understand...
However, send [thing] to [somewhere] in [x] milliseconds will achieve what you want without using hardcoded repeat loops - and wait statements in animation are just a bad idea.
See the 'shufflepuckery post' for example stacks of how it's done if that helps.
Not that I'm trying to tell you how to do it mind... each to their own.
Incidentally, the "without waiting" is detailed in the dictionary:


You don't have to use that at all. In fact, it is multi-threaded. There's multiple rendering, processing threads etc.richmond62 wrote: ↑Tue Nov 12, 2024 7:46 am ...As OXT is NOT multithreaded, to effectone has to usenon-blockingCode: Select all
without waiting
However, send [thing] to [somewhere] in [x] milliseconds will achieve what you want without using hardcoded repeat loops - and wait statements in animation are just a bad idea.
See the 'shufflepuckery post' for example stacks of how it's done if that helps.
Not that I'm trying to tell you how to do it mind... each to their own.
Incidentally, the "without waiting" is detailed in the dictionary:
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
That's very queer as I could not locate 'waiting' yesterday.
LiveCode, at least, is not multi-threaded.
Teaching xTalk and Using xTalk do not always use the same considerations.
What is 'it'?In fact, it is multi-threaded.
LiveCode, at least, is not multi-threaded.
Not if they are being used in demonstration stacks so that learners can get a chance to see what it going on.wait statements in animation are just a bad idea.
Teaching xTalk and Using xTalk do not always use the same considerations.
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Richmond's Yule Project
"Mean what you say and say what you mean"? or "Do it differently, not as I've shown you." - so what's the point in teaching a method that is not going to give the desired results?richmond62 wrote: ↑Tue Nov 12, 2024 9:59 am Teaching xTalk and Using xTalk do not always use the same considerations.
If this is supposed to come under the 'teaching' category, I'll move it to the education section. That way it'll free up the "discussion" section... for discussions.
- richmond62
- Posts: 4833
- Joined: Sun Sep 12, 2021 11:03 am
- Location: Bulgaria
- Contact:
Re: Richmond's Yule Project
This thread STARTED as a "follow along" sort of teaching project (and it was not me that transformed it into a discussion).
My Sheba project is conceived on in the same way (and this weekend that thread will take up moreof my time than this one).
Your interpretation of the word 'Discussion' may be different to mine: certainly if you wish move this thread to the Education thread, but then move the Sheba thread there as well.
HOWEVER; one thing you need to consider is that we are attempting to attract new xTalk users, and completely new computer programmers to OXT (or, maybe that has slightly got lost sight of?), so, at present at least, I would have thought the distinction between 'discussion' and 'education' was rather thin.
ALSO, as this thread progresses, and as I "recycle" code from the examples I have already uploaded I shall be 'refining' them, explaining why, and asking a few questions re efficiency over ease-of-use, and so on.
Computers, in my experience, can often do things rather more quickly than the human brain can process . . .
How one ensures that an animation delivers frames at say, 25 per second, might prove difficult without wait statements.
My Sheba project is conceived on in the same way (and this weekend that thread will take up moreof my time than this one).
Your interpretation of the word 'Discussion' may be different to mine: certainly if you wish move this thread to the Education thread, but then move the Sheba thread there as well.
HOWEVER; one thing you need to consider is that we are attempting to attract new xTalk users, and completely new computer programmers to OXT (or, maybe that has slightly got lost sight of?), so, at present at least, I would have thought the distinction between 'discussion' and 'education' was rather thin.
ALSO, as this thread progresses, and as I "recycle" code from the examples I have already uploaded I shall be 'refining' them, explaining why, and asking a few questions re efficiency over ease-of-use, and so on.
could you also justify that statement?and wait statements in animation are just a bad idea
Computers, in my experience, can often do things rather more quickly than the human brain can process . . .
How one ensures that an animation delivers frames at say, 25 per second, might prove difficult without wait statements.
https://richmondmathewson.owlstown.net/
- tperry2x
- Posts: 3210
- Joined: Tue Dec 21, 2021 9:10 pm
- Location: Somewhere in deepest darkest Norfolk, England
- Contact:
Re: Richmond's Yule Project
This has been covered multiple times before, between xAction and yourself.richmond62 wrote: ↑Tue Nov 12, 2024 1:22 pmcould you also justify that statement?and wait statements in animation are just a bad idea
Who is online
Users browsing this forum: Google [Bot] and 6 guests