Author Topic: ti-nspire student software acting up PLEASE HELP!  (Read 5011 times)

0 Members and 1 Guest are viewing this topic.

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
ti-nspire student software acting up PLEASE HELP!
« on: September 02, 2012, 05:59:12 pm »
My nspire software wont load my program im trying it on the emulator in it and if I drag and drop the program on to the emulator it freezes and so does windows explorer. I try loading it from file>open it still crashes nspire software! HELP
« Last Edit: September 02, 2012, 11:59:23 pm by annoyingcalc »
This used to contain a signature.

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: ti-nspire student software acting up
« Reply #1 on: September 02, 2012, 08:07:41 pm »
*bump* Id like help! I cant test my programs untill this is fixed!
« Last Edit: September 02, 2012, 08:08:22 pm by annoyingcalc »
This used to contain a signature.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: ti-nspire student software acting up
« Reply #2 on: September 02, 2012, 08:28:09 pm »
Are those programs written in Lua/BASIC? Because if they're Ndless files (or Lua for an outdated Student Software version), then that might be why. (The software doesn't run Ndless files and even Lua programs will have troubles running sometimes, such as Nyan Cat)

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: ti-nspire student software acting up
« Reply #3 on: September 02, 2012, 08:36:36 pm »
I am using lua for 3.1 with a 3.1 student software
This used to contain a signature.

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: ti-nspire student software acting up
« Reply #4 on: September 02, 2012, 11:52:12 pm »
im posting the .lua file to see if anyone else has this problem
This used to contain a signature.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: ti-nspire student software acting up PLEASE HELP!
« Reply #5 on: September 03, 2012, 05:21:43 am »
Oh wow, do NOT ever do image stuff in a loop, that's what causing your issue ;-)

Here's how you want to do it :
(after the 2 lines of images strings)

Code: [Select]
dx=50
dy=50

function on.paint(gc)
gc:drawImage(background,0,0)
gc:drawImage(duck,dx,dy)
end

function on.arrowKey(arrow)
if arrow == "right" then
dx = dx + 5
elseif arrow == "left" then
dx = dx - 5
elseif arrow == "up" then
dy = dy - 5
elseif arrow == "down" then
dy = dy + 5
end
platform.window:invalidate()
end

I suggest that you read Inspired-Lua's tutorials and Steve Arnold's :)
They really well explain the basic concept of events, the base thing you need to understand first :)

Also, to have a full reference of the Nspire-Lua API, don't forget Inspired-Lua's wiki (based on (and improving) the official doc)

BTW, Levak and I have created a presentation some weeks ago : "Improving your Nspire-Lua skills" you would be interested in : http://tiplanet.org/forum/archives_voir.php?id=6720 (clic on "Télécharger") - you might prefer the powerpoint version)
« Last Edit: September 03, 2012, 05:57:22 am by adriweb »
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: ti-nspire student software acting up PLEASE HELP!
« Reply #6 on: September 03, 2012, 12:10:18 pm »
Wow! Thanks adriweb,but I want it to be an ai not the character im making duck hunt!
« Last Edit: September 03, 2012, 12:19:18 pm by annoyingcalc »
This used to contain a signature.

Offline someone

  • LV3 Member (Next: 100)
  • ***
  • Posts: 49
  • Rating: +9/-0
    • View Profile
Re: ti-nspire student software acting up PLEASE HELP!
« Reply #7 on: September 03, 2012, 07:29:57 pm »
Then, instead of using the function on.arrowKey(arrow), create one where you calculate the move, e.g:

Code: [Select]
function AI()
    --place your Artificial Intelligence code here

    --if direction==1 then
    --dx=dx-1
    --dy=dy-1
    --else
    --dx=dx+1
    --dy=dy+1
    --end
    --if dx==0 then
    --direction=1
    --end
    --if dy==240 then
    --direction=0
    --end
end

BTW, I see that you use an image from the NES & since the resolution is smaller, it will look awkward, so I would suggest to draw the rest of the background, this code would do:

Code: [Select]
function on.resize(width, height)
    ww = width
    wh = height
end

function on.paint(gc)
    -- Paint background (sky)
    gc:setColorRGB(96, 176, 248)
    gc:fillRect(0, 0, ww, wh)
   
    -- Paint floor (dirt)
    gc:setColorRGB(104, 104, 0)
    gc:fillRect(0, 175, ww, wh-175)
   
    gc:drawImage(background,0,0)
    gc:drawImage(duck,dx,dy)
    AI()
end

Maybe you'll want to place drawing the duck image inside the AI() function, because if you're going to move the image a lot, it will look like it warps. So, you'll need to add the parameter "gc"

Code: [Select]
function on.paint(gc)
    ...
    AI(gc)
end

function AI(gc)
    gc:drawImage(duck,dx,dy)
end

Offline annoyingcalc

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1953
  • Rating: +140/-72
  • Found in Eclipse.exe
    • View Profile
Re: ti-nspire student software acting up PLEASE HELP!
« Reply #8 on: September 03, 2012, 07:36:02 pm »
Well, yes thats what im planning on doing with the background well it was >2,500 kb and I edited it wrongly.
This used to contain a signature.

Offline Adriweb

  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1708
  • Rating: +229/-17
    • View Profile
    • TI-Planet.org
Re: ti-nspire student software acting up PLEASE HELP!
« Reply #9 on: September 04, 2012, 11:59:11 am »
Yeah try not to use > 15k :/
My calculator programs
TI-Planet.org co-admin.
TI-Nspire Lua programming : Tutorials  |  API Documentation