Author Topic: [Lua] Rope Physics  (Read 15159 times)

0 Members and 1 Guest are viewing this topic.

Offline Alex

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +3/-0
    • View Profile
Re: [Lua] Rope Physics
« Reply #15 on: January 08, 2013, 12:59:09 pm »
Good work. But it's very slow on calc :-(

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [Lua] Rope Physics
« Reply #16 on: January 08, 2013, 01:14:25 pm »
Good work. But it's very slow on calc :-(
I know, that's the sad part about it, you may even call it disturbing/frustrating/horrible/throw-your-calc-out-of-the-window slow... but there's nothing I/we can do about it, I don't think I can really optimise the code

Offline Alex

  • LV2 Member (Next: 40)
  • **
  • Posts: 32
  • Rating: +3/-0
    • View Profile
Re: [Lua] Rope Physics
« Reply #17 on: January 09, 2013, 06:58:49 am »
Ok. But you can use the chipmunks physic program include in OS 3.2 or no?

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: [Lua] Rope Physics
« Reply #18 on: January 09, 2013, 07:11:07 am »
Yes. You put
Code: [Select]
require 'physics' on the top of your script.
« Last Edit: January 09, 2013, 07:11:23 am by ElementCoder »

Some people need a high five in the face... with a chair.
~EC

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [Lua] Rope Physics
« Reply #19 on: January 09, 2013, 07:20:09 am »
Ok. But you can use the chipmunks physic program include in OS 3.2 or no?

Yes. You put
Code: [Select]
require 'physics' on the top of your script.

But this will not work with this script, not at all. You'll have to write your own script for that, I guess you should read this.
« Last Edit: January 09, 2013, 07:20:22 am by Nick »

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: [Lua] Rope Physics
« Reply #20 on: January 09, 2013, 10:47:16 am »
Ok. But you can use the chipmunks physic program include in OS 3.2 or no?

Yes. You put
Code: [Select]
require 'physics' on the top of your script.

But this will not work with this script, not at all. You'll have to write your own script for that, I guess you should read this.
What do you mean will not work?
Code: [Select]
require 'physics'  or require "physics" allows you to use the physics engine. You can even be more specific by putting
Code: [Select]
platform.apilevel = "2.0" at the very top of your script
« Last Edit: January 09, 2013, 10:52:18 am by ElementCoder »

Some people need a high five in the face... with a chair.
~EC

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [Lua] Rope Physics
« Reply #21 on: January 09, 2013, 11:57:33 am »
Did you read my whole sentence? I said this will not work with this script

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [Lua] Rope Physics
« Reply #22 on: January 09, 2013, 05:39:40 pm »
ElementCoder : the fact of writing "require 'physics'" makes the Lua interpreter know you're going to use the Physics Engine API provided in version 3.2, it doesn't mean that it will automagically know you're making physics by yourself and will convert them to Chipmunk's (P.E. base) code. You'd have to rewrite everything in terms of the specific API.
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline ElementCoder

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 611
  • Rating: +42/-2
    • View Profile
Re: [Lua] Rope Physics
« Reply #23 on: January 10, 2013, 01:33:44 pm »
I understand that adriweb. There was a simple misunderstanding between me and Nick which is now solved :) I didn't mean to say "require 'physics'" converts your code to Chipmunk, I thought he meant that putting that above his script made everything crash but it was just that he wrote it for 3.1 and not for 3.2.

Some people need a high five in the face... with a chair.
~EC

Offline Nick

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1166
  • Rating: +161/-3
  • You just got omnom'd
    • View Profile
    • Nick Steen
Re: [Lua] Rope Physics
« Reply #24 on: January 10, 2013, 03:04:34 pm »
I understand that adriweb. There was a simple misunderstanding between me and Nick which is now solved :)
Yeah, we met up last week to hold a little streefight. Sadly enough he won, so I had to crawl to the hospital alone, leaving a trail of mixed blood and spit.
It was hard to see myself that way, but it was worth it. I tried, and that's what matters.
I used to say "There no such thing as trying. You do, or you do not.", but I had to reconsider that, apparently it wasn't completely true.

Until the day I was able to move again, it went through my head. How would I be able to face ElementCoder again? I haven't seen him since, I did not look for him though. One day, I shall regain my powers and revive to my strong and powerful self, leaving all that had happened between us behind, and start over again, with a clean slate.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: [Lua] Rope Physics
« Reply #25 on: January 10, 2013, 04:07:51 pm »
Wat o_O
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline lkj

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 485
  • Rating: +58/-1
    • View Profile
Re: [Lua] Rope Physics
« Reply #26 on: January 10, 2013, 04:35:24 pm »
lol  XD

looking nice btw
« Last Edit: January 10, 2013, 04:35:42 pm by lkj »