Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 22nd, 2024, 6:05 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Moved From Basic (cloned objects)
PostPosted: August 9th, 2005, 9:25 am 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
Hi

I'm continuing to try to learn about using cloned objects. With previous help, I've been able to successfully set up cloning a vector object and then getting the unique ID for atleast one of its clones. This ID returns as a string leaving me unsure how to then take the next steps: to script GetPosition returning the clone's pos.x, pos.y values, then write these to registry using its unique ID.

Challenges beyond this are to then script either a reset button or PreShow/OnShow trigger that can read the clone's saved x and y positions (SetPosition) plus recreate the saved clone, when the page is re-opened.

Any specific ideas, script examples as to how to use the returned unique ID/string to write to/read from registry, set script commands like recreate saved clones, Get/SetPosition, would be greatly appreciated. Once I get the basic script template working, I can hopefully figure out how to apply it to multple clones of the same object and extend it to other objects and their clones.

Kind Regards,

Stephen


Top
 Profile Visit website  
 
 Post subject:
PostPosted: August 9th, 2005, 10:10 am 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
Here is a small example publication that show how an array can be used to keep track of your cloned objects. In the example you will end up with 5 Cloded Objects.

myClone(0)
myClone(1)
myClone(2)
myClone(3)
myClone(4)

Regards

Brenden Knifton


You do not have the required permissions to view the files attached to this post.


Top
 Profile Visit website  
 
 Post subject: Cloned Objects
PostPosted: August 9th, 2005, 1:11 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Brendon: Thanks for the example.

As you can see from the following script that doesn't seem to work, I'm unsure how to write these basic functions using the correct scripting syntax. When I try this script, I get error messages.

My "Wish List" would be an intro tutorial in the basic logic behind scripting that is implemented via basic syntax (a sort of 'this is how it works and this is how you do it'). Also, many more examples in the script help files.

Vector1.CloneObject()
var CloneID = this.GetUniqueObjectID()
Clone1=CloneID
var pos = Clone1.GetPosition()
var PosX = pos.x
var PosY = pos.y
WriteRegistryValue( "HKEY_CURRENT_USER\\Software\\DigitalWorkshop\\OpusPublicationData", "Clone1", PosX )
WriteRegistryValue( "HKEY_CURRENT_USER\\Software\\DigitalWorkshop\\OpusPublicationData", "Clone1", PosY )

If I could figure out how to clean up the script to work, the next step might be to call the object's appearance and position (using its unique object ID or a Clone#=unique object ID?) and then re-set it via SetAppearance and SetPosition.

Kind Regards,
Stephen


Top
 Profile  
 
 Post subject: What practical application?
PostPosted: August 9th, 2005, 1:34 pm 
Offline

Joined: October 25th, 2004, 2:20 pm
Posts: 686
Location: Naperville, Illinois (USA)
Opus: 7.05
OS: Win XP SP3
System: P4 3.2GHz 1GB RAM 2-TB HDs + 4 more
Stephen --

My head spins and brain automatically shuts down when it comes to Scripts in OPUS. I only use them when absolutely necessary.

I'm interested in knowing what practical value you are using this Cloning stuff for? Please give us details of the application. Why do you need to Clone Objects? As a viewer, what would I see? What would I be doing with Clones? Is this for a game?

TIA

_________________
Fred Harms, Extraordinary Demos
Naperville, Illinois (USA) 630/904-3636
demofred@aol.com


Top
 Profile Visit website  
 
 Post subject: Cloned Objects
PostPosted: August 9th, 2005, 2:08 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Hi Fred

This is an education project related to family history. Learning materials are accompanied by a page that allows the viewer to graphically create their own family tree (similar to a genogram), using symbols to represent family members, lines to represent relationships.

Since space is limited on this page, and I initially thought it would be preferable not to clutter it with pre-made symbols and lines, I tried using a single version of each graphic and setting up cloning. Cloning would have allowed the viewer to create the number and type of symbols/lines they needed from a few basic models. Given my limited scripting ability, this option was unsuccessful, and I decided to provide a finite number of symbols/lines. The space solution I used was to stack them one on top of the next. I've now completed and published the project using this work-around.

However, cloning would still preferable, since a finite number of objects can be insufficient for some viewers (for example, those with very large families). Also, the single page I've created cluttered with the hundreds of objects and component vectors/polygons and hundreds of actions is cumbersome (very slow) to edit. So, I'm still trying to figure out how to set up the cloning.

I hope that this helps explain my continued "quest" to improve my ability to create this clone solution via scripting.

Kind Regards,

Stephen


Top
 Profile  
 
 Post subject:
PostPosted: August 9th, 2005, 3:29 pm 
Offline

Joined: October 25th, 2004, 12:32 pm
Posts: 397
Location: Digital Workshop
I have revised the original example this one now allow you to Show the
X,Y coordinates of the 5 Cloned Objects. It Shows the X.Y values of the
objects and also allows you to drag the clones around the screen and
still find their position.

I am not sure that saving hundreds of positions to the registry is a very
good idea especially on the basis this is your first outing with script. In my
opinion it would be far safer to save the results to a file on the hard drive,
this would also allow you to move the file from machine to machine.

Regards

Brenden Knifton


You do not have the required permissions to view the files attached to this post.


Top
 Profile Visit website  
 
 Post subject: Cloned Objects
PostPosted: August 9th, 2005, 4:38 pm 
Offline
Godlike
Godlike

Joined: November 11th, 2004, 1:18 pm
Posts: 1213
Location: New York
Opus: Opus Pro 9.75
OS: Windows 10 Pro 64 bit
System: Core i7, 16G RAM, Nvidia 640GT (desktop), plus Windows 10 and Android tablets
Thanks, Brenden

I'll give it a try. Hopefully, I can learn how to do this for next time.

Re: saving to a hard drive file: each viewer will construct a different diagram based on their family's unique characteristics. So, if this is the data (positions) storage file, it will be different for each viewer.

However, if by this you mean a transferable storage template instead of the scripting done on the diagram's page, that would be different, but I'm unclear how it would replace the scripting, where to begin.

Unfortunately, absent any ability with clones, I've already done the hundreds of scripts and actions that you mention and completed the pub using these.

Kind Regards,
Stephen


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group