Added a new code? Closed the game? Now it won't open due to an error??? (A note for new users)

That's what just happened to me, and I thought I might share to save anyone else from going slightly insane over it.

Just open the .aslx file with a text editor, find the code you just added, delete it (or CUT it, or something - just remove it somehow), then open Quest again. It should load right back up.


this is more of an issue (more inconvenience/steps/work) for online users, as they got to publish and then download (and unzip if it's a 'xxx.quest' file to get at its 'xxx.aslx' files ---- it's not much of a big secret, anyone can see your game's code as quest is open software (unlike professional games and their private software/engine to make their game), in order to fix it up its code.

with any 'xxx.aslx' (quest) file (game file or library file), you can open up into the code by simply right clicking on the file and choosing to open the file with any text editor software: notepad, wordpad, Apple: text editor, notepad++ (high recommend this text editor), etc etc etc. If you can still/already get into the GUI/Editor, you can also click on the note-paper-like button at the menu bar at the top of the screen, between the 'play' and 'help' menu bar buttons/options, as this is a toggle between GUI/Editor view mode and 'Code View' mode (entire game code). When you're adding scripts (run as script -> add new script) in the GUI/Editor, in its scripting window in the middle of the screen, it also has the note-paper like button too, but this is to just see (and if need, edit too) the individual code chunk of this small part of your game (it's NOT your entire game code).

if you can't get into the GUI/Editor (your game file doesn't compile), then there's ONLY the method of right clicking on your game file, and opening it with a text editor software, to get into your game code, so you can then fix up your game's code, so it works (compiles) and you can get back into the GUI/Editor and/or play your game again.

when programming there's different aspects of code (or via through using the GUI/Editor if not coding directly) errors:

  1. 'compiling errors' are errors can prevent the compiling of the game (there's wrong code/syntax/etc that prevents the game code/content from being even able to be read: imagine a baby trying to write a book, it would just be garbled/scribbly non-sense, compared to typos on some of the pages' various sentences of the book) into the GUI/Editor (which includes not being able to play the game)
  2. individual 'logic and/or syntax errors' that don't interfere with compiling, are errors that don't prevent the compiling of the game into the GUI/Editor and with playing the game, however, they will cause that stuff to not work when playing the game (oops I messed up scripting that effects some game mechanic, action/event, feature, but it doesn't prevent the game from compiling, I still can open the game in the GUI/Editor and still play the game). You can play most of your game, but some, parts or stuff, of your game will have bugs/not-work/not-work-properly.
  3. same as above, but it breaks the game, it will compile and you can get into the GUI/Editor and successfully get it to open into the playing the game, but you can't actually play your game, as the errors break the entire game from working as you want it to (for example, you could be stuck in the intro or character creation at the start of your game, unable to progress past it, due to your messed up scripting of it. Or, another example, every main aspect of your game is broken, nothing works in your game, lol).
  4. 'crashes/freezing' (can fall under all of the above) are memory errors: usually you just messed up and have an infinite loop (resources are finite, infinite loops are not: your computer/quest runs out of memory and crashes, as it has to store that information involved with/for the looping, and infinitely storing information, exceeds the finite amount of space/memory/resources of a computer). Most/all crashes from software and/or the OS now are contained, so it doesn't destroy your computer (this wasn't the case with the first/early/original computers). That said, infinite loops are still bad (but not harmful), you must fix them, or else your quest game will continue to crash. The worst causes of crashes are 'memory leaks' and/or 'dangling pointers', though as I said usually (most/all) the OS and/or software protects by containing and cleans-up/repairs/restores the lost memory from actually being lost to the computer itself which would destroy your computer.

an example of an infinite loop:

<game name="infinite_loop_example">
  <attr name="start" type="script">
    infinite_loop_hi_function
  </attr>
</game>

<function name="infinite_loop_hi_function">
  msg ("hi")
  infinite_loop_hi_function
</function>

as you can hopefully see, there's no way to get out of (to end/escape from) the function, it just keeps outputting 'hi' to the screen (processors are extremely fast, it'll crash quest before you can blink).


never fear errors, as this is the majority of your time programming, even of professional programmers, welcome to programming, lol: trouble-shooting your code of errors you made, laughs. It's just a matter of finding/identifying them, and then fixing them up.

Coding/programming teaches you to be an excellent proof-reader: a super 'grammer/typo/spelling nazi', as you have to be 100% perfect, without ANY mistakes for the code to work.

(90% of the time, it's a single stupid small typo too... and not a total failure of the design/logic of the entire part of code at issue or the program itself: the entire code, people are much smarter than they realize when they code, even those who're just starting to code)


Boom!

Look at all that helpful information!

(Sadly, I experienced all of those errors, barring the infinite loop, in my first week using Quest (which was last week). I have Windows though, so I just opened my this_game_wont_event_open_in_the_editor.aslx file up with Notepad ++ (which HK made me aware of (thank you kindly, it's easier on my PC than Geany), and BAM! The editor had no more qualms.

So, then I entered:

>GET DOWN
You do a little dance.


90% of the time, it's a single stupid small typo too...

Yep! Forgot to close out my IF...THEN...


(I didn't mention this, as didn't know you'd download and use it at the time, better late then never, I guess)

for notepad++

in its (you got notepad++ opened up) menu bar at the top, is the 'language' option/category, which has most of the main programming languages out there (it'll color-code the code for you, making it easier to read, write, and/or troubleshoot). For quest, using 'xml' works well, I've not noticed any discrepencies with using 'xml' as the language for viewing quest code in notepad++ (notepad++ ---> under its 'languages' menu option ---> choose 'XML')

(also, notepad++, has a ton of super useful editing tools/options/controls... that I myself need to still learn, laughs... would save me a ton of time, then doing the editing of code stuff individually/manually myself)


Aha!

>USE NOTEPAD PP
You are in NOTEPAD PP.
You can see the MENU here.
>


finally, found the posting restriction... argh...

using 'net' url domain is blocked by this site....


also, just for more information for who-ever new to this coding stuff:

some information about the difference between:

text editors
VS
IDEs/SDKs/Engines/Kits

(these are all roughly/generally the same thing):
(remove the dot/period in the ht.tps for it to work in url)
(IDE: ht.tps://en.wikipedia.org/wiki/Integrated_development_environment)
(SDK: ht.tps://en.wikipedia.org/wiki/Software_development_kit)
(Engines and Kits are roughly the same thing)

(ht.tps://stackoverflow.com/questions/8772746/difference-between-framework-vs-library-vs-ide-vs-api-vs-sdk-vs-toolkits)
(ht.tps://stackoverflow.com/questions/3196986/difference-between-sdk-and-ide)

text editors just help you read, write, and troubleshoot code. You can't run/test your code/program, and thus they also have no debugging capabilities as well.

whereas, IDEs/SDKs/Engines/Kits, not only often have the same code syntax color-coding as text editors, but are also able to actually compile, link, translate, debugging capabiities, and able to run/test your code/program. Though, some of them are specific to a single language, but some can do multiple languages too.


also if you want to learn to code:

ht.tps://www.codecademy.com/ (you do have to register, but it's free)
ht.tps://www.w3schools.com/default.asp (web programming languages: html, css, xml, JS: JavaScript, SQL: advanced coding of database management, etc)

"the big three"main (non-web) programming languages:

  1. C++ (C Plus Plus):

ht.tp://www.cplusplus.com/
ht.tps://www.tutorialspoint.com/cplusplus/

  1. Java (do NOT confuse with JS: JavaScript):

ht.tps://docs.oracle.com/javase/tutorial/

  1. Python:

ht.tps://www.python.org/


C++ and java are more popular in the US and Python is more popular in Europe (and python was used for Civ4, a game that I really enjoy, along with especially an amazing fan-made mod for it: FFH2: Fall From Heaven 2: ht.tps://forums.civfanatics.com/threads/mod-fall-from-heaven-ii.171398/)

and also about 'C++' vs 'Java':

ht.tps://en.wikipedia.org/wiki/Comparison_of_Java_and_C%2B%2B


ask if you got any questions and/or need help with anything...


Hey... I didn't know Java and JS were two different languages. (That explains my lack of good search results!)

Codecademy dot com is pretty cool, but I get farther faster at w3schools dot com.

Also, and I only ask to become familiar with procedure (or would the proper euphemism be 'protocol'?), why the ht.tps?


I think it's something with spiders/crawlers and such can pick up either the site, your account on the site, and/or your computer , and then send advertising/adware/etc to the site, your account on site, and/or to your computer... usually I'm lazy, but I'm trying change by not having active links via using the dot/period to make the url invalid. And//or it can cause slow down for either the site you're linking too and/or that your posting the link to. But, I don't really understand too much about this type of stuff though.

Hopefully someone else can explain why not to have active links, for both of our understanding, lol.


more about Java vs JS (JavaScript):

Java is a full-born (non-web) programming language (it takes a full 1-2 school symester classes to learn just the basics of a programming language like C++, Java, and/or Python. Full-born languages have so much features/functionality, that it takes a lot of studying and experience/practice, even many many many years, to be an true expert at them: you specialize in one of them as it's like a degree, that amount of stuff for you to learn/know about it, makes it very hard to be an expert at multiple full-born languages), whereas JS (JavaScript) is merely a scripting language (it's a web language too, like html, css, XML, JSON, SQL, etc, and thus is not a non-web language, like Java, C++, Python, and etc).

I've not yet learned JS, something I need to do, as it let's you do actions with web sites and is used by quest to do the same, to do fancy customized stuff that quest can't do (along with html and css).


How about doing this to post an inactive link?

ht
tp://textadventures.co.uk/forum/quest/topic/kugkjb1ufkucrbdmmqkziq/added-a-new-code-closed-the-game-now-it-wont-open-due-to-an-error-a-note-f

You can still copy and paste it, but it isn't clickable. (Although it's probably more confusing to people.)

Does that accomplish the same thing as ht.tp?


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums