Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 8:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Drag & Drop: trying to achieve...
PostPosted: October 2nd, 2007, 1:58 am 
Offline

Joined: September 30th, 2007, 9:39 pm
Posts: 9
Say you got two baskets, one for vegetables and one for fruits

I'd like the user to be able to drop the item in the wrong place, for example a banana in the vegetable basket

then be allowed to fix the error himself after getting the feedback "some items are misplaced. Try again.

how would you accomplish that?

p.s.= I find the option where the vegetables basket would refuse the banana too basic.

cheers, BB


For this message BillyBob has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 2nd, 2007, 8:56 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Not sure if you wanted to use scripting, but this can be done by using standard drag and drop actions...or scripting. Depends how sophisticated you want to get. I have attached a very quick simple demo of using standard actions to achieve this, which will give you some ideas.

(Please note:-pub=public house. not an abbreviation for publication)

The cow and the cat are drag-able objects, they can be dragged to the pub!
The pub can have items dropped on it.
This is all set up in the properties Tab for the objects. When a drag-able item is dropped on the pub, it triggers an action to show the text.
The pub can have items dropped or removed.

This is used as a TRIGGER...when either the cow or the cat is dropped on the pub.
This is set up under the ACTIONS for the pub image...select TRIGGERS, then on the left DRAG and DROP.



You could also trigger a script to do whatever you wanted.....as always....with Opus, there is more than one way to skin a cat!!!

(You have to be signed in to the forum to see the attachment)


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

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 2nd, 2007, 7:05 pm 
Offline

Joined: September 30th, 2007, 9:39 pm
Posts: 9
thank you very much for your help. I appreciate :-)

problem is that I'd like

1. the feedback to be shown at last, once all the items have been sorted

2. the misplaced items go back to start placement


For this message BillyBob has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 2nd, 2007, 11:36 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I think scripting is the answer, but it will get quite involved. You can still use the drag and drop properties to set the basic operation and allow one object to be dropped on the other.
I would create functions to detect the location of the objects.rather than getting into nested if's.
For two objects called Pub and Cat... this can be done using something like.



Code:
function IsCatInPub()
{

if(Pub.IsObjectIntersecting(Cat))
{
//the actions you want to happen
}


you need some way to trigger the functions. This could simply be a button to start with.

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 3rd, 2007, 2:00 am 
BillyBob

I'm pretty sure that what you want to do can be done without the need for scripting.

You've given us no indication of your assessment of your skill level, so in that absence I'm going to assume you know nothing. :) You could have a lot of reading and learning to do including the Help Files. Remember to click the Help Button at the bottom of each property dialogue screen for more detailed explanations.

First things first:
First, my suggestion is that you do not try to make the final presentation on your first attempt. For example, when I'm trying a new technique, I set up a special chapter that I call the Test Bed. I make the page size the same as my pub so that everything fits and can be transferred once I have it right. That technique has saved me hours by not ruining my hard-won development.

Quote:
I'd like the user to be able to drop the item in the wrong place, for example a banana in the vegetable basket

1. Dragging and then dropping an object onto a target is controlled by the Drag and Drop Properties for any object. Double-click on an object, and open the Drag and Drop Tab. Study the options and read the Help Files. At your option, an object can be both dragged, and have something dropped on it.

2. Setting up the drop or target zone is controlled by the Drag and Drop Properties for any object. Double-click on an object, and open the Drag and Drop Tab. Study the options and read the Help Files. These properties allow you to drop all objects, or to restrict the accepting of a dropped object.

Quote:
then be allowed to fix the error himself after getting the feedback "some items are misplaced. Try again.

1. Again, the Drag and Drop Properties for any object controls whether an incorrectly dropped object is accepted or rejected; and whether it automatically returns to its starting point.

2. Triggers are important in initiating actions. It's your job to put various triggers with actions appropriate to what you want to do. For an object involved with D&D, open the Action tab for the object.

Select the Trigger tab, and then the Drag and Drop group of triggers. and check out the 5 available triggers. You have to select a trigger appropriate to your needs.

Before you pass over the Triggers tab, select the Advanced group of triggers. In that group, when working with D&D, I find the Collision Enter and the Collision Leave triggers useful.

Quote:
then be allowed to fix the error himself after getting the feedback "some items are misplaced. Try again.

This area of your requirements can be achieved by using scripting, but it can also be effective using the normal actions.

The secret to success depends on your using appropriate variables. Depending on your needs, you might be able to use the built-in system variables that work with scoring information. More likely, you will need to establish your own variables.

I do not plan on running a tutorial on variables, but here is my appreciation of a methodology.

1. Define a trigger/action combination that involves the scoring activity in which you are interested.

2. Define a variable that records the result of that activity -- e.g. 0. When the result changes, have the variable change its value to 0.

3. With the value of a variable changed, you can now test for the value -- e.g. variable = 0, variable > 0, etc. -- and initiate an action depending on the value of a variable.

You keep changing and resetting variables until you have set up a logical sequence that lets you produce the result you want.

-------------

This is a pretty low-key introduction to using variables to to control conditional actions.

Because of the almost infinite variety of possible outcomes, I believe it would be difficult if not impossible for someone like me to provide you with a blueprint for your put. Hopefully I can point you in a direction that might help. I can't speak for other posters, but I do not provide completely developed pubs, but I will try and point people in a direction that might help.

If you need to ask for more help, you should consider providing us with very detailed information of what it is that you want to do.

BTW -- IMHO, you might have received [edited] more help if you had posted in the Basic Forum, rather than here. Some people are shy about visiting the Advanced Forum :oops:

HTH

PS: In my Opus Guide, I have a chapter dealing with Drag and Drop. If you are interested, you can download it for free. It will remain on my site for a few more days: http://www.jeelan.com.au/transfers/OpusGuide.zip

NOTE: I've tested this link on this post and it works.


Top
   
 
 Post subject:
PostPosted: October 4th, 2007, 12:32 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
If you are interested in going down the scripting route, here is an idea of how this kind of thing can be done.

1 when the page loads, it gets the position of the cow and the cat, so it can return them there if a wrong selection is made.
2 There are two functions in Script2 IsCatInField and IsCowInPub
3 there are actions attached to the button.
4 The drag and drop properties are set up for the Cow, Cat, Pub and Field.

When the user drags the Cat and Cow, then hits the TEST button, the two functions are run and return 'true' or 'false'. Depending on the outcome, a different message is displayed.
The rather convoluted IF's in the button action are required, because I want both functions to run. It's the functions which returns the Cow or Cat if they are in the wrong place.


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

_________________
Whoever designed this, never actually used it!


For this message sandyn has been thanked by : mackavi


Top
 Profile  
 
 Post subject:
PostPosted: October 4th, 2007, 3:50 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
I hope this solve your question

YOu can change the hearts to any pictures of fruits and vegs. Just name your pics as r ,r1,r3,r3 for fruits and y,y1,y2,y3 for vegs and then make them draggable .


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


For this message opuslover has been thanked by : mackavi


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 36 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