Custom properties

All flavors welcome.
Forum rules
Be kind.
Post Reply
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Custom properties

Post by richmond62 »

Way back in Jeddah, KSA, in 1997, my children were stuck most of the time in the house (if you have ever been to Jeddah you'll know why), with a Performa Mac and, among many other educational programs something called 'Sammy's Science House', and one of MY favourite activities was this:
-
10581-6-sammy-s-science-house.jpg
10581-6-sammy-s-science-house.jpg (42.52 KiB) Viewed 4460 times
-
Now if one stops for a minute and thinks about cladistics and taxonomy one will realise that a recreation of this program in xTalk could be best effected using custom properties.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

For the purposes of this stack I intend to make this place my spiritual home:

https://classroomclipart.com/

And this is useful for classification:

https://en.wikipedia.org/wiki/Linnaean_taxonomy

I shall work like this:

KINGDOM
PHYLUM
ORDER
FAMILY
GENUS


although for the fairly crude classification needed we will probably only need the first 4.
-
Tax.jpg
Tax.jpg (79.64 KiB) Viewed 4457 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

Screenshot 2025-03-03 at 21.02.33.jpg
Screenshot 2025-03-03 at 21.02.33.jpg (168.3 KiB) Viewed 4453 times
-
Cannot say I am weeping into my cups that the fact that the Saudis have bulldozed the slum where we lived. 8-)
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

Half the battle to make software appealing (especially to Primary school children) is getting the graphics looking good:
-
Screenshot 2025-03-04 at 11.44.15.png
Screenshot 2025-03-04 at 11.44.15.png (288.48 KiB) Viewed 4386 times
-
Screenshot 2025-03-04 at 11.49.30.png
Screenshot 2025-03-04 at 11.49.30.png (318.04 KiB) Viewed 4384 times
-
Screenshot 2025-03-04 at 12.30.00.jpg
Screenshot 2025-03-04 at 12.30.00.jpg (151.12 KiB) Viewed 4366 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

I could have stolen all the images from the original software for the illustration exercie here except for a number of problems:

1. All those images are bitmapped for display at a far lower screen size than is now standard.

2. I intend to deploy the end stack on the machines in my ESL school.

3. This sort of imagery makes me vomit:
-
Screenshot 2025-03-04 at 12.32.08.png
Screenshot 2025-03-04 at 12.32.08.png (56.98 KiB) Viewed 4365 times
-
Screenshot 2025-03-04 at 12.34.40.png
Screenshot 2025-03-04 at 12.34.40.png (32.62 KiB) Viewed 4365 times
-
Neither my children, nor myself at the same age, liked that sort of kiddy-kitsch; so I see no good reason to
force it on yound learners today.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

Now, let's try a 'dry run':
-
Screenshot 2025-03-04 at 12.51.12.jpg
Screenshot 2025-03-04 at 12.51.12.jpg (106.06 KiB) Viewed 4346 times
-
Currently this does NOT leverage custom properties:
-
Screenshot 2025-03-04 at 12.53.22.jpg
Screenshot 2025-03-04 at 12.53.22.jpg (126.46 KiB) Viewed 4345 times
-
Attachments
Taxonomy.oxtstack
(382.31 KiB) Downloaded 124 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

For anyone who wants to try "the real thing":

https://macintoshgarden.org/games/sammys-science-house

This is a Macintosh/Windows hybrid disk image.

https://en.wikipedia.org/wiki/Edmark

Almost all of Edmark's software is downloadable from the Internet Archive.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

The point (when I get to it) of using custom properties is that I can have 50,000 objects (pictures) should I choose that share a single code, rather than having to hand-code each one.
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

Right . . . at long last to one way to use custom properties.

As each image of the things to be dropped on the drop-targets has a custom property 'PHYLUM' it is possible for ALL the objects to have the same script:
-
Screenshot 2025-03-08 at 17.47.59.jpg
Screenshot 2025-03-08 at 17.47.59.jpg (211.91 KiB) Viewed 3696 times
Attachments
Taxonomy_CP.oxtstack
(412.76 KiB) Downloaded 89 times
https://richmondmathewson.owlstown.net/
User avatar
richmond62
Posts: 5288
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: Custom properties

Post by richmond62 »

The only slight snag about this method is having to put an objects's location into a field (every operation that involves fields slows things down: not that is this case any end-users are likely to notice the microsecond difference).

One way to circumvent this would be to store the location in another custom property:
-
Screenshot 2025-03-08 at 20.12.46.jpg
Screenshot 2025-03-08 at 20.12.46.jpg (216.53 KiB) Viewed 3571 times
Attachments
Taxonomy_CP_2.oxtstack
(412.54 KiB) Downloaded 94 times
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 3522
Joined: Tue Dec 21, 2021 9:10 pm
Location: webtalk.tsites.co.uk
Contact:

Re: Custom properties

Post by tperry2x »

Just an idea, but you could perhaps avoid setting scripts on each item at all.
An example, none of these 4 coloured images in this stack have any script applied to them.
They will report their name and their custom properties when dragged.
The entire script is in the card script, as shown.
sorting without individual scripting.png
sorting without individual scripting.png (149.69 KiB) Viewed 3547 times
sorting without individual scripting.oxtstack
(5.55 KiB) Downloaded 94 times
That might be a bit awkward to read on that screenshot, so here it is:

Code: Select all

local tObjName
local tClassification

on mousedown
   try
      get the short name of (controlAtLoc(the mouseLoc))
      put it into tObjName
      if there is an image tObjName then
         put the ttype of image tObjName into tClassification
         if tClassification is "" then exit mousedown
         put tClassification into fld "output" 
         revIDESetCursor "com.livecode.cursor.grabclose"
         grab image tObjName
      end if
   catch e
   end try
   pass mousedown
end mousedown

on mouseup
   revIDEResetCursor
      if there is an image tObjName then
      put the ttype of image tObjName into tClassification 
   else
      put "" into tClassification
   end if
   if not (tClassification is "") then
      put "mouse released. Was dragging image " & tObjName & " which is a type of " & tClassification into tDrop
      put tDrop into fld "out2"
   end if
   pass mouseup
end mouseup
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests