lots of errors in both important tutorials

About Monkey 2 Forums Monkey 2 Programming Help lots of errors in both important tutorials

This topic contains 17 replies, has 8 voices, and was last updated by  medi 1 year, 9 months ago.

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • #9171

    medi
    Participant

    I get error in all parts of Spacecraft Tutorial (13 parts) except the first part. I also get error in many examples in Monkey2 Examples at Github.

    I used Monkey2-v1.1.05 in Windows 8.1.

    There is no tutorial for using file io, which is very important. The Spacecraft shows the way to work with json, but codes do not compile. Many import parts of the help and documentation  are empty.

    I randomly picked some games from banana and found that all compile and run well. But learning from samples is not the right way. I learned BlitzMAX from two important tutorials: 1 – Object-Oriented Programming in BlitzMAX, Judnich, 2 – Begining Guide to BlitzMAX, Wave.

    #9178

    Ethernaut
    Participant

    Hi,

    Which tutorial are you talking about? Can you post a link?
    These cover a lot of ground: http://monkeycoder.co.nz/forums/topic/monkey-2-examples-github/

    Are you sure your installation is working properly? What are the errors you’re getting? I can compile the examples without issues here.

    #9187

    medi
    Participant

    Hi Ethernaut,

    I used the binary version of Monkey2-v1.1.05.

    Picking two examples: CivClone01 and Beginners – Proceed, I get this error:

    ***** Fatal mx2cc error *****
    Internal mx2cc build error

    About this:

    https://github.com/peterigz/Monkey2Tutorials

    My bad, I should install the two modules. However, since my intention was to test menkey2’s core, I totally ignored the fact that that tutorial need related modules being installed.

    What else is needed to be done, after binary installation, to make “Beginners – Proceed” to work?

    #9188

    peterigz
    Participant

    I should update the readme and mention about installing the requisite modules. I still plan to do you tube vids of that tutorial I’m just finishing a lot of daytime work at the moment.

    #9189

    medi
    Participant

    @peterigz, I appreciate your work on providing the SpeceCraft tutorial. The monkey2-exmples-github is a great idea, but I need to examine the core parts, especially: io, json, xml. I just tried to avoid Java. I will take a look at Python on Sunday. I think it is better for me to be back for Monkey2 around Christmas time; Monkey2 train is still faster than the passengers 😉

    #9191

    Pakz
    Participant

    I noticed that the latest monkey2 release introduced a new error. This is when you use methods in a class and using no class variables(I think) It needs you to change the reported methods to functions. This was with the civ clone. But on the 1.1.05 it should work. Internal error maybe means the compiler is not set up right?

    #9205

    Mark Sibly
    Keymaster

    This is when you use methods in a class and using no class variables(I think) It needs you to change the reported methods to functions.

    Can you post an example of this?

    #9207

    Pakz
    Participant

    The error message was : “Attempt to invoke method on null instance”

    It gets triggered when the game is run, not catched while compiling.

     

    I am uncommenting more and more of the code to trap the error. Could take a while.

    #9209

    Mark Sibly
    Keymaster

    >  “Attempt to invoke method on null instance”

    Ah yes, this is new to 1.1.05. It used to be you could invoke a (non-virtual) method on a ‘null’ object, but this is now caught by the debugger at runtime, eg:

    This *used* to be allowed in monkey2, but in 1.1.05 and later you will get the above error.

    The debugger *should* show you where it’s happening?

    #9211

    Pakz
    Participant

    I have this code here that works in the previous monkey2 version and not with the latest.

     

    edit : aww just posted when I saw the new reply:)

    edit: It does show where the error was triggered. But I had a hard time figuring out what the message ment at first:)

    #9279

    medi
    Participant

    I am back. Python not good. Dynamically typed languages not good for me. I am going to try Monkey2 for a while.

    #9290

    TomToad
    Participant

    I never understood the value in dynamic types.  Seems that it is unproductive to save a few seconds of typing int, float, etc.. when the result is hours of debugging headaches when you type myNum = 3 instead of myNum = 3.0

    As for null objects, it makes sense that you should create an instance with new controls before calling fortifyunit() method.  Without an instance, there is no fortifyunit() to call, only a definition.

    #9292

    Pakz
    Participant

    Oh, I think I understand now. I must have forgotten to use the New command. I now know that null objects mean with TomToads explanation 🙂 The code above now works when I added the New part behind the global.

    #9297

    Diffrenzy
    Keymaster

    Ah yes, this is new to 1.1.05. It used to be you could invoke a (non-virtual) method on a ‘null’ object, but this is now caught by the debugger at runtime, eg:

    I’m really happy to see this change, beacuse I understood -1 of the old debugger behaviour.

    In debug mode, I’m now shown the origin of the null error GREAT, but in release mode I still see the “Here!” printed to the console.

    Surely that can’t be correct: – I’m expecting the app to crash  before that… ?

    #9298

    medi
    Participant

    I cannot find any reference to conditional expressions in docs. Is it hidden somewhere in there?

Viewing 15 posts - 1 through 15 (of 18 total)

You must be logged in to reply to this topic.