Skip to main content

News

Topic: Error with tutorial (Read 1390 times) previous topic - next topic

Error with tutorial
I used all the scripts from this tutorial http://wiki.spheredev.org/Making_a_Menu and im having problems trying to open the menu, when i press the key escape it says that the name variable is not defined!
here, have a look

i leave my scripts over here so you can tell me if theres anything wrong. i don't know anything about programming just a very little tiny bit.
https://mega.co.nz/#!DdtjyYYa!T5DDQ079O2ag8ZRGbtp_ihQDT4ZH1KlForu2FjNkXbo

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: Error with tutorial
Reply #1
Just a note for the future: you can add attachments to your post in the full reply mode! Should save some trouble of having to go through Mega.

Also, why are they in txt file? Did you copy-paste over the content into a different text editor? There's no need for that - all your project files exist in Sphere/games/YourGameName/scripts/ so you can just directly zip that up! And even better: since the contents of your scripts are so short, you can use the [ code ] tag and paste them right into your posts. :)


Now, about your problem, I think it's here:

Code: [Select]
Menu.prototype.addItem(name, description, callback, color)


This calls addItem rather than defining addItem as a function, so it should be this:

Code: [Select]
Menu.prototype.addItem = function(name, description, callback, color)


So yeah, it's a mistake in the tutorial! Will edit that (even though it's not my tutorial).
  • Last Edit: November 02, 2013, 05:37:03 am by DaVince