[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 264: mysqli_fetch_assoc(): Couldn't fetch mysqli_result
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/db/driver/mysqli.php on line 326: mysqli_free_result(): Couldn't fetch mysqli_result
Pete's QBASIC Site Discuss QBasic, Freebasic, QB64 and more 2009-05-06T11:22:55-05:00 http://www.petesqbsite.com/phpBB3/app.php/feed/topic/2864 2009-05-06T11:22:55-05:00 2009-05-06T11:22:55-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19107#p19107 <![CDATA[Turn Based Games]]>
open anybmp and in the bmp_struc type make id read

dim as integer id

then use the replace funcion in the editor and have it replace "id as string" with "id as integer" and it should accept integers instead of strings
just be sure that you don't use the same value for multiple graphics (it'll only return the first one entered sence id is used to IDentify each graphic)

as for the file thing:
using put # will alway make a 'one line' file sence the format is linear
i'd go with print #/write # like you mentioned for multilined entries

Statistics: Posted by T'lon Nanaki — Wed May 06, 2009 11:22 am


]]>
2009-05-06T03:41:24-05:00 2009-05-06T03:41:24-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19106#p19106 <![CDATA[Turn Based Games]]>

Code:

DIM fileno as integerPRINT "writing a file."fileno = freefile                                    ' finds the first available free fileOPEN "somefile.txt" for output as fileno             ' opens a text file for output or creates one if it doesn't exist        PUT #fileno, 1, "Blah Blah"                  ' writes Blah Blah in the file at position 1        PUT #fileno, 10, "Blah Blah"                 ' writes Blah Blah in the file at position 10CLOSE fileno SLEEP
this only writes things to the first line of the text file. How can I write to other lines?


EDIT: doesn't matter I used PRINT # instead

Statistics: Posted by Hrothgar — Wed May 06, 2009 3:41 am


]]>
2009-05-06T03:46:38-05:00 2009-05-06T03:16:08-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19105#p19105 <![CDATA[Turn Based Games]]>
only thing is that because you use a string as an identifier I'm having to write lots of strings.

eg.

Code:

pic.load Char(1).pic(E).frame(1), "\GFX\chareast1.bmp"  'is to load the first frame of a character facing east.                                                        'Char(1).pic(E).frame(1) has to be a string that's different from say Char(1).pic(E).frame(2)                                                        'so I'd have to writeChar(1).pic(E).frame(1) = "firstframefacingeast" 'or something. Different strings for every single frame in every single direction for every single character.
any ideas on how to get around that?

Statistics: Posted by Hrothgar — Wed May 06, 2009 3:16 am


]]>
2009-04-30T11:28:40-05:00 2009-04-30T11:28:40-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19051#p19051 <![CDATA[Turn Based Games]]> i havn't tryed doing animations withit but i think if you have your frames
setup in a singe bitmap the cropping funciton can help you keep track of what frame is displayed

as for that example it's pretty damn close
more like:
dim gfx as mygfx <this is why it'll work in other types

mygfx.load "id name","idfile.bmp"

I've realized that there isn't to many bugs in it and should be finished by
tomarow or the next day I'll try write the example to do an animation :)

as for the other i don't think im understanding the question fully, but please wait till after i've sent you my graphics routine (I can only foucus on one or two things at the same time (DAMN ADHD!))

Statistics: Posted by T'lon Nanaki — Thu Apr 30, 2009 11:28 am


]]>
2009-04-30T03:23:24-05:00 2009-04-30T03:23:24-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19048#p19048 <![CDATA[Turn Based Games]]>

Code:

Type character        _name as string        blahblahetc. as integer        animation(10) as (T'lon'sgfxroutine.image)end typedim Char(charno) as characterT'lon'sgfxroutine.load("gfx\animation1.bmp", char(1).animation(1)) 'or whatever the syntax is

on an entirely unrelated note.
Do you know how to get put #fileno to write to the next line of an external file?

according to fbwiki the syntax is
Put #filenum As Integer, [position As longint], data As String
but [position] is the number of characters along that it starts writing not the number of lines down. Is there a way to get it to write a carriage return or something?

I'm using it to record the character's stats to a text file that can be loaded later as a script. Each stat is recorded on a different line of the script with a command in front of it telling what stat to set and a number indicating which character to set it to. Useful for leveling up or saving a game.

Statistics: Posted by Hrothgar — Thu Apr 30, 2009 3:23 am


]]>
2009-04-30T01:20:26-05:00 2009-04-30T01:20:26-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19047#p19047 <![CDATA[Turn Based Games]]>
it uses a string to id individual bitmaps and you call it's sub\functions

there are a total of 6 subs and 2 functions

I'll include an example code to better explain it

Statistics: Posted by T'lon Nanaki — Thu Apr 30, 2009 1:20 am


]]>
2009-04-29T01:59:28-05:00 2009-04-29T01:59:28-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19040#p19040 <![CDATA[Turn Based Games]]>
how does it work? I guess it's an oop thing? Does it only load bitmaps or could it do other file formats as well?

Statistics: Posted by Hrothgar — Wed Apr 29, 2009 1:59 am


]]>
2009-04-27T19:51:50-05:00 2009-04-27T19:51:50-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19031#p19031 <![CDATA[Turn Based Games]]> )

the entire thing is in a UDT and it loads multiple bitmaps, has a cropping feature, and can do transparancies.

if your intrested i could send a zip file to your email or what-ever
but i still need a little while (a week at most) to finish some of the functions and fine tune some aspects of the code

Statistics: Posted by T'lon Nanaki — Mon Apr 27, 2009 7:51 pm


]]>
2009-04-26T04:10:07-05:00 2009-04-26T04:10:07-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19023#p19023 <![CDATA[Turn Based Games]]> Statistics: Posted by Hrothgar — Sun Apr 26, 2009 4:10 am


]]>
2009-04-23T13:10:41-05:00 2009-04-23T13:10:41-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=19006#p19006 <![CDATA[Turn Based Games]]> Statistics: Posted by T'lon Nanaki — Thu Apr 23, 2009 1:10 pm


]]>
2009-03-31T22:19:35-05:00 2009-03-31T22:19:35-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=18908#p18908 <![CDATA[Turn Based Games]]>

Statistics: Posted by T'lon Nanaki — Tue Mar 31, 2009 10:19 pm


]]>
2009-03-31T06:08:05-05:00 2009-03-31T06:08:05-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=18902#p18902 <![CDATA[Turn Based Games]]>
I'm having a little trouble with the ai.

the behaivior of each of the ai characters is written in a script (.txt file) and read by the main program. It's split up into one off ai actions that take up a turn (eg. attack the square in front of you on your xth turn), one off actions that dont take up a turn (eg. shout "GYAARGH i'll kill you!" or something), and normal recurring behaivior (eg. move towards the closest valid target and attack when theres not a one off behavior specified). All this works pretty well at the moment.

I have a subroutine set up that can target the nearest or farthest character from someone as well as whether or not a character is adjacent to them. The bit I'm getting stuck on is the actual movement part.

when a character is moved it is given a char().newx and char().newy and then the movement sub is called that sorts out the animations and plots the path to the new coordinates.

Each character is only allowed to move half the number of tiles as their speed value so if char().speed = 4 then they can move 2 spaces in any direction.

2 characters cannot occupy the same tile.

so the move and attack recurring behavior has to make
char(ai).newx, char(ai).newy
be int(char(ai).speed / 2) tiles towards
char(target).x, char(target).y

unless
char(ai).newx, char(ai).newy = Char(for...next).x, Char(for...next).y
in which case it has to find another newx,newy (collision detection)
or
char(target).x, char(target).y is < int(char(ai).speed / 2) tiles away
in which case it moves to be adjacent

if adjacent = 1 then char(ai) attacks.

any good ideas on the best way to accomplish that?

Statistics: Posted by Hrothgar — Tue Mar 31, 2009 6:08 am


]]>
2009-03-29T23:08:07-05:00 2009-03-29T23:08:07-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=18895#p18895 <![CDATA[Turn Based Games]]>

Good luck with the game!

Statistics: Posted by Ryan — Sun Mar 29, 2009 11:08 pm


]]>
2009-03-29T08:55:19-05:00 2009-03-29T08:55:19-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=18890#p18890 <![CDATA[Turn Based Games]]>
now it only took me a couple of seconds to guess why you can't get your green health bar transparent

Thank you VERY much, that worked perfectly. I'll keep you posted on my progress.

Statistics: Posted by Hrothgar — Sun Mar 29, 2009 8:55 am


]]>
2009-03-29T03:25:30-05:00 2009-03-29T03:25:30-05:00 http://www.petesqbsite.com/phpBB3/viewtopic.php?p=18888#p18888 <![CDATA[Turn Based Games]]> leave it as is!
in a tactical RPG each "turn" is in fact a predeturmined length of time, wether it's a second or a millenia, so if two characters have the same values just means that they are moving at the same time in "Battle Time"
so a need to choose who would go first in "real time" is irrelevent.
If you pay close attention to both final fantasy tactics and shining force you can actually see that this ideology(wether it's really part of the game's engine or not) is present in both games.

now it only took me a couple of seconds to guess why you can't get your green health bar transparent

take a close look at this code

Code:

Screen 19,32,,1'screenres 800,600,32,,1Line(0,100)-(800,120),RGBA(0,0,255,128),bfline(200,100)-(600,120),rgba(128,0,0,128),bfSleepclsScreen 19,32,,&h41'screenres 800,600,32,,&h41Line(0,100)-(800,120),RGBA(0,0,255,128),bfline(200,100)-(600,120),rgba(128,0,0,128),bfSleep
in the screen and screenres functions threre is a flag value that changes
how the screen acts. for the example above that's why the first time you get a solid red bar and the second time is a purple bar

if you use &h40 with any other flags you will activate the GFX_ALPHA_PRIMITIVES flag and that willl allow alpha blending
chances are you have just &H01 (1) which inorder for alpha channel to be used should be &H41 (that is alpha and fullscreen) :)
let me know if this helped...

Statistics: Posted by T'lon Nanaki — Sun Mar 29, 2009 3:25 am


]]>