Posts: 672
Threads: 27
Joined: Aug 2001
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!
Posts: 6,419
Threads: 74
Joined: Mar 2002
What's the *exact* problem? i.e. post the fbc error
Posts: 672
Threads: 27
Joined: Aug 2001
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:
Posts: 3,522
Threads: 189
Joined: Dec 2003
It means that the x is locked, somehow, try changing it to xcounter, or something (prolly wanna go with xc, less typing, hehe)
Posts: 922
Threads: 15
Joined: Jun 2003
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.
Posts: 672
Threads: 27
Joined: Aug 2001
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
Posts: 306
Threads: 14
Joined: Nov 2002
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)
Posts: 672
Threads: 27
Joined: Aug 2001
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?
Posts: 306
Threads: 14
Joined: Nov 2002
^^^^^ Whoops, forgot I logged out. Using a public computer.. though I doubt anyone at my school has ever even heard of QBasic. ^_^