Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: Help with Cloned Objects
PostPosted: October 29th, 2006, 8:27 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
There are several topics relating to cloning here but I haven't been able to transfer ideas from these into my own project.

I have several objects (images) on screen that I wish to use as buttons to generate clones of the same image. I wish the clones to be drag and drop objects but not the master image that generates them. Other objects on screen will be target frames to accept one or more of the cloned object types, and a bin to discard any unwanted clones (from any of the images).

I understand things better if its shown in a sample opus file.

Anyone willing to reveal these mysteries to me? I would be very grateful


For this message dpj has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 29th, 2006, 10:39 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

I'm not sure how to create an original object that will not have drag and drop properties while it's clones will have these. My sense is that clones behave the same as their parent object. So, for the clones to be drag-able/drop-able, so would the original.

Maybe other Forum members or DW can add this part of the solution.

I've attached an .imp file with basic cloning using a button, plus a "trash" bin into which un-needed cloned objects can be dragged to make them "disappear."

I hope this helps.

Kind Regards,


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

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Cloned Objects
PostPosted: October 30th, 2006, 7:20 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Thanks Stephen.

I've added bits to the example that Stephen created to see if anybody can come up with a solution. If there are different drop zones for the various objects, I cannot use 'any draggable object' (as I've done in the example) as only some are acceptable. It would be straightforward to use 'these draggable objects' and select named ones if they were the originals, but they will be clones. I suspect this will have to be done in a Script. Still pondering over how to make the source objects fixed but the clones draggable.

The bin could accept 'any draggable object' but if the bin was smaller than the dragged object I guess the objects would have to be destroyed rather than hidden behind the bin. Again I suspect that a Script will be necessary.

Any scripting experts out there willing to help.

Thanks again Stephen.

Regards
Dave


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


For this message dpj has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 30th, 2006, 9:45 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 Dave

I'm also hopeful that someone with advanced scripting skill will offer some ideas.

Trying using the search term "clones" on this forum to see some of the solutions created, including:

viewtopic.php?t=374&highlight=clones

I think advanced scripters can name, identify and then set actions for specific clones. But, I'm afraid this is beyond my ability.

One trick I've tried with drop zones used for "trash," to add size and assure the disappearance of objects: place a substantial part of them off the side or bottom of a page and set snap to center. If the drop zone center is a few hundred pixels off page, an object would have to be pretty big to continue to show on the page once dragged to that drop zone. See my attached revision of your latest sample as to "trash" drop zone.

I hope this helps.

Kind Regards,


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

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 31st, 2006, 6:18 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
Stephen...
Was trying to use "this.DestroyClonedObject()" but for some reason, getting an RTTI error that closes the application for me...
I believe you should be able to use the action"Object Dropped" or "Drop Zone Full" and have a script that destroys the clone...
Remember, each cloned object has a <name>.<unique identifier> as a name and you will need to get the unique name for this....

If I get round the error, will finish the code and post it here....


For this message eomc40 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 31st, 2006, 6:39 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 eomc40

Recognizing your scripting expertise and experience developing solutions for cloning, I'm delighted that you may be able to help Dave with his cloning challenge.

I've noticed a few of the same RTTI error messages closing Opus lately, in my case since I've downloaded some of the recent Microsoft updates. What works for me when these occur is a reboot, which sort of "cleans up" whatever is lurking, gives Opus a fresh start.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Held with cloned objects
PostPosted: November 1st, 2006, 7:05 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
I think I've got round one of the problems I had, i.e. original not draggable but the cloned objects draggable. Instead of using a button underneath the object to do the cloning I've made an exact copy of the original object on top of it. The action set for this object is the same as on the original grey button. Properties changed to include 'Stop mouse clicks passing through' (in General) and switch off 'This object can be dragged' in 'Drag and Drop'. Applying a click makes a clone of the object underneath but the copy on top stops the user from dragging the original.

I wish the other problems were as simple to solve.

Thanks to all contributing to this query. Looking forward to a solution to finding out how you can make use the name of the current cloned object that is being dragged within a script, for the purpose of deleteing it (destroy cloned object) and/or various manipulation (e.g. rotate increase/reduce size).

Thanks all

Dave


For this message dpj has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 1st, 2006, 7: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
Hi Dave

It sounds like you've come up with a good work-a-round. You could probably also use a non-draggable hotspot over the object you wish to clone with a hotspot script to clone the object.

Hopefully, others can respond to how to name and work with clones.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 3rd, 2006, 12:39 pm 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
dpj, Stephen
for creating a clone, use the following, this assigns a name i.e. clone0,clone1,clone2

Code:
eval("clone" + index + "= my_object.CloneObject()")
index++


where index starts at 0 and is incremented each time a clone of this object is created.

my_object is the object you need to clone.

with this in place you will be able to destroy the object i.e.

clone0.DestroyClonedObject(). This didn't result in RTTI errors and believe is what Duncan meant was the best solution instead of using keyword "this".


For your "bin" implementation, you could do something like

since you do not need to keep details of the objects being destroyed, an array will not be necessary hence a quick solution would be as follows


at the point of cloning, create a temporary variable that holds the named variable as follows

Code:
eval("clone" + index + "= my_object.CloneObject()")
my_id = "clone" + index
index++


and on the frame for bin you can use "Drag and Drop" Trigger, and "Object Dropped" action to have something like


Code:
eval(my_id + ".DestroyClonedObject()")


in a script.

Hope this helps


For this message eomc40 has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 3rd, 2006, 1:12 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 eomc40

Thanks. While I'm not working on cloning currently, it's a valuable scripting example to have posted on the Forum. Brilliant!

Kind Regards, :)

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Help with Cloned Objects
PostPosted: November 8th, 2006, 8:22 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Thanks Stephen and eomc40 for all your help so far. Had some problems with Internet access so unable to respond sooner.

Just when you thought you got rid of me ... :evil:

The cloning bit is working fine and increments name of new cloned objects properly. However having problems with Trash (bin) recognising the cloned objects when they are dragged on. Error message .... "Eval Code (1, 0) : Object Not Found : The called object is not a valid object type (undefined? null?)". I suspect the same applies to the intended target areas once code is written to allow/refuse specific objects.

Attached file shows what is and what is not working as described above.

Any ideas (again) please?

Really appreciate the help I'm getting

Dave


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


For this message dpj has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 9th, 2006, 12:59 am 
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 Dave

By far, I'm not the expert on cloning, having myself been extensively helped by forum colleagues and the DW team, over time.

I'm not sure why you are using a destroy cloned object to get rid of items in the trash bin. I think that action will produce the type of script error messages you are getting. Why not simply resize the trash bin (to very large proportions) with the samllest corner of it showing in a corner of the pub, like I had sent an example of. Have it set to snap to center, which will be way off the page. That way those items not needed will remain off the page and out of view, even if their position is saved and the clones are reset upon return to the page. They will be reset to the center of the trash bin way off the page. From what I understand, there's not limit on cloning, so you are unlikely to need to be concerned about those clones that are sent to the trash bin.

I'm hopeful that those forum members more experienced with cloning can add their input.

Kind Regards,

_________________
Stephen


For this message Stephen has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Help with Cloned Object
PostPosted: November 9th, 2006, 1:38 am 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Thanks for the response Stephen,

I agree with you that the enlarged trash bin would resolve the removal of objects much easier. Perhaps I'm biting off more than I can chew, but I feel that if I was able to resolve the problem by using the clone name then it offers more scope for further development, e.g. accepting or refusing clones on various drop zones, linking a clone to a button where a script could be produced to flip, rotate, enlarge/reduce size of the clone etc. If a solution cannot be found to cater for this then I certainly will adopt your hint of enlarging the trash bin off the screen area.

Thanks
Dave


For this message dpj has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: November 9th, 2006, 11:44 am 
Offline

Joined: November 11th, 2004, 1:43 pm
Posts: 172
Location: Buckinghamshire, UK
dpj
Just managed to implement the code in using trigger action "Mouse Exit" of the "bin"...
When you drop the object in the bin, in effect your mouse pointer will be over the bin, hence the mouse exit action works. I have tried this with the bin being bigger that the object or smaller than the object and both options work.
I would have preferred this to be an action completed by drop events but this should work.


Code:
eval(my_id + ".DestroyClonedObject()")


PS: Remember to include a test code to ensure that only do a destroyobject on mouse exit of the bin area if an object actually exists....


For this message eomc40 has been thanked by : mackavi


Top
 Profile  
 
 Post subject: Help with Cloned Object
PostPosted: November 10th, 2006, 8:28 pm 
Offline

Joined: November 21st, 2004, 1:15 pm
Posts: 39
Location: Wales
Opus: Opus Pro v9.5
OS: Windows 7 & Windows 8
System: iMac (with Bootcamp dual boot for Windows) + Sony VAIO laptop
Thanks for your continuous support eomc40. I tried what you suggested using a MouseExit trigger rather than a 'drop' but unfoprtunately my system generated the same error message "Eval Code (1, 0) : Object Not Found : The called object is not a valid object type (undefined? null?)". I'm using Opus Pro 5.5. If you have a simple example of the above that works - is there any chance that you would be willing to post the file on the forum so that I can find out where I'm going wrong. When I started this query I thought there might have been a simple solution but now I'm inclined towards using Stephen's solution of a large off screen trash bin, and giving up on some other related more ambitious ideas.

Thanks for your time and efforts.

Dave


For this message dpj has been thanked by : mackavi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Majestic-12 [Bot] and 67 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