Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Rene's project consulting

  1. #1
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,527
    Rep Power
    170

    Rene's project consulting

    Don't know why, but my script runs without any errors and if I end it, I receive this message:


    means the method "read" could not be done somewhere in memory.
    The numbers vary, so they won't tell anything in detail. thinAir keeps running, even if I click on OK.

    Problem is, if I restart my script thereafter, it starts tossing Errors randomly or it stops running the program without any message.
    This behavior goes on, until I reboot the computer. Then my program runs once till I end it, this message appears again and thereafter the whole procedure repeats.
    First I thought it would be too many if/select-case-clauses inside for-next loop, commented them out or took 'em all out. Now I've read in this forum that their might be something with parenthesis. So - would it be better not to use parenthesis for calling subs & functions and to use them just for math-reasons?

    My program is totally undone, but already a few dozen kB long, loads loads of external resources like images & sounds, I've used your code from above (#includes "unit_Sound3d.tBasicU" etc.), thereafter uses "UI", "FILE", "TBGL".

    I'm doing just sprites, use *.bmp-Format and it has something to do with them sprites. If I run my code without drawing them nothing strange happens.
    Maybe I'll get the code stripped down later today to localize the reason and quarantine it.
    But its so much effort to always reboot. Just restarting thinAir does not help.

    Another thing is a missing function to TBGL_Sprite...: Exists.
    There should be something like

    if TBGL_SpriteExists(SpriteNum) then
    ' it can draw the sprite
    else
    ' if I tell to draw a sprite that does not exist, it crashes
    ' it could also give an error-message like "invalid sprite-call"
    endif
    Last edited by ReneMiner; 25-10-2012 at 13:41.

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Renne,

    I developed the TBGL_SpriteExists for you, you can download new TBGL with updated help file here:
    Latest TBGL (it will be added to next ThinBASIC release)

    Regarding the crashes - I am not sure what could be the case. Do you think you could upload somewhere test script which crashes, so we could test it?
    Using parenthesis should be okay


    Petr
    Last edited by Petr Schreiber; 25-10-2012 at 14:11.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  3. #3
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,527
    Rep Power
    170
    Sprite-Exists- already built-in? That's pretty fast- wow!
    I'm still stripping the code down, to isolate the problem. But it'll still need a few hours, cause I always have to reboot for every test. I'm down to 19 kB already. If it's 5 or less left I will send it.

    EDIT: Strange... You just added SpriteExists to TBGL or something more?

    I downloaded it, put it in the tb-folder, rebootet and it does not do it any more! The effect is gone! I did not change my script!
    I just was up to add some comments in front of my script before I rebooted, where I discovered the line

    %Sound3D_WantTBGL = 0 and I thought, this could be the reason and I wanted to change it right now, this attempt. But I started it first, and now there's no more message, even if I draw sprites.

    Edit2:

    The TBGL_SpriteExists does not show up in bold letters if I type it (but it's documented in Help-File).

    I guess it has something to do with type of variables. Now I try to change all my constants to long. Does it work like

    Begin Const
    %Mode_Menu = 1 as Long
    %Mode_Play
    %Mode_Options
    end Const
    to make all long-types? Or is %Mode_Play and %Mode_Options still variant-type then?
    Last edited by ReneMiner; 25-10-2012 at 17:00.

  4. #4
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,527
    Rep Power
    170

    It has happened again!

    I uploaded all the stuff together http://www.filefactory.com/file/35vx.../tBProblem_zip (just scroll down use slow download)

    It does not happen always at the first try now, but if it has happened there's just a reboot.
    Keys to press

    F3 to switch to editor-mode
    esc to leave Editor-Mode + end program from Menu-Mode
    if you comment line 468 out it does not happen since there are no sprites to draw. But their numbers & posiitions are OK, as you can see - it works.
    but after ending the program it's all messed up. (just try a second run to see it)

    line 475 to 481 are comented out. If you remove the comment-signs it crashes instantly with strange, (wrong) Error-Descriptions

    another problem I have within the lines 578 to 595 (maybe I've overseen something)
    it should display the number of the currently pointed-at-sprite-number in title-bar as it does for game-area(the dark rectangle)
    but it does not go into the if!


    It's that long because of the media. By accident the sprites are double in there (the tga's I've changed to bmp's since TBGL didn't like my tga's format)
    Script itself has just 18855 Bytes.

    if you want to see the finished program that I want to port to tB you might play here: http://www.filefactory.com/file/45pd...er-Unlocker_7z), I'm gonna reboot in the meantime...
    Last edited by ReneMiner; 25-10-2012 at 19:48.

  5. #5
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Rene,

    I am just leaving work, so briefly:
    • to make TBGL_SpriteExists colored, thinAIR needs to know it has been added . To do so, please run:
      \thinBasic\thinAir\Syntax\thinBasic\thinBasic.CreateSyntaxIni.tBasic and restart ThinAIR
    • I add things to TBGL from time to time, I cover the new features with article once ThinBASIC release is out.
    • The %constants are Long by default


    Once I reach home, I will download your files and see, where the problem could be


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi Rene,

    I sent you private message with something to test .


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  7. #7
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,527
    Rep Power
    170
    Strange... I edited a little bit on my file, rebooted now and started the "old" *.tBasic- file from the folder that I've uploaded. (Not from thinAir-IDE) and it run. Ended without an Error...
    Now I've tried the same from thinAir-IDE and now it even displays the tile that the pointer's at. I don't get it. Now my in the meantime changed file( http://www.filefactory.com/file/6k7g...locker2_tbasic ) shows that message (see very first post) but the old one (that I've already uploaded) does not... it all goes crazy. The only things that are changed is 3 lines (in new file 629, 631, 633) that shall prevent from starting if sprites-images are not complete and I took UDT aTexturelist out. Now the old one runs (after I started it first since Reboot from Explorer) the new one (started first from IDE) crashes. There are just five or six lines different in total.

    THIS WAS BEFORE I'VE READ PM (got it while typing this!)
    Last edited by ReneMiner; 25-10-2012 at 20:50.

  8. #8
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,527
    Rep Power
    170
    After following your instructions that you've send by PM, I proudly announce the first run from IDE successful ended with no crash. Even the unstripped version with ~150 kB runs now perfectly (last uploaded it was a typo: used & instead of %). Now I can continue

  9. #9
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    The uploaded file has a little issue it seems, on line 747:
    For lZ = &snd_Disappear To %Snd_Beep
    should be:
    For lZ = %snd_Disappear To %Snd_Beep
    After the fix it works okay for me. Sometimes the strange things can happen due to antivirus software, do you use some?


    Petr

    P.S. Little tip - you can attach files to posts. When editing post, click Manage attachements and you can upload files, like *.tBasic or *.zip

    EDIT: I didn't see your previous posts at the time of writing this
    Last edited by Petr Schreiber; 25-10-2012 at 20:51.
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #10
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,527
    Rep Power
    170
    Yes, of course I use antivirus-software. And uploading files or images I've overseen. I tried to add an image above the type-in-field, where you can click bold,italics, add image etc. but it just takes URL, not upload. So I thought this would be the way.

    But something else about sprites: Set/GetLayer. I thought that should order the sequential arrangement of drawing. So sprites on low-number layer get drawn first, high number layer later. But it does not seem to affect this order. Is there some Z-Order-method or do I have to draw them separately the order I want them and not using SpritesDrawAll
    Last edited by ReneMiner; 25-10-2012 at 21:00.

Page 1 of 3 123 LastLast

Similar Threads

  1. funBasic project :)
    By Lionheart008 in forum funBasic
    Replies: 4
    Last Post: 15-07-2014, 08:10
  2. AdamEvaBasic Project :)
    By Lionheart008 in forum 3rd party tools
    Replies: 13
    Last Post: 21-09-2010, 15:25
  3. Project Status?
    By kryton9 in forum CM contest 2009
    Replies: 4
    Last Post: 21-10-2008, 22:42
  4. Project Name
    By Michael Clease in forum CM contest 2009
    Replies: 9
    Last Post: 16-10-2008, 12:22
  5. Project 10^100
    By ErosOlmi in forum General
    Replies: 1
    Last Post: 26-09-2008, 03:05

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •