Browse Search Popular Register Upload Rules User list Login:
Search:
XRAY script problem

Image:
screenshot of the scene

Author: Physics A

Group: Default

Filesize: 6.06 kB

Date added: 2023-12-26

Rating: 5

Downloads: 328

Views: 146

Comments: 5

Ratings: 1

Times favored: 0

Made with: Algodoo v2.1.0

Tags:

Scene tag

check script of this circle, attraction dont change idk why.
Please log in to rate this scene
edit
Similar scenes
Title: Remote Controlled Car
Rating: 4.5
Filesize: 472.32 kB
Downloads: 710
Comments: 0
Ratings: 2
Date added: 2010/12/24 15:02:40
Made with: Phun
Rating: rated 4.5
download
Title: First Ever Script
Rating: 5
Filesize: 12.3 kB
Downloads: 206
Comments: 2
Ratings: 1
Date added: 2016/11/19 12:40:03
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Help me for Script!
Rating: 5
Filesize: 5.49 kB
Downloads: 553
Comments: 12
Ratings: 1
Date added: 2021/09/29 02:48:43
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Someone help ? Xray ? :D
Rating: 5
Filesize: 50.42 kB
Downloads: 358
Comments: 3
Ratings: 1
Date added: 2016/08/27 21:31:32
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: I Just learned something
Rating: 5
Filesize: 13.18 kB
Downloads: 295
Comments: 1
Ratings: 1
Date added: 2016/11/25 12:55:35
Made with: Algodoo v2.1.0
Rating: rated 5
download
Title: Le entry to ultra's contest
Rating: 5
Filesize: 40.73 kB
Downloads: 308
Comments: 2
Ratings: 1
Date added: 2015/09/05 03:12:35
Made with: Algodoo v2.1.0
Rating: rated 5
download
Actually, the value in attraction DOES change but it doesn't update the displayed value in the list of variables. I know this is weird, but some of the variables in the list update constantly and others only update when you put your cursor on the value and click it!

Try this: Create a local variable by typing this in the text window in the upper-left corner of the circle's script menu: _test = 0
You should see "_test" show up in the variable list. Then add _test to your script in postStep. It should look like this: _test = attraction = math.vec.len(vel)

When you run the simulation and drag the circle around, the value in _test should update constantly, but the value in attraction will not update. Attraction WILL change as it's value changes but you just won't see it change in the variables list.
I often used math.vec.len(vel) in my scenes. except that one day I went into my scenes and the objects I programmed were no longer doing what they were supposed to do
and the single solution i found is to do the pythagore formula.
Yes, exactly! :tup:
By the way, you CAN see the attraction value continuously updating if you view it in the "Material" panel. To get there, right click on the circle, then move your cursor down to "Material". Another panel will open that has the Attraction value continuously displayed as it changes. If the value changes while you move the circle around, then the script is functioning correctly.

I checked your scene just as you coded it and it updates the attraction value as expected. So, I don't know why it may not be working for you.
Last edited at 2023/12/26 23:02:18 by Xray