View previous topic - View next topic |
Author |
Message |
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Thu Jan 09, 2003 5:12 am Post subject: problem here... |
[quote] |
|
well, i got one of my first maps done. it's not much, just something to look at. i press f5 once, and it works fine. i get out and press F5 again and ... the whole program shuts down and it says
dos memory-arena error
memory allocation error
cannot load COMMAND, system halted
the first time i loaded it up (before i set the palette) it works fine if i start it multiple time. but after i added the palette, it started doing this. anyone know what's happening? _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Thu Jan 09, 2003 6:02 am Post subject: |
[quote] |
|
- You might have buggy palette setting code. If it's not too much trouble, please post your Palette setting code.
Personally, I use the OUT &H3C8 & OUT &H3C9 commands to update the VGA palette. I don't have problems with that.
- Could also be where you're loading your Map. _________________ - Jaeda
|
|
Back to top |
|
|
Ninkazu Demon Hunter
Joined: 08 Aug 2002 Posts: 945 Location: Location:
|
Posted: Thu Jan 09, 2003 12:02 pm Post subject: |
[quote] |
|
That always happens to me when I'm working with graphics. I just make sure to save, then compile. I don't run in the IDE, I just run the executable.
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Thu Jan 09, 2003 5:54 pm Post subject: |
[quote] |
|
sure... here's the code. by the way, i use palette code that came from pixit, the tile program i use.
first i dim it.
dim pal&(255)
then i load it up and do whatever...
def seg = varseg(pal&(0))
bload "pixit.pal", VARPTR(pal&(0))
for col% = 0 to 255
out &H3C8, col%
out &H3C9, peek(VARPTR(pal&(col%)))
out &H3C9, peek(varptr(pal&(col%)) + 1)
out &H3C9, peek(varptr(pal&(col%)) + 2)
next
def seg
that's the palette code i use. if you want to see all the info about it, download pixit, and look at the readme. note though, if this might be the problem, that currently i am loading up the tiles one at a time. you know,
def seg = varseg(grass%(0))
bload "grass.pic", varptr(grass%(0))
each tile (grass, then floor, and so on) is loaded up immediatley. i haven't yet compiled them. thanks for all your help, i appreciate feedback. _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Thu Jan 09, 2003 6:44 pm Post subject: |
[quote] |
|
- Okay, I dunno about all of this DEF SEG stuff, but I know it's unnecessary. Use a slightly different palette structure. You can even make it the same size if you're worried about that extra 2 bytes [total 512] from using INTEGERs.
Code: | TYPE PALETTESTRUCT
RED AS INTEGER
GREEN AS INTEGER
BLUE AS INTEGER
END TYPE
|
OR, for the same size file
Code: | TYPE PALETTESTRUCT
RED AS STRING * 1
GREEN AS STRING * 1
BLUE AS STRING * 1
END TYPE |
now...
Code: |
DIM PAL(255) AS PALETTESTRUCT
DEF SEG = VARSEG(PAL(0))
BLOAD "palette.pal", 0
' For the INteger version --------------
FOR I = 0 TO 255
OUT &H3C8, I
OUT &H3C9, PAL(I).RED
OUT &H3C9, PAL(I).GREEN
OUT &H3C9, PAL(I).BLUE
NEXT
' For the String version ----------------
FOR I = 0 TO 255
OUT &H3C8, I
OUT &H3C9, ASC(PAL(I).RED)
OUT &H3C9, ASC(PAL(I).GREEN)
OUT &H3C9, ASC(PAL(I).BLUE)
NEXT
|
- I think those might be more stable than all of those Variable-Pointer calls.... You'll have to convert your LONGs to the corresponding Datatype, but this will work:
Code: |
DIM PAL&(255)
DIM PAL1(255) AS PALETTESTRUCT
DEF SEG=VARSEG(PAL&(0))
BLOAD "pixit.pal", 0
FOR I = 0 TO 255
'INTEGER CONVERSION. Note that I'm too lazy to use PEEKs.
PAL1(I).RED = ASC(MID$(MKL$(PAL&(I)), 1, 1))
PAL1(I).GREEN = ASC(MID$(MKL$(PAL&(I)), 2, 1))
PAL1(I).BLUE = ASC(MID$(MKL$(PAL&(I)), 3, 1))
'STRING CONVERSION.
PAL1(I).RED = MID$(MKL$(PAL&(I)), 1, 1)
PAL1(I).GREEN = MID$(MKL$(PAL&(I)), 2, 1)
PAL1(I).BLUE = MID$(MKL$(PAL&(I)), 3, 1)
NEXT
DEF SEG=VARSEG(PAL1(0))
BSAVE "newpal.pal", 0, LEN(PAL1(0)) * 256
|
Tadah!
- See, with this statement:
bload "pixit.pal", VARPTR(pal&(0))
- I'm not too keen on that VARPTR. You only need to specify the starting byte from FILE for the read to begin from. Not the starting byte in memory. It will determine that from the VARSEG.
- I might be wrong, it's been forever and a day since I've used either of those. Is it DEF SEG, and then there was a second DEF statement, what was it again? O.o _________________ - Jaeda
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Thu Jan 09, 2003 9:11 pm Post subject: |
[quote] |
|
thanks tenshi. i'll try it out as soon as i can. _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Mon Jan 13, 2003 5:59 pm Post subject: secret of cooey 2 |
[quote] |
|
anyone remember that annoying controls on soc2? well, with a big of brain power, i was able to make a pixel by tile scrolling engine. so what does this have to do with soc2?? well, in soc2, when you hold down the arrow key, you'd keep on going, long after you stop pressing an arrow. the same thing happens to me. if darkdread is here, could he maybe tell me how to bypass this? (i know he managed to bypass it: i saw it on mattress warrior) or if anyone else feels the urge to help me, just post it, or e-mail me at marshall_7ca@yahoo.ca. any help is greatly appreciated!! _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Mon Jan 13, 2003 10:43 pm Post subject: |
[quote] |
|
- Well actually, the simplest way to avoid it is just to perform a check every time the loop executes to make sure that the key is being pressed.
Code: |
DO
' Draw Background
K = INP(&H60)
IF K = 72 ( or whatever direction ) THEN
CharX = CharX + whatever (or Y)
END IF
Draw Sprite at CharX, charY, Frame, etc.
Show Screen
LOOP UNTIL whatever
|
- I'll check my map code and see if it relates to this structure, I know I don't have the problem you're speaking of and I don't use any special handlers. _________________ - Jaeda
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Tue Jan 14, 2003 12:25 am Post subject: |
[quote] |
|
i'm gonna look around to find out about this stuff. i think the problem is that when you hold down on the left or right or whatever, the temporary memory fills up with what you press, and even when you let go of the key, the temp. mem is still full of the key inputs. every time the program loops around to restart the moving engine, it puts press$= "chr$(0) + "k", and the player will move until the temp. mem is empty.
if this is the case, then i gotta find a way to empty the temp. mem before the action starts up again. _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Tue Jan 14, 2003 12:31 am Post subject: |
[quote] |
|
i'm gonna insert my engine here. don't be surprised if it's crude or anything. i made it up with little help of tutorials (darkdreads tut. that's all. i couldn't find any tuts on pixel * tile scrolling!!)
[code]
DO
DO
press$ = ""
press$ = INKEY$
LOOP UNTIL press$ <> ""
DO
SELECT CASE press$
CASE IS = CHR$(0) + CHR$(72)
pressup
CASE IS = CHR$(0) + CHR$(80)
pressdown
CASE IS = CHR$(0) + CHR$(75)
pressleft
CASE IS = CHR$(0) + CHR$(77)
pressright
END SELECT[/code]
that's the main part. i put everything else into subs. here they are. i just have the sub for pressing the left key. they're all pretty much the same.
SUB pressleft
z1% = 0
DO
z1% = z1% + 1
redraw
contactright
IF z1% = 20 THEN
z1% = 0
px% = px% - 1
END IF
PUT (px% * 20 - z1%, py% * 20 - z%), joey2%, PSET
WAIT &H3DA, 8
FOR c = 1 TO 500
NEXT c
LOOP UNTIL z1% = 0
END SUB[/code] _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Tue Jan 14, 2003 2:32 am Post subject: |
[quote] |
|
- I'd post my map engine here, but even without the subroutine calls to draw the background tiles, NPCs, etc... it's still well over 230 lines long.
- I don't experience the problem you're referring to:
Code: |
DO
' Draw background
' move NPCs, sort them, etc.
K$ = INKEY$
SELECT CASE K$
CASE UPKEY: MOBILE = 1: movement stuff, collision checks, etc.
CASE DOWNKEY: MOBILE = 1 ...
CASE LKEY: ...
CASE RKEY: ...
END SELECT
more stuff
IF MOBILE = 1 THEN
move sprite's position
MOBILE = 0
END IF
later stuff
DRAW Map Sprite
STILL more stuff
Draw map to screen.
LOOP UNTIL a reason to exit map engine. Call to battle, perhaps?
|
- That DO .. LOOP nested at the beginning of your outer DO ... LOOP is causing problems, I think. What I have posted will work, and is much faster than what you're currently using.
There is no need to assign PRESS$ the value of "" at the beginning of the Loop, if there is no key press, that is the value that INKEY$ will return anyway. So you can get rid of that DO loop.
- If you do something simple as I have illustrated, you won't experience that problem.
- But heh, if you really want to see it, I'll post the code for the Map Engine's main routine. It's a pixel-by-tile engine with very good colision detection. _________________ - Jaeda
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Tue Jan 14, 2003 6:09 am Post subject: |
[quote] |
|
if you ask me, my collision detector is not bad itself. soon, so people can test it out, tell me what's missing, i'll put out a walkaround demo of my rpg.
sure tenshi. i'd love to see your engine!! but don't post it. it'll take up too much space on the boards. just e-mail me your engine at marshall_7ca@yahoo.ca.
note that it's my first engine, and i've spent about two to three hours a day for about three days (6-9 hours total). not to mention i had to make up a lot of this stuff as i went along. what i posted was an uncleaned version of the engine that i have now. _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Tue Jan 14, 2003 6:22 am Post subject: |
[quote] |
|
excellent!! after a few changes, the thing's working right now!! thanks tenshi!! I've gotta pay you back somehow. _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
Tenshi Everyone's Peachy Lil' Bitch
Joined: 31 May 2002 Posts: 386 Location: Newport News
|
Posted: Tue Jan 14, 2003 6:02 pm Post subject: |
[quote] |
|
- This is just the Main routine. There're several calls that this routine makes to other stuff.
Code: |
SUB MAPENGINE
WALK = 4: MAPCHAR(0).LAYER = 3: SIGNSHOW = -1: WTIME = 150
MTIME = MSTIMER: FTIME = MSTIMER: MSGTIME = MSTIMER: BATTTIME = MSTIMER: DAMAGETIME = MSTIMER
SPRX = MAPCHAR(0).SCR.X: SPRY = MAPCHAR(0).SCR.Y: TILEX = MAPCHAR(0).TILEV.X: TILEY = MAPCHAR(0).TILEV.Y: CURRCYCLE = MAPCHAR(0).CYCLE: FRAME = MAPCHAR(0).CFRAME
DO
BEGINMAP:
UPDATE.TILES MAPENV(0).MAPX, MAPENV(0).MAPY, MAPENV(0).OFFX, MAPENV(0).OFFY
IF MAPENV(0).SCROLLING > 0 THEN
IF ABS(MSTIMER - MAPENV(0).SCROLLREF) >= MAPENV(0).SCROLLDELAY THEN
SELECT CASE MAPENV(0).SCROLLING
CASE 1: MAPENV(0).OFFY = MAPENV(0).OFFY - MAPENV(0).SCROLLRATE: IF MAPENV(0).OFFY <= -20 THEN MAPENV(0).OFFY = MAPENV(0).OFFY MOD 20: MAPENV(0).MAPY = MAPENV(0).MAPY + 1
CASE 2: MAPENV(0).OFFX = MAPENV(0).OFFX - MAPENV(0).SCROLLRATE: IF MAPENV(0).OFFX <= -20 THEN MAPENV(0).OFFX = MAPENV(0).OFFX MOD 20: MAPENV(0).MAPX = MAPENV(0).MAPX + 1
CASE 3: MAPENV(0).OFFY = MAPENV(0).OFFY + MAPENV(0).SCROLLRATE: IF MAPENV(0).OFFY >= 20 THEN MAPENV(0).OFFY = MAPENV(0).OFFY MOD 20: MAPENV(0).MAPY = MAPENV(0).MAPY - 1
CASE 4: MAPENV(0).OFFX = MAPENV(0).OFFX + MAPENV(0).SCROLLRATE: IF MAPENV(0).OFFX >= 20 THEN MAPENV(0).OFFX = MAPENV(0).OFFX MOD 20: MAPENV(0).MAPX = MAPENV(0).MAPX - 1
END SELECT
IF MAPENV(0).MAPX >= MAPENV(0).SCROLLTO.X AND MAPENV(0).SCROLLING = 2 THEN MAPENV(0).MAPX = MAPENV(0).SCROLLTO.X: ESCRL = 1
IF MAPENV(0).MAPX <= MAPENV(0).SCROLLTO.X AND MAPENV(0).SCROLLING = 4 THEN MAPENV(0).MAPX = MAPENV(0).SCROLLTO.X: ESCRL = 1
IF MAPENV(0).MAPY >= MAPENV(0).SCROLLTO.Y AND MAPENV(0).SCROLLING = 1 THEN MAPENV(0).MAPY = MAPENV(0).SCROLLTO.Y: ESCRL = 1
IF MAPENV(0).MAPY <= MAPENV(0).SCROLLTO.Y AND MAPENV(0).SCROLLING = 3 THEN MAPENV(0).MAPY = MAPENV(0).SCROLLTO.Y: ESCRL = 1
IF MAPENV(0).MAPX + 16 >= MAP(0).MWIDTH THEN MAPENV(0).MAPX = MAP(0).MWIDTH - 16: MAPENV(0).OFFX = 0: ESCRL = 1
IF MAPENV(0).MAPX < 0 THEN MAPENV(0).MAPX = 0: MAPENV(0).OFFX = 0: ESCRL = 1
IF MAPENV(0).MAPY + 10 >= MAP(0).HEIGHT THEN MAPENV(0).MAPY = MAP(0).HEIGHT - 10: MAPENV(0).OFFY = 0: ESCRL = 1
IF MAPENV(0).MAPY < 0 THEN MAPENV(0).MAPY = 0: MAPENV(0).OFFY = 0: ESCRL = 1
MAPENV(0).SCROLLREF = MSTIMER
IF ESCRL = 1 THEN MAPENV(0).SCROLLING = 0: ESCRL = 0
END IF
END IF
IF NUMNPCS > -1 THEN SORTNPCS
IF WEATHER(0).ACTIVE THEN WEATHERPATTERN
PHRASE STR$(FPS), 280, 180, 15, -1, 1, 0
MOBILE = 0: LASTFRAME = FRAME: GOANI = 0
IF TILEX <> LASTTILEX OR TILEY <> LASTTILEY OR (SPRTREE(TILEDAT).SVAL) THEN
TILEDAT = GETTILEVAL(TILEX, TILEY, 0)
TILEVAL = GETTILEVAL(TILEX, TILEY, 2)
IF MENU(7) AND MOBILE = 1 THEN MENU(7) = 0
SELECT CASE SPRTREE(TILEDAT).VALUE
CASE 14
SELECT CASE FRAME
CASE 12: INC = GETTILEVAL(TILEX + 1, TILEY, MAPCHAR(0).LAYER)
CASE 6: INC = GETTILEVAL(TILEX - 1, TILEY, MAPCHAR(0).LAYER)
CASE 0: INC = GETTILEVAL(TILEX, TILEY + 1, MAPCHAR(0).LAYER)
CASE 18: INC = GETTILEVAL(TILEX, TILEY - 1, MAPCHAR(0).LAYER)
END SELECT
MAPCHAR(0).LAYER = INC \ 128 + 1
CASE 15, 16
IF SPRTREE(TILEDAT).VALUE = 16 THEN INC = 1 ELSE INC = -1
IF ABS(MSTIMER - DAMAGETIME) > 2000 THEN
FOR I = 0 TO 2
IF CHAR(I) <> -1 THEN
USER(CHAR(I)).HP = USER(CHAR(I)).HP + (INC * 100)
IF USER(CHAR(I)).HP < 0 THEN USER(CHAR(I)).HP = 0
END IF
NEXT
END IF
END SELECT
IF CHECKLINK(TILEX, TILEY) > -1 THEN
IF HYPERLINK(0).LINKTYPE = 0 THEN
GOX = HYPERLINK(0).GOCOORDS.X: GOY = HYPERLINK(0).GOCOORDS.Y
LOADMAP RTRIM$(HYPERLINK(0).MAPFILE) + ".MAP", 0, 0: MAPENV(0).MAPX = GOX: MAPENV(0).MAPY = GOY: GOTO BEGINMAP
ELSE
LOADSCRIPT "SCRIPTS\", RTRIM$(HYPERLINK(0).MAPFILE), 9
END IF
END IF
END IF
OVER = SPRTREE(TILEDAT).VALUE
LAYOVER = BGLAYER(TILEVAL).VALUE
K$ = INKEY$
IF MAPENV(0).SEEPLAYER THEN 'Begin can see player block
SELECT CASE K$
CASE RKEY
FRAME = 12: MOBILE = 1: MSGTIME = MSTIMER
IF (OVER = 5 OR OVER = 8 OR OVER = 9 OR OVER = 12) OR CHECKNPC(TILEX + 1, TILEY, MAPCHAR(0).LAYER) > -1 OR BGLAYER(GETTILEVAL(TILEX + 1, TILEY, 2)).VALUE = 1 THEN
XVAL = SPRX MOD 20
IF ((XVAL > 12 OR (SPRX < 0 AND XVAL > -8)) AND MAPENV(0).OFFX = 0) OR (MAPENV(0).OFFX < 0 AND MAPENV(0).OFFX < -12) OR (MAPENV(0).OFFX > 0 AND MAPENV(0).OFFX < 8) THEN MOBILE = 0
END IF
CASE LKEY
FRAME = 6: MOBILE = 1: MSGTIME = MSTIMER
IF (OVER = 7 OR OVER = 10 OR OVER = 11 OR OVER = 12) OR CHECKNPC(TILEX - 1, TILEY, MAPCHAR(0).LAYER) > -1 OR BGLAYER(GETTILEVAL(TILEX - 1, TILEY, 2)).VALUE = 1 THEN
XVAL = SPRX MOD 20
IF (((SPRX > 0 AND XVAL < 8) OR XVAL < -12) AND MAPENV(0).OFFX = 0) OR (MAPENV(0).OFFX < 0 AND MAPENV(0).OFFX > -8) OR (MAPENV(0).OFFX > 0 AND MAPENV(0).OFFX > 12) THEN MOBILE = 0
END IF
CASE DWNKEY
FRAME = 0: MOBILE = 1: MSGTIME = MSTIMER
IF (OVER = 6 OR OVER = 9 OR OVER = 10 OR OVER = 13) OR CHECKNPC(TILEX, TILEY + 1, MAPCHAR(0).LAYER) > -1 OR BGLAYER(GETTILEVAL(TILEX, TILEY + 1, 2)).VALUE = 1 THEN
YVAL = SPRY MOD 20
IF ((YVAL > 12 OR (SPRY < 0 AND YVAL > -8)) AND MAPENV(0).OFFY = 0) OR (MAPENV(0).OFFY < 0 AND MAPENV(0).OFFY < -12) OR (MAPENV(0).OFFY > 0 AND MAPENV(0).OFFY < 8) THEN MOBILE = 0
END IF
CASE UPKEY
FRAME = 18: MOBILE = 1: MSGTIME = MSTIMER
IF (OVER = 4 OR OVER = 8 OR OVER = 11 OR OVER = 13) OR CHECKNPC(TILEX, TILEY - 1, MAPCHAR(0).LAYER) > -1 OR BGLAYER(GETTILEVAL(TILEX, TILEY - 1, 2)).VALUE = 1 THEN
YVAL = SPRY MOD 20
IF (((SPRY > 0 AND YVAL < 8) OR YVAL < -12) AND MAPENV(0).OFFY = 0) OR (MAPENV(0).OFFY < 0 AND MAPENV(0).OFFY > -8) OR (MAPENV(0).OFFY > 0 AND MAPENV(0).OFFY > 12) THEN MOBILE = 0
END IF
CASE CHR$(13)
SELECT CASE WALK
CASE 4: WALK = 8: WTIME = 100
CASE 8: WALK = 4: WTIME = 150
END SELECT
CASE CHR$(27)
PAGE.SAVE "TEMP\BG.TMP", PAGE(): MAINMENU: EXIT SUB
CASE " "
TX = 0: TY = 0
NPCTHERE = CHECKNPC(TILEX, TILEY, MAPCHAR(0).LAYER)
IF NPCTHERE < 0 THEN
SELECT CASE FRAME
CASE 12: NPCTHERE = CHECKNPC(TILEX + 1, TILEY, MAPCHAR(0).LAYER)
CASE 6: NPCTHERE = CHECKNPC(TILEX - 1, TILEY, MAPCHAR(0).LAYER)
CASE 0: NPCTHERE = CHECKNPC(TILEX, TILEY + 1, MAPCHAR(0).LAYER)
CASE 18: NPCTHERE = CHECKNPC(TILEX, TILEY - 1, MAPCHAR(0).LAYER)
END SELECT
END IF
IF NPCTHERE > -1 THEN
EFFECT 0, "Collision with NPC #" + STR$(NPCTHERE) + ". Act #" + STR$(NPC(NPCTHERE).CURRSCRRESP), 1200
END IF
IF TILEVAL <= 0 THEN
SELECT CASE FRAME
CASE 12: TILEVAL = GETTILEVAL(TILEX + 1, TILEY, 2): TX = 1
CASE 6: TILEVAL = GETTILEVAL(TILEX - 1, TILEY, 2): TX = -1
CASE 0: TILEVAL = GETTILEVAL(TILEX, TILEY + 1, 2): TY = 1
CASE 18: TILEVAL = GETTILEVAL(TILEX, TILEY - 1, 2): TY = -1
END SELECT
END IF
SELECT CASE BGLAYER(TILEVAL).CONTAINS
CASE 7: MENU(7) = 15: EFFECT 0, "Save Point: Save Access Granted!", 1500
CASE 8
IF FRAME THEN
R& = LEN(SIGNPOST(0))
FOR I = 0 TO MAP(0).SIGNS - 1
GETMEM VARSEG(SIGNPOST(0)), VARPTR(SIGNPOST(0)), R&, XMSPOLL(6) + I * R&
IF SIGNPOST(0).TILEPOS.X = TILEX + TX AND SIGNPOST(0).TILEPOS.Y = TILEY + TY THEN
SIGNSHOW = I: SIGNTIME = MSTIMER
END IF
NEXT
END IF
CASE 9
R& = LEN(ITEMSIGN(0))
FOR I = 0 TO MAP(0).ITEMS - 1
GETMEM VARSEG(ITEMSIGN(0)), VARPTR(ITEMSIGN(0)), R&, XMSPOLL(5) + I * R&
IF ITEMSIGN(0).TILEPOS.X = TILEX + TX AND ITEMSIGN(0).TILEPOS.Y = TILEY + TY THEN
ITEMMAX = UBOUND(ITEM) + 1
SELECT CASE ITEMSIGN(0).ITEMVAL
CASE IS < ITEMMAX: EFFECT 0, "Found " + RTRIM$(ITEM(ITEMSIGN(0).ITEMVAL).NAMEITEM) + " x" + STR$(ITEMSIGN(0).HOWMANY), 2000
CASE ITEMMAX: EFFECT 0, "There is nothing in here", 1200
CASE ITEMMAX + 1: EFFECT 0, "Found" + STR$(ITEMSIGN(0).HOWMANY) + "s!", 2000
CASE ITEMMAX + 2: EFFECT 0, "What the..?!", 1200: FIGHTFLAG = 1: FIGHTTIME = MSTIMER
END SELECT
GOTITEM I, (TILEX + TX) + (TILEY + TY) * MAP(0).MWIDTH
END IF
NEXT
END SELECT
TILEVAL = GETTILEVAL(TILEX, TILEY, 2)
END SELECT
IF FRAME <> LASTFRAME THEN : CURRCYCLE = 0: MOBILE = 0
IF MOBILE AND CURRCYCLE = 0 THEN CURRCYCLE = 2
IF (ABS(MSTIMER - FTIME) >= WTIME AND MOBILE) THEN
CURRCYCLE = CURRCYCLE + 1
IF CURRCYCLE > 5 THEN CURRCYCLE = 2
SELECT CASE FRAME
CASE 0: MAPENV(0).OFFY = MAPENV(0).OFFY - WALK: SPRY = SPRY + WALK
CASE 18: MAPENV(0).OFFY = MAPENV(0).OFFY + WALK: SPRY = SPRY - WALK
CASE 12: MAPENV(0).OFFX = MAPENV(0).OFFX - WALK: SPRX = SPRX + WALK
CASE 6: MAPENV(0).OFFX = MAPENV(0).OFFX + WALK: SPRX = SPRX - WALK
END SELECT
IF ABS(MAPENV(0).OFFY) >= 20 THEN
IF MAPENV(0).OFFY > 0 THEN MAPENV(0).MAPY = MAPENV(0).MAPY - 1 ELSE MAPENV(0).MAPY = MAPENV(0).MAPY + 1
MAPENV(0).OFFY = 0
END IF
IF ABS(MAPENV(0).OFFX) >= 20 THEN
IF MAPENV(0).OFFX > 0 THEN MAPENV(0).MAPX = MAPENV(0).MAPX - 1 ELSE MAPENV(0).MAPX = MAPENV(0).MAPX + 1
MAPENV(0).OFFX = 0
END IF
IF MAPENV(0).MAPY <= 0 THEN
MAPENV(0).MAPY = 0
IF MAPENV(0).OFFY > 0 OR SPRY < 0 AND FRAME <> 18 THEN MAPENV(0).OFFY = 0
ELSEIF MAPENV(0).MAPY >= (MAP(0).HEIGHT - 10) THEN
MAPENV(0).MAPY = MAP(0).HEIGHT - 10
IF MAPENV(0).OFFY < 0 OR SPRY > 0 AND FRAME <> 0 THEN MAPENV(0).OFFY = 0
END IF
IF MAPENV(0).MAPX <= 0 THEN
MAPENV(0).MAPX = 0
IF MAPENV(0).OFFX > 0 OR SPRX < 0 AND FRAME <> 6 THEN MAPENV(0).OFFX = 0
ELSEIF MAPENV(0).MAPX >= (MAP(0).MWIDTH - 16) THEN
MAPENV(0).MAPX = MAP(0).MWIDTH - 16
IF MAPENV(0).OFFX < 0 OR SPRX > 0 AND FRAME <> 12 THEN MAPENV(0).OFFX = 0
END IF
IF MAPENV(0).OFFY OR (MAPENV(0).OFFY = 0 AND (MAPENV(0).MAPY AND MAPENV(0).MAPY < MAP(0).HEIGHT - 10)) THEN : SPRY = 0
IF MAPENV(0).OFFX OR (MAPENV(0).OFFX = 0 AND (MAPENV(0).MAPX AND MAPENV(0).MAPX < MAP(0).MWIDTH - 16)) THEN : SPRX = 0
IF SPRX > 144 THEN
SPRX = 144: CURRCYCLE = 0
ELSEIF SPRX < -145 THEN
SPRX = -145: CURRCYCLE = 0
END IF
IF SPRY > 79 THEN
SPRY = 80: CURRCYCLE = 0
ELSEIF SPRY < -81 THEN
SPRY = -81: CURRCYCLE = 0
END IF
FTIME = MSTIMER
END IF
IF (ABS(MSTIMER - MSGTIME) > 700) AND (MOBILE = 0) THEN CURRCYCLE = 0
IF MOBILE = 0 AND (ABS(MSTIMER - MSGTIME) MOD 200 = 0) THEN CURRCYCLE = ABS(CURRCYCLE - 1)
IF ABS(MSTIMER - MSGTIME) >= 3000 THEN
EFFECT 0, RTRIM$(MAP(0).MAPNAME), 3200
MSGTIME = MSTIMER
END IF
LASTTILEX = TILEX
LASTTILEY = TILEY
IF SPRX THEN TILEX = MAPENV(0).MAPX + (159 + SPRX) \ 20 ELSE TILEX = MAPENV(0).MAPX + (159 - MAPENV(0).OFFX) \ 20
IF SPRY THEN TILEY = MAPENV(0).MAPY + (118 + SPRY) \ 20 ELSE TILEY = MAPENV(0).MAPY + (118 - MAPENV(0).OFFY) \ 20
MAPCHAR(0).SCR.X = SPRX
MAPCHAR(0).SCR.Y = SPRY
MAPCHAR(0).TILEV.X = TILEX
MAPCHAR(0).TILEV.Y = TILEY
MAPCHAR(0).CYCLE = CURRCYCLE
MAPCHAR(0).CFRAME = FRAME
IF SIGNSHOW > -1 THEN
SHOWSIGN SIGNSHOW
IF ABS(MSTIMER - SIGNTIME) > 5000 THEN
SIGNSHOW = -1
END IF
END IF
END IF 'End if can See player block
IF ABS(MSTIMER - BATTTIME) > 1000 THEN BATTTIMER = BATTTIMER + 1: BATTTIME = MSTIMER
IF (MOBILE AND BATTTIMER > 12) OR (ABS(MSTIMER - FIGHTTIME) > 1300 AND FIGHTFLAG) THEN
IF FIGHTFLAG = 0 THEN
IF (RND * 100) > 98 THEN
IF CHECKSAFE(TILEX, TILEY) = 0 THEN
RNDNUM = RND * 100
IF RNDNUM > 34 THEN IND = 1
IF RNDNUM < 35 AND RNDNUM > 10 THEN IND = 3
IF RNDNUM < 11 THEN IND = 5
BATTID = ASC(MID$(SPRTREE(TILEDAT).ENEMYDAT, IND, 1))
BATTINDEX = ASC(MID$(SPRTREE(TILEDAT).ENEMYDAT, IND + 1, 1))
CALLBATTLE BATTID, BATTINDEX: EXIT SUB
END IF
BATTTIMER = 0: BATTTIME = MSTIMER
END IF
ELSE
TSTR$ = MKI$(ITEMSIGN(0).HOWMANY)
BATTID = ASC(MID$(TSTR$, 1, 1))
BATTINDEX = ASC(MID$(TSTR$, 2, 1))
CALLBATTLE BATTID, BATTINDEX: EXIT SUB: FIGHTFLAG = 0
END IF
END IF
DOSCRIPT
EFFECTDET
COPY13H
FP = FP + 1
IF ABS(MSTIMER - MTIME) > 1000 THEN FPS = FP: FP = 0: MTIME = MSTIMER
LOOP UNTIL K$ = CHR$(8) OR MATH.CURRENGINE <> 1
IF K$ = CHR$(8) THEN MATH.CURRENGINE = 0
END SUB
|
_________________ - Jaeda
|
|
Back to top |
|
|
Barok Stephen Hawking
Joined: 26 Nov 2002 Posts: 248 Location: Bushland of Canada
|
Posted: Tue Jan 14, 2003 9:55 pm Post subject: |
[quote] |
|
indeed, that code is huge. mine might be as big as that, give or take a few lines. (that's my whole engine, subs and all though... as i said, e-mail me your whole engine.)
i have no more problems. however, if i have any more problems though, i'll just post it here. so when you see this topic on the top, you'll know that Barok coded himself in a corner, and will need someone's help. _________________ Adosorken: I always liked slutty 10th graders...
Rhiannon: *Slap!*
|
|
Back to top |
|
|
|
Page 1 of 5 |
All times are GMT Goto page 1, 2, 3, 4, 5 Next
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|