Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Reply
 
Thread Tools Display Modes
Using Coordinates
Old
shodai
Member
 
Status: Offline
Posts: 27
Join Date: Nov 2010
Default Using Coordinates - 05-15-2012, 04:32 PM

I was wondering how I could obtain the x,y coordinates of an object while the program is running and then use those coordinates to make calculations?
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 05-15-2012, 06:15 PM

You can't.

But you can use a dummy object placed at the top-left corner of the camera's viewpoint to fake it by getting the world object's distance below and distance to the right of the dummy object.

I used something like that in the twin-stick shooter world I posted a few days ago.


(')>
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 05-15-2012, 06:39 PM

Quote:
Originally Posted by x2495iiii View Post
You can't.

But you can use a dummy object placed at the top-left corner of the camera's viewpoint to fake it by getting the world object's distance below and distance to the right of the dummy object.

I used something like that in the twin-stick shooter world I posted a few days ago.
Yes you can.

- Create a new position variable.
- Set the value of the variable to the object's function "object's position"
- Set asSeenBy to world
- You can now set number variables by dragging the position variable in as the value and selection an option from the popup menu (such as "position's distance up", which is the y value).



█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Old
shodai
Member
 
Status: Offline
Posts: 27
Join Date: Nov 2010
Default 05-15-2012, 07:41 PM

Quote:
Originally Posted by arty-fishL View Post
Yes you can.

- Create a new position variable.
- Set the value of the variable to the object's function "object's position"
- Set asSeenBy to world
- You can now set number variables by dragging the position variable in as the value and selection an option from the popup menu (such as "position's distance up", which is the y value).

That looks interesting, but where did you find those functions??
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 05-15-2012, 08:22 PM

Quote:
Originally Posted by arty-fishL View Post
Yes you can.

- Create a new position variable.
- Set the value of the variable to the object's function "object's position"
- Set asSeenBy to world
- You can now set number variables by dragging the position variable in as the value and selection an option from the popup menu (such as "position's distance up", which is the y value).

That's news to me. Never thought the position function did anything until now. Thanks arty!


(')>
   
Reply With Quote
Old
arty-fishL
Senior Member
 
arty-fishL's Avatar
 
Status: Offline
Posts: 1,878
Join Date: Mar 2008
Location: In the corner of your eye
Default 05-16-2012, 09:18 AM

Quote:
Originally Posted by shodai View Post
That looks interesting, but where did you find those functions??
Quote:
Originally Posted by x2495iiii View Post
That's news to me. Never thought the position function did anything until now. Thanks arty!
I only found out about it recently too. You're welcome.


█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█
█░░▓░░░░░░░▓░░░░░░░░░░░▓▓░░▓░░░░░░▓░░░▓░░░░█
█░▓░▓░▓▓▓░▓▓▓░▓░▓░░░░░░▓▒▒░░▒░░▓▓░▓▓▓░▓▒░░░█
█░▓▓▓▒▓▒▒▒░▓▒▒▓▓▓▒▓▓▓░▓▓▓░░▓░░░▓▒▒▓▒▓▒▓▒░░░█
█░▓▒▓▒▓▒░░░▓▓░░▒▓▒░▒▒▒░▓▒▒░▓▓░▓▓▒░▓▒▓▒▓▒░░░█
█░▓▒▓▒░▒░░░░▒▒▓▓▓▒░░░░▓▓▒░░░▒▒░▒▒░░▒░▒▓▓▓░░█
█░░▒░▒░░░░░░░░░▒▒▒░░░░░▒▒░░░░░░░░░░░░░░▒▒▒░█
█░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█

I have mostly moved on from Alice, but may still respond to messages if important [-]
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2020, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.