Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - spathi

Pages: 1 2 3 [4]
Blitz / Re: File Creation Issue
« on: December 20, 2011 »
Does beer help?  I don't go near alcohol.  Maybe I should start.  Caffeine has sort of a magic zone that you can get into but it's sort of a narrow one and sometimes it just doesn't work and ends up making you feel all weirded out and jittery, and unable to debug code until the sensation wears off.

Cannabis gives me all sorts of amazing ideas but takes away all my motivation to program.

LSD?  Never tried coding on that but I bet it would be interesting... maybe I will start putting out some feelers.

Blitz / Re: File Creation Issue
« on: December 20, 2011 »
That must be it.  I should have tried truncating it, I had a vague idea of what the problem was.  Thanks!  Now I find that the Blitz gui is free... maybe I will experiment with that instead of continuing to try to roll my own, but I have certainly learned a lot about it.

This is a sort of illustration of the double edged cognitive sword of caffeine.  Caffeine giveth but caffeine also taketh away.

Blitz / Re: File Creation Issue
« on: December 17, 2011 »
The issue is something with my user input routine-- I don't see why my input would produce a string that is indistinguishable from a hard-coded filename, and why it will work if I cut it and paste it into a hardcoded call eg. writegrid ("pastedtexthere")  This makes me think it's something to do with string termination.

But whatever, I just used input a$.  It's ghetto but it's just an editor for me so it doesn't matter that it shows up on the console and not in the GUI.

I first typed the character string "input a$," or rather "INPUT A$," almost exactly 32 years ago today.

Blitz / File Creation Issue
« on: December 13, 2011 »
I'm running into a bug that I ran into before on Blitz.

It will not open a file for write if I do so based on user input using this code:

Code: [Select]
If tempchar>0 inputtext=inputtext+Chr(tempchar)


DOES NOT WORK: Local out:TStream=WriteStream(savedialog.typedtext) (this is just a string!)
WORKS:                   Local out:TStream=WriteStream("bluedemon")
CloseStream (out)


Is there something going on with newlines or something that I'm not aware of?  Is using KEY_ENTER to exit the loop stripping a newline off of the end of the file that should be there?

It doesn't error or anything, it just doesn't create any file.  The other file creation method using CreateFile does not work either which leads me to believe that it must be some sort of bug in my user input code that I am not aware of...

Since I know some people like screenshots, here is the titular blue demon:

This is for a voxel dungeonshooter/roguelike I am working on called Dungeonslayers.  The whole gui toolkit is written by me-- it doesn't look like much but it has control arrays, sliders, and radio buttons.

Blitz / Re: Strange Issue with Arrays on Blitzmax
« on: December 13, 2011 »
I quit using it because of stability issues so you might want to be careful.  The code folding is nice but not necessary and I am sort of a minimalist...

Blitz / Re: Strange Issue with Arrays on Blitzmax
« on: November 30, 2011 »
Try an IDE called Hydramax.  It's free and OK.

[edit - link fixed sw]

That looks really nice.

General chat / Re: Doom 3 source code
« on: November 24, 2011 »
Someone should strip this and turn it into a generalized graphics engine similar to OGRE or suchlike.

The problem with this sort of release, if you can call it a problem, is that if you are going to go to all that effort to make a game, you would probably want to sell it and so from that perspective you are probably better off writing your own or using something with an end-user license.  Although I'm sure you can license it from id if you wanted to.

The main interest from this is as reading matter-- it's always been fascinating to see how Carmack coded things.

Even back to the Doom source, it's always interesting to me how brute force Carmack's coding is.  He doesn't try to do anything fancy or elegant.  His stuff is always in a very simple style and fairly easy to understand except for the core engine math and "black magic."  He engages in a lot less of the fancy dances that a lot of other coders do.

Blitz / Re: Strange Issue with Arrays on Blitzmax
« on: November 23, 2011 »
Well, since the IDE is written in Blitz and they provide source...

Also on linux there's a tutorial for getting it running with Gedit so that you can compile and run right from Gedit with F5. 

Blitz / Re: Strange Issue with Arrays on Blitzmax
« on: November 19, 2011 »
What I'm writing right now is a roguelike dungeon shooter with a voxel engine.  Think Gauntlet meets Nethack. 

I'm rather happy with the Blitzmax opengl implementation.  All in all I love the language but it does have some idiosyncracies that you have to get used to.

Blitz / Re: Strange Issue with Arrays on Blitzmax
« on: November 18, 2011 »
Great answer and I was suspecting that this might be the case.

WHY is it the case?

Are you saying that it's essentially treating all references to the objects as references to a single tcolor object? 

I understand the error now.  I was assuming that the objects in the jgrid array were automatically being constructed but I see that this is not the case.  For some reason I thought that it would call the constructor as the objects were needed.

Thanks for your help.  I may or may not have some other questions at some point in the future but I've written other much longer things in Blitz before and never had a problem like this. 

I appreciate it very much and I will be contributing opengl graphics demo code here, I think people might particularly like some of the pseudo-copper stuff I've done.

I'm also curious as to how well you like Blitz for serious projects.  Do you feel that it's powerful enough to do well-made indie titles?

Blitz / Re: Strange Issue with Arrays on Blitzmax
« on: November 18, 2011 »
Is it possible that my syntax for arrays of types is somehow wrong?  Is it declaring one tcolor object instead of 512 of them?

Blitz / Strange Issue with Arrays on Blitzmax
« on: November 18, 2011 »
I have a very peculiar issue that I'm running into.  This is, frankly, the most intractable bug I've run into for years.

The code here is VERY simple and fundamental, therefore it can't be a bug in Blitz.  It has to be something that I'm not seeing.

This is an 8x8x8 cubical array.  I am attempting to set each cell of the array with a different value.  However, when I later read the cells, they all come out the same as the last value that I fed in!  In other words, ALL THE CELLS ARE APPARENTLY OVERWRITTEN WITH THE SAME VALUE.

The strangest thing is that the error happened with Blitz's built-in multidimensional array functionality.  So I thought that it might be a bug with that, and I wrote my own array class using a 1d array, with aliasing to make it 3d thus:

Code: [Select]
Trouble is that the same error occurs!

I have done my best to pare away everything that is not necessary to isolate the bug, but I still can't see where the problem lies.  Might anyone have any idea?  I am afraid that there may be some sort of bug in the Blitzmax functionality for arrays of types....!?!?!

Initially things weren't packaged away in classes but were all procedural.  Imagine my horror after I wrote my own array class, packaged away in classes, and the same error occurred with different code!

Am I going insane?  Sure feels that way.

Code: [Select]

'jgrid is an 8x8x8 grid of Tcolor types.  For testing purposes, just looking at the r value-- same problem occurs with g and b so removed them.
Type Tcolor
Field r:Double
End Type

Type Jgrid
Field data_array:tcolor[512]
Field tempcolor:tcolor = New tcolor

Method set(x:Int,y:Int,z:Int,r:Float,g:Float,b:Float)
End Method

Method get:tcolor(x:Int,y:Int,z:Int)
Local returnvalue: Tcolor = New Tcolor
returnvalue = data_array[x+(8*y)+(64*z)]
Return returnvalue
End Method

Method randomize()
For Local x:Int = 0 To 7
For Local y:Int = 0 To 7
For Local z:Int = 0 To 7


End Method
End Type

' Here is the testing driver for the above classes.

Global testjgrid:jgrid=New jgrid
Local testcolor:tcolor = New tcolor

testcolor = testjgrid.get (3,3,3)

Print testcolor.r

testcolor = testjgrid.get (7,7,7)

Print testcolor.r

General chat / Re: The Welcoming Committee
« on: November 18, 2011 »
Hi gentlemen.  I code in Blitzmax and C++.  I'm from the old school.  Amiga demos, copper, etc etc.  Currently writing some copper effects in OpenGL.

Pages: 1 2 3 [4]