Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ok, trying to port a roguelike project to FB....
#1
As the complete FB-newbie I am, I will need some help here. Trying to compile a roguelike-project gives me alot of errors....some I have fixed and some I havn't fixed yet...

Anyways, FB has some problems with this code, anyone know how to fix it?

Code:
FOR x = MaxX TO 1 STEP -1
FOR y = MaxY TO 1 STEP -1
  IF DungeonLayer(x, y) = STAIRSUP THEN
   IF MonsterLayer(x, y) = 0 THEN
   xpos = x
   ypos = y
   CALL PlayTheGame: END
   END IF
  END IF
NEXT y
NEXT x

Thanks!
[Image: jocke.gif]
Website: http://jocke.phatcode.net
"Some men get the world, other men get ex hookers and a trip to Arizona."
Reply
#2
What's the *exact* problem? i.e. post the fbc error Wink
SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Reply
#3
Oki... :oops:

Error message:
Quote:error 50. Expected scalar counter, before: '='


Code (where FOR x = 1 TO 12 is the linenumber the error hits):

Code:
FOR x = 1 TO 12
  GItemACmod = items(CEquipment(x).ILINumber).IAC + GItemACmod
  GItemACmod = CEquipment(x).ILACBonus + GItemACmod
  GItemToHitmod = CEquipment(Equip).ILToHitBonus + GItemToHitmod
  GItemToDammod = CEquipment(Equip).ILToDamageBonus + GItemToDammod
NEXT x

The last post (with code) can be ignored :oops:
[Image: jocke.gif]
Website: http://jocke.phatcode.net
"Some men get the world, other men get ex hookers and a trip to Arizona."
Reply
#4
It means that the x is locked, somehow, try changing it to xcounter, or something (prolly wanna go with xc, less typing, hehe)
Reply
#5
Is X an function argument passed by reference? Than it can't be used.. declare the arg as BYVAL or then use another name as Z!re said.
Reply
#6
Thanks guys. It was like you said Vic...fixed now.

Ok, next error :wink:

Quote:error 10 : expected '=', found: 'SEG'

And the code where the error is:

Code:
SUB ScreenFun (arg%)

SELECT CASE arg%
  CASE 1  'Save the Screen
    DEF SEG = &HB800
    FOR x = 0 TO 4000
      SCREENSAVE(x) = PEEK(x)
    NEXT x
    DEF SEG
  CASE 2  'Restore the Screen
    DEF SEG = &HB800
    FOR x = 0 TO 4000
      POKE x, SCREENSAVE(x)
    NEXT x
    DEF SEG
END SELECT

END SUB
[Image: jocke.gif]
Website: http://jocke.phatcode.net
"Some men get the world, other men get ex hookers and a trip to Arizona."
Reply
#7
Yo go Jocke. hehe I have some old random map generator code I was thinking about messing with in FreeBASIC. Anyways, here's the problem from keywords.txt in the docs folder:

Quote:DEF SEG Statement (reason: segments are not needed in 32-bit flat mode)
Reply
#8
Hi there Ryan...hehe... you know me, within ten years I might start to use gfx in my games :wink: Textmode rules 8) Btw, I should as you this: when making texmode games using FB is there something special one should think about? Is the chr codes the same as in qb for example?
[Image: jocke.gif]
Website: http://jocke.phatcode.net
"Some men get the world, other men get ex hookers and a trip to Arizona."
Reply
#9
Yeah, the same one's are used, though I seem to remember having a little trouble with a few. It seems some of the color stuff is different, and two other problems (unless they've been fixed in the recent version) are the mouse being on all the time and the cursor always blinking. It's also kind of slow for refreshing (like the chunky text scroll in my demo). :wink: Basically, (no pun intended) you're using a more advanced language which can't match up to QB's raw text display dominance. Tongue The big thing is just speed, like you may have noticed in Zap's remake.

As for the saving/restoring screen stuff.. is that really necessary for the gameplay? If not, I'd say just cut it out.
Reply
#10
^^^^^ Whoops, forgot I logged out. Using a public computer.. though I doubt anyone at my school has ever even heard of QBasic. ^_^
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)