Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 12 posts ] 
Author Message
 Post subject: How to identify which object dropped or which is colliding
PostPosted: November 20th, 2007, 8:50 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I think these two situations are related.

First. How can I identify the objects dropped onto a drop zone? ( I'm not asking about the obj33.GetName() part itself)

Said differently, if I add a script to a Dropzone object, I want to get the names of all objects dropped on it. Or, if I use a script with the object being dragged, I want to get the name of the dropzone where it's dropped.

I hope not to have to code every possible 'pair' into somedropzone.IsObjectIntersecting(somedraggableobject)


Which leads to the 'Second' situation. Maybe Collisions and IsObjectIntersecting is a more generalized case for this? Same idea applies.... identify which objects.


I'd hoped it would be 'simple' to do. Now wonder if this is going to be a real task.

[edited] Add link. Here a recent topic with sample Drag/Drop IMP file that could be used as starter for this. viewtopic.php?t=2994

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: November 20th, 2007, 9:14 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
what's wrong with GetName()?

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 20th, 2007, 1:14 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I think I did not ask the right questions.

I've started using GetName() when I know which object I'm looking at. Or know enough to use 'eval'... Nothing 'wrong' with GetName().

I'm assuming a situation where I'll have lots of variability. Many objects, say, to drop. Or collide for that matter. A certain amount of unpredictability maybe. Let me work up a sample Imp in next couple days.

Maybe though I just 'missed' something 'basic' in Opus actions or script? -- for what an "object dropped" trigger (on dropzone) can return as far as information about those objects dropped.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Maybe a simpler question
PostPosted: November 20th, 2007, 1:33 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Mac,

Maybe I can pose the question more simply, at least to get started.

If I have a Drop Zone object and use a Dropped Object Removed All Objects trigger, how would I identify that one removed object in a script?

for example... whichobject.Rotate(100)

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: November 20th, 2007, 2:03 pm 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
OK, I'm probably going to get things muddled here but here goes nothing:

You have a drozone frame with 10 objects dropped onto it. You remove one of the objects and this triggers a script event (IE calls a function) but you want to know which object has been removed to use it in the function?

If thats right then something like this.

create a function:

function rotateObject(name)
{
eval(name+'.Rotate(90)')

}

Add a script action to the trigger on the object, whether drop, click or remove and in the script add:

objectRotate(this.GetName())

Mack


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

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject:
PostPosted: November 21st, 2007, 5:41 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Thanks, Mac. From your outline of the code, that's not quite it.

Your code does help me achieve 2 things. Sets up the trigger and function (passing_obj_name). And cleans it up over what I started playing with.

I will play with your "starter" over next few days. Holiday here. However, I think the original question still begs an answer.

It's about associating the draggables and the dropzones.
Quote:
Or, if I use a script with the object being dragged, I want to get the name of the dropzone where it's dropped.

In the case you set up, I won't know which Dropzone (DZ) has freed-up this object. I want to get at was it DZ-A, DZ-B, DZ-C....

Or the flipside question when I start with focus on the DZ, which Draggable was dropped or removed.

I think it's a curious scripting challenge -- if only in that I was thinking such info would be easily within "arm's reach".

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: November 21st, 2007, 9:19 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Keeping it simple...

Create a page / publication variable for dropping and removing and use the corresponding trigger simply assign the name of the object dropped or zone removed from to its corresponding variable.

This way you'll always have the last object dropped and the last zone removed from.

Use this inconjunction with the setting of properties to have quick access to the current information but also be able to access stored information.

Mack

P.S you may need that pesky wait command to ensure that the variables are updated before trying to execute a script using them.

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: identifying which object dropped
PostPosted: November 26th, 2007, 1:29 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I've taken the suggestion of using page variables. Despite some trial and error, I've either missed it or a solution will require more alchemy.

For purposes here, I'm focusing on 1/2 the situation. Simply track which objects dropped and/or removed from Dropzone viewpoint. (set aside other issue, which dropzone a particular object dropped on from draggable obj view.).

The sample pub illustrates the challenge.

What I am noticing is that actions triggered from Dropzone (drops or removes) LAG behind data captured off of a Dragged/Dropped object trigger.

Let me know if the task is futile. I'll 'drop' this approach. :wink:


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

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: November 28th, 2007, 12:53 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Rather than trying to keep track of where stars are?? why not have a function which just checks where they are when you need to know---possibly a ticker??

Still use drag and drop, but have a function which checks where a star is. If the drop zones are static you can test to see if the star is in a drop zone. Flush the function through Create a matrix of possible combinations and store it as an array??, but I'm not sure what the aim of the application is.

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: November 28th, 2007, 12:54 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
Rather than trying to keep track of where stars are?? why not have a function which just checks where they are when you need to know---possibly a ticker??

Still use drag and drop, but have a function which checks where a star is. If the drop zones are static you can test to see if the star is in a drop zone. Flush the function through Create a matrix of possible combinations and store it as an array??, but I'm not sure what the aim of the application is.

Sandy

sorry---am I repeating myself?? :-) how did I do that????

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: December 1st, 2007, 8:50 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Sandyn,

I've been away a bit... computer surgery.

I'll take a look at your suggestions in next few days.

As for my purposes. One layout I want to create is have users input ideas into ~8 text boxes. Then I'll have them drag and drop labels for each text-input to start arranging and prioritizing. There's more involved, so I wanted to set-up this "tracking" to then generate a set of action steps which varies depending on their input.

I was thinking the drag and drop with make it 'visual' for them.

Part of it is I am just trying to learn what Opus is capable of. And I did not want to have to anticipate/code all possible combinations and permutations in advance.

Back later.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: December 3rd, 2007, 7:41 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
sandyn wrote:
Quote:
why not have a function which just checks where they are when you need to know---possibly a ticker?? ..... Flush the function through Create a matrix of possible combinations.....


I guess I have some things to 'try'. That above. Or maybe keep track of stars' coordinates along-the-way, and run a check against dropzone locations at the end. I'm still learning arrays and will have to invent some tricks to populate these states and locations.

Hope to get this 'reduced' or 'abstracted' so it's easy to reuse. Back in awhile.

_________________
_good things come to those who wait(0)_


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 28 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:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group