|
Post by Enzo on Aug 19, 2023 0:13:05 GMT
'Luck is a constant variable controlled meter feature in the game that actual button skill is required for before the rest. refering to combat, Skill level is achieved with 'Accuracy on a gain metered scale you can lose you skill level at any time.
'r]pg game base by Enzo | A|ways Missing
'study the code to learn how to play\
'" ";_
notice "This is a free demo download. ";_ " I present to you; yet, again; untitled project by Always Missing" notice "Date of production: 2010 revision 2020" '" ";_ '" RIP: Matt" 'dev global playerfile$, downloadfile$, PID, myPID, x, y, player.x, player.y, yes, debug, startup, frames, PIDid, command$, commandtype$, inputcommand$, playercount,_ playerpos$, ms, luck, buffer, null, map.x, map.y, screen.x, screen.y, TILESIZE, OFFSET, loopx, time, fps, base10, debugnull,_ set, playeraccuracy, skill, luck, health, currentplayercount, frames, timerstatement, timestatement, time1, time2,_ loopcount, id, clickms, npc.n, spi, obj, tile.list$, i, L, map.width, map.height, SCREENWIDTH, SCREENHEIGHT, GAMEWIDTH, GAMEHIEGHT 'spi=id of directional player graphic
global TileX, TileY, TileXY$,_ Bankspace, currentbankcount, inventory, selected,_ mana, magicklevel, specialbar, specialtimer, attacktime, defendtimer,_ lastselected$,selecteditem$, selected$, action$,_ attack, defend, attacktimer, defendtimer, defend1, defend2, attacktime1, attacktime2,_ combines, combinations, shipid global mapX, mapY, totalitems, objcount, div, clientcount, ram, itemid ram =750 clientcount = 10 'number of max clients mapX=ram:mapY=ram:totalitems=10:objcount=10:div=2:lag=1:clientcount=1:base10=10 '5 sprites of 10 images each '/dev map.width = ram map.height = ram player.x =6 player.y= 5 global sailing, boat sailing = 2 boat = 1
dim sea(ram,ram) pi$ = "14 15 92 65 35 89 79 32 38 46 26 43 38 32 79 50 28 84 19 71 69 39 93 75 10 58 20 97 49 44 59 23 07 81 64 06 28 62 08 99 86 28 03 48 25 34 21 17 06 79" dim npc.x(ram) dim npc.y(ram) dim old.npc.x(ram) dim old.npc.y(ram) dim map$(mapX,mapY)
dim noticed$(ram,ram)
dim obj.sprite.name$(100) dim obj.bmp.name$(100)
dim npchealth(ram,ram) dim npc(ram,ram)
dim weapon(100,2) '1- special amount type 2-weapontiming weapon(1,1)=1 'regular timing per diem; special weapon(1,2)=250 'quarter of second, 1/4th
weapon(2,1)=7 'warlord mask [endgame] weapon(2,2)=575 'slow max hit weapon, bonus; instant
dim weapontimes(20) weapontimes(6)=10'magic weapontimes(1)=15 'dagger weapontimes(2)=20 'longsword weapontimes(3)=25'sword weapontimes(4)=30'2h weapontimes(5)=40'2h dim message$(15000) dim mapactivate(ram,ram) dim msg$(100)'game msgs=quests 'dim questrandom$(1000,1)
dim obj.x(ram) dim obj.y(ram) obj.n = ram
'building tree rocks 'obj.x(3)=21 'obj.y(3)=12 'obj.bmp.name$(3)= "object2.bmp" 'obj.sprite.name$(3)= "object2"
dim logx(100) 'set log buffer for now = 1 to 100 logx(now) = 1 next now
dim attacktime(5) 'attack rythm medium, short, long, mid, very short, medium, short, long, mid, ect. attacktime(1)=15 attacktime(2)=-10 attacktime(3)=20 attacktime(4)=10 attacktime(5)=-20
dim mapobjectX(mapX, obj.n) dim mapobjectY(mapY, obj.n)
dim item(ram,ram) dim item(totalitems,3) '1 =unsed/id 2=type 3=unsed/unique id for trading dim itemdisplay(totalitems, 2) dim item.x(ram) dim item.y(ram) dim npchealth(ram,ram)
dim inventory(8) dim bank(10)
dim specialattack(7)
dim playerfiles$(clientcount, 4) '1=health, 3=hit, 2=npc 4=character[one]id graphic combo code/id *attire amulets swords ; ect.
waitload = 10 shipid = 1 'developer info // myPID = 1 ms = 30 'for timerloop (1000/ms) frames = 10 'desired fps; actual fps may very use 'display() = fps()' function to find fps
'\\ basic debug/building data delete on alpha combinations = 10 'item combines, to new itemid here=item(itemid,2) npcname$ = "player.bmp"' add to keys after playeraccuracy = 10' 1 - 10 low-high skill = .9 ' .5 - .9 high level, .10 - .40 low level luck = .9 '.01-.99 seconds = 3 'desired debug run amount in seconds of 10 frames a second
health = 100
player(1,2) = health player(2,2) = health'input from file on server-client 'function for loading health from playerfiles
null = 0 'set 00000000 byte null = null 'renull
'id = 2 'set max hit calculated by point system divided '\\ end developer info
'set = skill * 7 'unsed
'// /dev
'debug tile.list$ = " dirt water grass rock sand "
buffer = 10 'ms buffer to bad loop yes = 1 '1 operator for debug startup = 1
goto [skipDebug]
[INFO] 'working on basically loading final bmps, server login startup,, animations, useless debug data; for geeks and the actual filesystem format for the server itself [DATA] 'add player bmps weapon gfx, ect., login, server data exchange, animations, debug timing variable file,save on exit
[debugdata] ' debug(debug$) at bottom of code, select case debug$ confirm "debug = 1 (yes)?";answer$ if answer$ = "yes" then debugnull = 1 end if
if debugnull < null then 'NOMAINWIN end if '// / debug [skipDebug]
NOMAINWIN'
TILESIZE = 64 : SCREENWIDTH = 11 : SCREENHEIGHT = 8 : OFFSET = TILESIZE GAMEWIDTH = SCREENWIDTH*TILESIZE-TILESIZE*2+64 GAMEHEIGHT = SCREENHEIGHT*TILESIZE-TILESIZE*2 WindowWidth = GAMEWIDTH : WindowHeight = GAMEHEIGHT+80 : BackgroundColor$ = "BLACK"
UpperLeftX=int((DisplayWidth-WindowWidth)/2) : UpperLeftY=int((DisplayHeight-WindowHeight)/2) graphicbox #main.gbx, 0, 0,GAMEWIDTH , GAMEHEIGHT textbox #main.textbox, 14, 400, 352, 25 open "Always Missing's Sailing: Untitled PROJECT alpha demo pre-release 001 SAND - ICE - SHELF" for window_nf as #main
print #main.textbox, "!disable" print #main.textbox, "0%" #main.gbx "down; fill BLACK; flush" #main "trapclose [quit.main]" '#main.gbx "When characterInput" #main.gbx "Getbmp empty.bmp 1 1 ";TILESIZE;" ";TILESIZE*2
[ADDTILES]'setup data edit to add .bmp's tile.list$ = "dirt water grass rock sand up left own aft port to" For i = 1 To 11 loadbmp left$(word$(tile.list$,i),1);".bmp", DefaultDir$+"\tiles\";word$(tile.list$,i);".bmp" #main.gbx "drawbmp ";left$(word$(tile.list$,i),1);".bmp 1 ";TILESIZE+1;" ; ";_ "Getbmp ";left$(word$(tile.list$,i),1);".bmp 1 1 ";TILESIZE;" ";TILESIZE*2 Next
#main.gbx "down; fill black"
loadbmp "newmap.bmp", "C:\users\never\desktop\Buildv19alpharoo\char\newmap.bmp" ' #main.graphicbox1, "addbmp map 0 0" #main.gbx, "addsprite map newmap.bmp" #main.gbx, "drawbmp newmap.bmp"
playwave DefaultDir$+"\intro\preintro.wav", async
OPEN DefaultDir$+"\DATA\mapdata1.txt" For input AS #mapfile
While not(eof(#mapfile)) line input #mapfile, itemdata$ ' nn=nn+1 'print #main.textbox, nn id$=trim$(itemdata$) if left$(id$,1)<>"'" and id$<>"" Then Select case case instr(id$,"width") map.width = val( trim$(word$(id$,2,"="))) case instr(id$,"height") map.height = val( trim$(word$(id$,2,"=")))-250 case instr(id$,"playerX") player.x = val( trim$(word$(id$,2,"="))) case instr(id$,"playerY") player.y = val( trim$(word$(id$,2,"="))) case instr(id$,"others") npc.n = val( trim$(word$(id$,2,"="))) IF npc.n>0 Then DIM npc.x(npc.n),npc.y(npc.n) DIM old.npc.x(npc.n),old.npc.y(npc.n) For L = 1 To npc.n line input #mapfile, id$ npc.sprite.name$(L) = WORD$(id$,1,";") npc.bmp.name$(L) = WORD$(id$,2,";") npc.x(L) = val(TRIM$(WORD$(id$,3,";"))) npc.y(L) = val(TRIM$(WORD$(id$,4,";"))) old.npc.x(L) = npc.x(L): old.npc.y(L) = npc.y(L) 'PRINT npc.bmp.name$ Next L End if close #mapfile 'goto [r]
' DIM map$(map.width,map.height) ' ' print map.width, map.height ' For y = 1 To map.height ' ' For x = 1 To map.width ' ' print x, id$ ' map$(x,y) = TRIM$(word$(id$,x,",")) ' " " ' 'PRINT map$(x,y) ' Next ' line input #mapfile, id$ ' if instr(id$,"END") Then exit FOR ' Next ' close #mapfile ' notice ""
goto [r] end select End if Wend close #mapfile [r] print #main.textbox, "1%" open DefaultDir$+"\DATA\mapxy.txt" for input as #file map$=input$(#file,lof(#file)) for x = 1 to 501 for y = 1 to 501
var = var + 1
s$ = mid$(map$, var, 1) ' b$ = select$(s$) if s$ <> " " then xx=xx+1 if xx = 501 then xx = 0 var = var + 1 yy = yy + 1 end if else 'notice "" yy = yy + 1 end if
map$(xx,yy) = s$ next y print #main.textbox, "Loading PREFETCH:";int(var/4000);"%"
next x
close #file
for nnn = 1 to ram map$(4,nnn)="r" next nnn
timer 50, [preintro] wait [preintro] timer 0 loadbmp "gif1.bmp", DefaultDir$+"\intro\gif1.bmp" #main.gbx "drawbmp gif1.bmp 50 50"
timer 300*waitload, [5] wait
[5] timer 0 loadbmp "gif2.bmp", DefaultDir$+"\intro\gif2.bmp" #main.gbx "drawbmp gif2.bmp 50 50"
timer 600*waitload, [intro] wait [intro] timer 0 'play midi timer 400*waitload, [loadscreen0ff] wait [loadscreen0ff] timer 0 'Floadbmp ".bmp", DefaultDir$+"\tiles\sky.bmp"
print #main.textbox, "98%" loadbmp "data2.bmp", DefaultDir$+"\intro\data2.bmp" #main.gbx "drawbmp data2.bmp 50 50"
timer 105*loadwait, [puesdotimer0s]
wait
[puesdotimer0s] timer 0 [loadscreen0s]
loadbmp "gif4.bmp", DefaultDir$+"\intro\gif4.bmp" #main.gbx "drawbmp gif4.bmp 50 50"
timer 205*waitload, [puesdotimer0a]
wait
[puesdotimer0a] timer 0 playwave ""
'print #main.gbx, "spritexy gfx 0 0"
[loadscreen00000]
loadbmp "gif6.bmp",DefaultDir$+"\intro\gif6.bmp" #main.gbx "drawbmp gif6.bmp 50 50"
#main.gbx "down; fill black" timer 200*waitload, [puesdotimera]
wait
[puesdotimera] timer 0 playwave DefaultDir$+"\intro\intro.wav", async [loadscreen0]
#main.gbx "cls"
timer 200*waitload, [puesdotimer0]
wait
[puesdotimer0] timer 0 loadbmp "start004.bmp",DefaultDir$+"\intro\start004.bmp" #main.gbx "drawbmp start004.bmp 124 40"
timer 205*waitload, [puesdotimer]
wait
[puesdotimer] timer 0 #main.gbx "down; fill black"
loadbmp "start003.bmp", DefaultDir$+"\intro\start003.bmp" #main.gbx "drawbmp start003.bmp 0 0"
timer 700*waitload, [puesdotimer2]
wait
'more gfx
[puesdotimer2] timer 0 [puesdotimer3]
'print #main.textbox, "99%" loadbmp "start002.bmp",DefaultDir$+"\intro\start002.bmp" #main.gbx "drawbmp start002.bmp 0 0"
[PLAYERBMPLIST]
loadbmp "player1.bmp", DefaultDir$+"\char\player1.bmp" loadbmp "player2.bmp", DefaultDir$+"\char\player2.bmp" loadbmp "player3.bmp", DefaultDir$+"\char\player3.bmp" loadbmp "player4.bmp", DefaultDir$+"\char\player4.bmp" loadbmp "player5.bmp", DefaultDir$+"\char\player5.bmp" loadbmp "player6.bmp", DefaultDir$+"\char\player6.bmp" loadbmp "player7.bmp", DefaultDir$+"\char\player7.bmp" loadbmp "player8.bmp", DefaultDir$+"\char\player8.bmp" loadbmp "moon.bmp", DefaultDir$+"\moon.bmp" [CONTROL] #main.gbx "setfocus;" ;_ "When characterInput [keys]; ";_ "fill black;" ;_ "DRAWSPRITES" room = 1
' print #main.textbox, "70%" ' goto [6] [LOADMAP] 'loadbmp "sky.bmp", DefaultDir$+"\tiles\sky.bmp" '#main.gbx, "spritexy '#main.gbx "addsprite sky sky.bmp" print #main.textbox, "75%" [MAPDATARAM] ' 10 * 7 DIM tile(SCREENWIDTH*SCREENHEIGHT,2) for h = 1 To SCREENHEIGHT for w = 1 To SCREENWIDTH obj=obj+1 #main.gbx "addsprite obj";obj;" empty.bmp d.bmp w.bmp g.bmp r.bmp s.bmp u.bmp l.bmp o.bmp a.bmp p.bmp t.bmp" tile(obj,1)=w tile(obj,2)=h next:next 'room= 1 loadbmp "snow1.bmp", "snow1.bmp" loadbmp "snow2.bmp", "snow2.bmp" loadbmp "snow3.bmp", "snow3.bmp" loadbmp "snow4.bmp", "snow4.bmp"
#main.gbx, "addsprite snow snow1.bmp snow2.bmp snow3.bmp snow4.bmp"
[ADDPLAYERSPRITE] #main.gbx "addsprite player player1.bmp player2.bmp player3.bmp";_ " player4.bmp player5.bmp player6.bmp player7.bmp player8.bmp;";_ "spritexy player ";player.x*TILESIZE-TILESIZE-OFFSET+20;" ";player.y*TILESIZE-TILESIZE-OFFSET-10
[addweapon] null=null '#main.gbx "addsprite wgfx wgx1.bmp wgfx.bmp wgfx3.bmp";_ ' " wgfx4.bmp wgfx5.bmp wgfx6.bmp wgfx7.bmp wgfx8.bmp ;";_ ' ' "spritexy wgfx ";player.x*TILESIZE-TILESIZE-OFFSET;" ";player.y*TILESIZE-TILESIZE-OFFSET print #main.textbox, "99.99% loading" [items]'inventory map item sprites load itemid=0 'itemid starts at 1000 for itemload = 1 to item.n itemid = itemid +1 item.bmp.name$(itemid)=str$(itemid);".bmp" item.sprite.name$(itemid)= str$(itemid) next itemload 'example 'item.bmp.name$(2)= "51.bmp" 'item.sprite.name$(2)= "51" dim npc.bmp.name$(100) dim npc.sprite.name$(100) dim npc(ram,ram) [setupnpc] npc.n = 1 npc.bmp.name$(1) = "player9.bmp" npc.sprite.name$(1) = "king" npc.x(1)= 14 npc.y(1)= 14 npc(14,14)=1 npc(25,14)=2 npc.n = 2 npc.bmp.name$(2) = "king1.bmp" npc.sprite.name$(2) = "king2" npc.x(2)= 25 npc.y(2)= 14 abc=npc.n npc.n = 25 ccc=1
'cc pi max 50 for cc= 1 to 25
xx$ = word$(pi$,ccc) yy$ = word$(pi$,ccc+1) npc.bmp.name$(abc) = "king";str$(abc);".bmp" npc.sprite.name$(abc) = "king";str$(abc) xx=val(xx$) yy=val(yy$) npc.x(abc)=int(val(xx$)/2) npc.y(abc)= int(val(yy$)/2) npc(int(val(xx$)/2),int(val(yy$)/2))=abc bb=bb+1 noticed$(xx/2,yy/2+1)=str$(bb) abc = abc + 1 if a = 0 then a = 1 else a = 0 end if if a = 1 then ccc = ccc + 2 end if if a = 0 then ccc=ccc+1 end if next cc ccc=25 a=0 abc = abc + 1'set bb = 0 for cc= 25 to 37 '50npcs
xx$ = word$(pi$,ccc) yy$ = word$(pi$,ccc+1) xx=val(xx$) yy=val(yy$) xx= xx+3 yy = yy'+1 npc.bmp.name$(abc) = "king";str$(abc);".bmp" npc.sprite.name$(abc) = "king";str$(abc) npc.x(abc)=xx/2 npc.y(abc)=yy/2 npc(xx,yy)=abc bb = bb + 1 noticed$(xx/2,yy/2+1)=str$(bb) abc = abc + 1 ccc=ccc+2 next cc 'npc.n=5 'print #main.gbx, "spritescale player 150"
' npc.bmp.name$(2) = ".bmp" ' npc.sprite.name$(2) = ""
' npc.bmp.name$(3) = ".bmp" ' npc.sprite.name$(3) = ""
'manual placement item.x(1)=3 item.y(1) =3 item.x(2)=4 item.y(2) =4
[NPC]'npc.n controls output of loops to new entry if npc.n Then For L = 1 To npc.n loadbmp npc.bmp.name$(L), DefaultDir$+"\char\";npc.bmp.name$(L) #main.gbx "addsprite ";npc.sprite.name$(L);" ";npc.bmp.name$(L) '#main.gbx "spritexy ";npc.sprite.name$(L);" ";npc.x(L)*TILESIZE-TILESIZE-OFFSET;_ ' " ";npc.y(L)*TILESIZE-TILESIZE-OFFSET Next End if
dim inventoryid(10) dim quest$(750,750) item.n=0 'update variable if item.n Then For L = 1 To item.n loadbmp item.bmp.name$(L),DefaultDir$+"\items\";item.bmp.name$(L) #main.gbx "addsprite ";item.sprite.name$(L);" ";item.bmp.name$(L) '#main.gbx "spritexy ";item.sprite.name$(L);" ";item.x(L)*TILESIZE-TILESIZE-OFFSET;_ '" ";item.y(L)*TILESIZE-TILESIZE-OFFSET Next End if #main.gbx, "addsprite moon.bmp moon.bmp"
playwave "" playwave DefaultDir$+"\intro\music.wav", async print #main.textbox, "100%"
[obj]'object loader for xxy = 1 to 500 for yyx = 1 to 500 npchealth(xxy,yyx)=100 next yyx next xxy objid = 100 '100-999 objects universal gameid ref 'for loadobj = 1 to obj.n ' objid=objid+1 'obj.bmp.name$(itemid)="A";str$(itemid);".bmp" 'obj.sprite.name$(itemid)= str$(itemid) 'next loadobj
'example obj.bmp.name$(1)="alwaysalways.bmp" obj.sprite.name$(1)= "object1"
obj.bmp.name$(2)= "pirate.bmp" obj.sprite.name$(2)= "object2" obj.bmp.name$(3)= "piratel.bmp" obj.sprite.name$(3)= "object3" obj.bmp.name$(4)= "pirater.bmp" obj.sprite.name$(4)= "object4" obj.bmp.name$(5)= "pirated.bmp" obj.sprite.name$(5)= "object5" obj.bmp.name$(6)="outline.bmp" obj.sprite.name$(6)="object6"
obj.bmp.name$(7)="abc.bmp" obj.sprite.name$(7)="object7"
obj.bmp.name$(8)="healthbar12.bmp" obj.sprite.name$(8)="object8" obj.bmp.name$(9)="healthbar25.bmp" obj.sprite.name$(9)="object9" obj.bmp.name$(10)="healthbar50.bmp" obj.sprite.name$(10)="object10" obj.bmp.name$(11)="healthbar75.bmp" obj.sprite.name$(11)="object11" obj.bmp.name$(12)="healthbar100.bmp" obj.sprite.name$(12)="object12"
obj.bmp.name$(13)="special0.bmp" obj.sprite.name$(13)="object13" obj.bmp.name$(14)="special25.bmp" obj.sprite.name$(14)="object14" obj.bmp.name$(15)="special50.bmp" obj.sprite.name$(15)="object15" obj.bmp.name$(16)="special75.bmp" obj.sprite.name$(16)="object16" obj.bmp.name$(17)="special100.bmp" obj.sprite.name$(17)="object17"
obj.bmp.name$(18)="mickey.bmp" obj.sprite.name$(18)="object18" obj.bmp.name$(19)="lemon.bmp" obj.sprite.name$(19)="object19"
obj.bmp.name$(20)="alwaysalways2.bmp" obj.sprite.name$(20)="object20"
'manual placement input
msg$(1)="Excuse me, traveler. Please, help me out. Grab my book, it is just down to the right around south 14 east 13, Hero, I need you to go out there and disrupt their activities destroy thei... do whatever it takes to stop those wretched miscreants merchants. It'll be dangerous, but I'm willing to come along if you need me to. wish I could pay you far more than I can, but what I can pay isn't less than what's less either. Best of luck hero, arrrgh. (you realize the unnamed King is drunk and talking to you)" msg$(2)="Second msg"
noticed$(7,7)="b2"
message$(1)="Help I need that chest opened" message$(2) ="2msg" message$(3) =" 3msg" message$(4) ="4msg"
message$(5) ="5msg" message$(6) ="6msg" message$(7) ="Beware" message$(8) ="Enter the cave as you will." message$(9) ="Gather my friend from the sea" message$(10) ="10msg" message$(11) ="Welcome to the caves" message$(12) ="This great dragon will require much skill" message$(13) ="13msg" message$(14) ="14msg" message$(15) ="15msg" message$(16) ="16msg" message$(17) ="17msg" message$(18) ="18msg" message$(19) ="19msg" message$(20) ="20msg" message$(21) ="21msg" message$(22) ="22msg" message$(23) ="23msg" message$(24) ="24msg" message$(25) ="25msg" message$(26) ="26msg" message$(27) ="27msg" message$(28) ="28msg" message$(29) ="29msg" message$(30) ="30msg" message$(31) ="31msg" message$(32) ="32msg" message$(33) ="33msg" message$(34) ="34msg" message$(35) ="35msg" message$(36) ="36msg" message$(37) ="37msg" message$(38) ="38msg"
'msgs$(100)="At 462 east 461 south there is a book, one of a kind." obj.x(1)=13 obj.y(1) =14 quest$(13,14) ="1"
obj.x(20)=10 obj.y(20)= 10 quest$(10,10)="2b"
'null 'obj.x()= 'obj.y()= 'quest$(,)=""
obj.x(2)=500 obj.y(2) =500
obj.x(3)=490 obj.y(3) =500
obj.x(4)=480 obj.y(4) =500
obj.x(5)=500 obj.y(5) =480
obj.x(6)=470 obj.y(6) =500
'gui obj.x(7)=2 obj.y(7) =4
'item pickup obj.x(19)=13 obj.y(19)=13
for n=8 to 18 obj.x(n)=100 obj.y(n) =100 next n
obj.bmp.name$(21)="alwaysalways10.bmp" obj.sprite.name$(21)= "object21"
obj.bmp.name$(22)="alwaysalways37.bmp" obj.sprite.name$(22)= "object22"
obj.bmp.name$(23)="alwaysalways4.bmp" obj.sprite.name$(23)= "object23"
obj.bmp.name$(24)="alwaysalways5.bmp" obj.sprite.name$(24)= "object24"
obj.bmp.name$(25)="alwaysalways6.bmp" obj.sprite.name$(25)= "object25" obj.bmp.name$(26)="alwaysalways7.bmp" obj.sprite.name$(26)= "object26" obj.bmp.name$(27)="alwaysalways8.bmp" obj.sprite.name$(27)= "object27" obj.bmp.name$(28)="alwaysalways9.bmp" obj.sprite.name$(28)= "object28" obj.bmp.name$(29)="alwaysalways36.bmp" obj.sprite.name$(29)= "object29" obj.bmp.name$(30)="alwaysalways11.bmp" obj.sprite.name$(30)= "object30" obj.bmp.name$(31)="alwaysalways12.bmp" obj.sprite.name$(31)= "object31" obj.bmp.name$(32)="alwaysalways13.bmp" obj.sprite.name$(32)= "object32" obj.bmp.name$(33)="alwaysalways14.bmp" obj.sprite.name$(33)= "object33" obj.bmp.name$(34)="alwaysalways15.bmp" obj.sprite.name$(34)= "object34" obj.bmp.name$(35)="alwaysalways16.bmp" obj.sprite.name$(35)= "object35" obj.bmp.name$(36)="alwaysalways17.bmp" obj.sprite.name$(36)= "object36" obj.bmp.name$(37)="alwaysalways18.bmp" obj.sprite.name$(37)= "object37" obj.bmp.name$(38)="alwaysalways19.bmp" obj.sprite.name$(38)= "object38" obj.bmp.name$(39)="alwaysalways20.bmp" obj.sprite.name$(39)= "object39" obj.bmp.name$(40)="alwaysalways21.bmp" obj.sprite.name$(40)= "object40" obj.bmp.name$(41)="alwaysalways22.bmp" obj.sprite.name$(41)= "object41" obj.bmp.name$(42)="alwaysalways23.bmp" obj.sprite.name$(42)= "object42" obj.bmp.name$(43)="alwaysalways24.bmp" obj.sprite.name$(43)= "object43" obj.bmp.name$(44)="alwaysalways25.bmp" obj.sprite.name$(44)= "object44" obj.bmp.name$(45)="alwaysalways26.bmp" obj.sprite.name$(45)= "object45" obj.bmp.name$(46)="alwaysalways27.bmp" obj.sprite.name$(46)= "object46" obj.bmp.name$(47)="alwaysalways28.bmp" obj.sprite.name$(47)= "object47" obj.bmp.name$(48)="alwaysalways29.bmp" obj.sprite.name$(48)= "object48" obj.bmp.name$(49)="alwaysalways30.bmp" obj.sprite.name$(49)= "object49" obj.bmp.name$(50)="alwaysalways31.bmp" obj.sprite.name$(50)= "object50" obj.bmp.name$(51)="alwaysalways32.bmp" obj.sprite.name$(51)= "object51" obj.bmp.name$(52)="alwaysalways33.bmp" obj.sprite.name$(52)= "object52" obj.bmp.name$(53)="alwaysalways34.bmp" obj.sprite.name$(53)= "object53" obj.bmp.name$(54)="alwaysalways35.bmp" obj.sprite.name$(54)= "object54"
'obj.bmp.name$(55)="alwaysalways37.bmp" 'obj.sprite.name$(55)= "object55" ' mapobjectX(x,itemid; ' mapobjectY(y mapobjectX(13,1)=1 mapobjectY(14,1)=1 '=object id mapobjectX(13,19)=19 mapobjectY(13,19)=19 mapobjectX(10,20)=20 mapobjectY(10,20)=20 ccc=0
for objectest = 37 to 54 hund=1
xx$ = word$(pi$,ccc) yy$ = word$(pi$,ccc+1)
xx=val(xx$) yy=val(yy$) xx= xx+2 yy = yy obj.x(int(xx/2+hund))=objectest obj.y(int(yy/2+hund))=objectest mapobjectX(int(xx/2+hund),objectest)=objectest mapobjectY(int(yy/2+hund),objectest) =objectest if a = 0 then a = 1 else a = 0 end if if a = 1 then ccc = ccc + 2 end if if a = 0 then ccc=ccc+1 end if next objectest
obj.n=54'20 '25 debug if obj.n Then For L = 1 To obj.n loadbmp obj.bmp.name$(L), DefaultDir$+"\items\";obj.bmp.name$(L) #main.gbx "addsprite ";obj.sprite.name$(L);" ";obj.bmp.name$(L) '#main.gbx "spritexy ";obj.sprite.name$(L);" ";obj.x(L)*TILESIZE-TILESIZE-OFFSET;_ '" ";obj.y(L)*TILESIZE-TILESIZE-OFFSET Next End if print #main.textbox, "100%" loadbmp "start001.bmp",DefaultDir$+"\intro\start001.bmp" #main.gbx "drawbmp start001.bmp 0 0"
timer 58*waitload, [puesdotimer4]
print #main.textbox, "DONE%"
wait
[puesdotimer4] timer 0
for i = 1 to 2 unloadbmp "gif";i;".bmp" next i
for i = 4 to 5 if i = 5 then i = 6 end if unloadbmp "gif";i;".bmp" next i for i = 1 to 4 unloadbmp "start00";i;".bmp" next i 'for i = 1 to 4
'next i unloadbmp "data2.bmp"
gosub [fillseafloor] print #main.textbox, "" print #main.textbox, "!enable"
Notice "Dear Traveller, there is a great war, you are a magical being whos luck will have it; (you) need to return to your homeland with a powerful item to protect your home, these lands, full of sand will guide you," Notice "Dear Traveller, -------------[sigh]----------------------------------[sigh]-------------------------------------------------,"' there is a king to the south,";_ '" Talk to him, find out more about the war and a way to travel through these lands, be wary though, there are underground emenies and thus mutiple kings, do n't ask me how I figured it out, I am your guide from your homeland, I come in mary forms to decieve the enemy, ";_ '" You may find me as a star or cloud, and other forms (hidden) from view, vast islands await full of buried treasure and, there are some things you need to know about this realm," Notice "Luck is hidden value only few can reveal to you, by making friends with an unlikely by true friend will they be able to show you. Luck is gathered from many ways as projected by folklore" Notice "Skill is gathered by totalation of accuracy, you must have good accuracy to achieve defeat of an enemy," Notice "You may find riches on your way, gems, rare items and lengendary weapons" Notice "I think you'll need a few of these items to complete your task" Notice "" Notice "..." Notice "One more thing, rememb.. " Notice "You hear a crash" Notice "You and our ship fall thru the water" Notice "on to an ice shelf..?" [debug] '#main.gbx, "fill black" room = 1 timer 180*waitload, [reDo] start = 1 wait
'[debugdata] INFO ONLY NOT A BRANCH FOR REF '[timer] ' timer 100, [reDo] 'wait 'first pause here ' #main.gbx "When characterInput" 'debug=1000: debug=debug(debug) ' debug = 3:debug = debug(debug) 'drawing once every 237ms 'printf = fps(fps,time1,loopx)
'load data here from server 'time1 = time$("ms")
'debug 'timer 'time2 = time$("ms") 'timestatement = limiter(time2,time1,ms,buffer,timestatement) 'debug = 5:debug = debug(debug) 'debug = 4:debug = debug(debug)
[reDo] timer 0
[branch] [loop] if start = 1 then start = 2 end if #main.gbx "When characterInput" ' if $(player.x,player.y) > 0 then ' notice $((player.xplayer.y) #main.gbx, "spritexy snow 0 80" #main.gbx, "cyclesprite snow 1" print #main.gbx, "spritexy moon.bmp 30 ";player.y+55 if talkactivate = 1 then
varr$=noticed$(player.x,player.y) if varr$ > "" then logx(val(varr$))=1 display$= msgs$(val(varr$),val(varr$)) end if talkactivate=0 end if
varr$=noticed$(player.x,player.y) if varr$ > "" then display$= msgs$(val(varr$),val(varr$)) end if
' print #main.textbox, sailingmsg$ if activatebutton = 1 then 'notice "1" mapactivate = 1 activatebutton = 0
end if ' draw=health(health)
if mapactivate = 2 then 'Button for pressing through dialog with npcs ' sailingmsg$ = "" mapactivate = 0 end if
'renew=serverexchange(serverdata)'
'draw = specialbargui(special) 'draw = animations() if sailingmsg$ = " Do you have ship in bottle?" then 'animation ' print #main.gbx, "drawbmp ship1 0 0" 'display=ship(player.x,player.y,shipid) 'else 'animation 'hide=ship(player.x,player.y,shipid) end if 'IF SAILING = 0 THEN
print #main.gbx, "spritexy object6 -60 -60"
' END IF if shimmer > 1 then print #main.gbx, "spritexy object6 -48 -44" shimmer = 0 shimmering = 1 + 1 end if
if shimmering = 5 then shimmer = 0 shimmering = 0 end if
draw$ = inventorygui$(object$) ' #main.gbx "spritexy object7 130 50" 'draw gui abc buttons 'if map$(player.x,player.y) = "w" then 'mapvar$ = "w" 'else 'mapvar$ = "w" 'end if 'draw = display() player.y = player.y + INT(screen.y) map.y = map.y + INT(screen.y) player.x = player.x + INT(screen.x) map.x = map.x + INT(screen.x) pos$ = str$(player.x)+str$(player.y) pos = val(pos$) if abs(screen.y)>=1 Then screen.y = 0 if abs(screen.x)>=1 Then screen.x = 0
if player.x = 3 or player.x = 4 then goto [skip] end if if player.y =3 or player.y = 4 then goto [skip] end if
if mapactivate = 1 then for objl = 1 to obj.n if mapobjectX(player.x, objl) > 0 then if mapobjectY(player.y, objl) > 0 then itemid = 0 'pickup itemid itemid$=quest$(player.x,player.y) itemid = val(itemid$) itemid$ = "" retur = pickup(selected, playerposx,playerposy, itemid, selecteditem, deleteid, pos,objl) if itemid = 1 then display$ = msgs$(itemid, itemid) itemid = 0 end if mapobjectX(player.x, objl) = 0 mapobjectY(player.y, objl) = 0 end if end if next objl mapactivate = 0 end if
if attackactivate = 1 then 'attackactivate = 0 gosub [attacknotimer] end if
[attackreturn] 'if obj.x(l) = player.x obj.y(l) = player.y then 'obj.x(player.x) = 0: obj.y(player.y)=0 'notice "nullremoval" 'poss = 1 'selecteditem = obj.x(player.x) selecteditem = 1 'pickup = pickup(selecteditem,player.x, player.y, selecteditem, deleteid, poss)' ' print #main.gbx, "spritexy sky 0 0"
#main.gbx, "spritetofront object3" #main.gbx, "spritetofront object4" #main.gbx, "spritetofront object5" #main.gbx, "spritetofront object6" #main.gbx, "spritetofront object2" #main.gbx, "spritetofront player"
#main.gbx "DRAWSPRITES"
'if mapactivatef.x,player.y) = 3 then 'type 3- quest notice 'print #main.textbox, "" 'end if 'if mapactivate(player.x,player.y) = 2 then 'cutscene 'print #main.textbox msgs$(pos) 'display = miniclip()'skillid 'end if
[skip] timer 50, [reDo] ' 1 game tic = ms '650 #main.gbx "When characterInput [keys]"
WAIT
[moveMap] 'credit to cundo ' print #main.textbox, "DEBUG XY:";pos$ if player.x = 4 or player.x = 5 then goto [loop] end if
draw = gui() For i =1 To obj SCAN w = tile(i,1) h = tile(i,2) if walk.val<1 Then
#main.gbx "Spritexy obj";i;" ";_ w*TILESIZE-TILESIZE - (screen.x*TILESIZE) - OFFSET; " ";_ h*TILESIZE-TILESIZE - (screen.y*TILESIZE) - OFFSET #main.gbx, "spritevisible obj";i;" off" End if If map.x+w<= map.width AND map.x+w>0 AND _ map.y+h <= map.height AND map.y+h>0 Then #main.gbx "SpriteImage obj";i;" "; trim$( map$(w+map.x,h+map.y));".bmp"
For L=1 to npc.n ' if npc.y(player.y-4) > 0 then ' L = L + 1 ' else #main.gbx "spritexy ";npc.sprite.name$(L);" ";_ (npc.x(L)-map.x-screen.x)*TILESIZE-TILESIZE - OFFSET ;" ";_ (npc.y(L)-map.y-screen.y)*TILESIZE-TILESIZE - OFFSET ' end if
NEXT L
For L=1 to obj.n 'if track(obj.n)=0 then 'obj.n = obj.n+1 'end if
#main.gbx "spritexy ";obj.sprite.name$(L);" ";_ (obj.x(L)-map.x-screen.x)*TILESIZE-TILESIZE - OFFSET ;" ";_ (obj.y(L)-map.y-screen.y)*TILESIZE-TILESIZE - OFFSET NEXT L
For L=1 to item.n #main.gbx "spritexy ";item.sprite.name$(L);" ";_ (item.x(L)-map.x-screen.x)*TILESIZE-TILESIZE - OFFSET ;" ";_ (item.y(L)-map.y-screen.y)*TILESIZE-TILESIZE - OFFSET NEXT L Else ' set the tiles to an empty image #main.gbx "SpriteImage obj";i;" empty.bmp"
End if
Next
if start = 2 then start = 0 'notice "You fell again, away from your crashed ship" end if
draw$ = inventorygui$(object$) 'if player.x > 17 and player.y > 20 then
if map$(player.x,player.y) = "w" then SAILING = 1 goto [animationbase] else SAILING = 0 goto [cont] end if' 'else ' goto [cont] 'end if
[animationbase] modify=0 directionsailing$ = word$(direction$,1)
steptoggle = steptoggle + 1 if steptoggle = 3 then steptoggle = 0 end if
if steptoggle = 2 then
select case directionsailing$
case "UP" 'print #main.gbx, "spriteimage object1 pirate.bmp" print #main.gbx, "spritexy object2 50 40" #main.gbx, "spritescale object2 140" case "RIGHT" '90de 'print #main.gbx, "spriteimage object4 pirater.bmp" print #main.gbx, "spritexy object4 0 -40" #main.gbx, "spritescale object4 140" modify=128 case "DOWN" '180 'print #main.gbx, "spriteimage object2 pirated.bmp" #main.gbx, "spritescale object5 140" print #main.gbx, "spritexy object5 4 10" case "LEFT" '270 modify=128 #main.gbx, "spritescale object3 140" 'print #main.gbx, "spriteimage object3 piratel.bmp" print #main.gbx, "spritexy object3 150 -80"';int(sea$(player.x,player.y)/10)
end select
else
select case directionsailing$
case "UP"
'print #main.gbx, "spriteimage object1 pirate.bmp" print #main.gbx, "spritexy object2 50 40" #main.gbx, "spritescale object2 140"
case "RIGHT" '90de #main.gbx, "spritescale object4 140" 'print #main.gbx, "spriteimage object4 pirater.bmp" print #main.gbx, "spritexy object4 5 -40" modify=128 case "DOWN" '180 'print #main.gbx, "spriteimage object2 pirated.bmp" print #main.gbx, "spritexy object5 4 10"
case "LEFT" '270 #main.gbx, "spritescale object3 140" 'print #main.gbx, "spriteimage object3 piratel.bmp" print #main.gbx, "spritexy object3 147 -83" modify=128 end select
end if
[cont]
goto [loop]
[attackloop] 'meter attack to 250ms and weapontiming beginers = 47 if attacktoggle=1 then attacktime2 = time$("ms") attacktoggle = 0 else attacktime1 = time$("ms") attacktimer = attackime1 attacktoggle = 1 end if
if attacktimer-attacktime2 < index(weapon)-50+beginers and attacktimer-attacktime2 > index(weapon)-50+beginers then 'charges special every hit brute = attacktimer - attacktime2 -index(weapon) brute$= str$(brute) brute = val(brute$) end if
callfunction = attack(attacktime, attacktimer, attacktime1, attacktime2, luck)'timer toggle if callfunction = 1 then gosub [attack] callfunction = 0 end if print #main.textbox, hit renew=serverexchange(serverdata)
goto [branch]
[attack] 'need to register luck and skill Timer 0
[attacknotimer] #main.gbx "When characterInput" if specialactivate = 1 then specialactivate=0 specialvariable = brute selections = luck * 1.33 end if if selections < .5 then weapon = 1 end if if selections < .5 and selections > 1 then weapon = 2 end if if selections < 1 then 'luck from .75 up to 2.0+ adds natual max hit possible to weapon to either 5 weapon = 3 end if if weaponchoice > 3 then weapon = 5 end if if weaponchoice > 7 then weapon = 7 'warlord mask end if
select case weapon case 1 'basic input here, 'specialvariable = brute case 2 'rate = 1 specialindex = 25 '+25 max hit constant case 3 rate = 2 specialindex = 15 '+30 max hit possible case 5 rate = 2 specialindex= 20 '+40 max hit possible case 7 'end game item rate = 999 specialindex = 999 end select
rate = 1 'natural additive 'key timing to correct time will give higher hit, same variable for special attack probabilityvariable = ((((brute-40+beginers) + playeraccuracy + luck * base10)+.1)*((.1*specialvariable)-1))+(rate*specialindex)-2'rnd with positive additive of player trained skill, -2 possiblity to add health, evens function
specialvariable = 0 specialindex = 0 variable = probabilityvariable if variable > (base10/2)*1.3 then 'adds bonus if exptionale accurate, directly from the RND for realisitic play hitbonus = 10 + variable '10 point buffer for allowing not to powerful end if ' if variable < 5 then 'see if 50/50 with accuracy added(max up to 1 to 13-29 "i think") gives hit or not ' print "miss" ' end if
debug=101:debug=debug(debug) hit = variable + hitbonus 'basically grabs postive handi capped "55+" RND adds bonus if accuracy is expectionale accurate over 100, to the handicap with a max of unknown, this gives base 55+/45- type RND sets, allowing for a positive gameplay without "sluggish" hits then times this number by your decimcal (skill level * 7) and divides by 3, this part is hard to explain how it linearized RND to be RND still, it just is because the seed is RND, now out of 100 this is not random, there is a positive value frequency to this code as stated before
'add a little 'luck' here players will gain small amount of luck thru out game and its added to a hidden hit value that could "stack" or add up after every hit if hit < 1 then hit = 5*luck*luck end if debug = 8:debug=debug(debug)
functio = weaponattackgfx(weapontiming,weaponofchoice)'gfx for weapon rotate 45 90 degree
'need parse for multi user current npcs only x$=word$(direction$,2):y$=word$(direction$,3) '1-9map non working xnpc = val(x$) : ynpc = val(y$) 'notice xnpc 'notice ynpc npc = npc(xnpc,ynpc) 'notice npc if npc.x(npc ) > 0 then if npc.y(npc) > 0 then npchealth(xnpc,ynpc)=npchealth(xnpc,ynpc)-50 'hit if npc.x(npc) = npc.y(npc) then ' npc = npc.x(npc) notice npc ' notice npchealth(xnpc,ynpc) end if if npchealth(xnpc,ynpc) < 0 then notice npc(xnpc,ynpc) 'npc(npcx,npcy)=1 #main.gbx, "spritexy ";npc.sprite.name$(npc);" 6400 6400" npc.x( npc )=100 npc.y( npc )=100 npc(xnpc,ynpc)=0 end if end if
end if hit = 20 'peusdo attack debug npchealth(xnpc,ynpc)=npchealth(xnpc,ynpc)-50 npchit = rnd(1)*10*10 npchit = (npchit)*(hit*.015+(luck*.01)) 'notice npchit
health = health - npchit ' notice health;"hp"
attackactivate = 0 'return ai attack
return
[defend] 'space bar defendtime = time$("ms") defendvar = defend(defendtimer, defendtime1, defendtime2, luck) if defendtime < defendvar and defendtime > defendvar then blocknexthit = 1 defendvar = 0 defendtime = 0 end if goto [branch]
[keys] 'credit to cundo Timer 0 k$ = Inkey$ keyValue = asc(right$(k$, 1)) #main.gbx "When characterInput" 'B if player.x=60 and player.y=60 then modify = 128 sailing = 1 wstring$ = "ww" else wstring$ = "w" sailing =0 'option 3 fo sand tiles on islands end if if modify = 128 then #main.gbx, "spritevisible player off" else #main.gbx, "spritevisible player on" end if
walk.val = .5'adds stepped input if noticestep = 1 then notice keyValue steppingnotice = steppingnotice +1 if steppingnotice = 2 then wait end if end if
direction$ = direction$(player.x,player.y,direction) '[right] 'if direction =
'[left] '[down] '[up] select case keyValue case 98 'B Button
parse$ = direction$(player.x,player.x,direction) stringdirection1 = val(word$(parse$,2)) stringdirection2 = val(word$(parse$,3))
for inventory = 1 to 9 if inventory(inventory) = 5 then fishing = 1 end if if inventory(inventory) = 7 then mining=1 end if if inventory(inventory) = 8 then firemaking=1 end if if inventory(inventory) = 9 then smelting=1 end if if inventory(inventory) = 10 then woodcut=1 end if if inventory(inventory) = 11 then cooking=1 end if
next inventory
case 97
parse$ = direction$(player.x,player.x,direction) stringdirection1 = val(word$(parse$,2)) stringdirection2 = val(word$(parse$,3))
for npclook = 1 to npc.n for npclook2 = 1 to npc.n if npc.x(npclook) = stringdirection1 and npc.y(npclook2) = stringdirection2 then talkactivate = 1 end if if npc.x(npclook) = stringdirection1+1 and npc.y(npclook2) = stringdirection2+1 then talkactivate = 1 end if if npc.x(npclook) = stringdirection1-1 and npc.y(npclook2) = stringdirection2-1 then talkactivate = 1 end if if npc.x(npclook) = stringdirection1+1 and npc.y(npclook2) = stringdirection2-1 then talkactivate = 1 end if if npc.x(npclook) = stringdirection1-1 and npc.y(npclook2) = stringdirection2+1 then talkactivate = 1 end if next npclook2 next npclook ' talkactivate = 1 case 32' / ,46delete key
parse$ = direction$(player.x,player.x,direction) stringdirection1 = val(word$(parse$,2)) stringdirection2 = val(word$(parse$,3))
for npclook = 1 to npc.n for npclook2 = 1 to npc.n if npc.x(npclook) = stringdirection1 and npc.y(npclook2) = stringdirection2 then attackactivate = 1 end if if npc.x(npclook) = stringdirection1+1 and npc.y(npclook2) = stringdirection2+1 then attackactivate = 1 end if if npc.x(npclook) = stringdirection1-1 and npc.y(npclook2) = stringdirection2-1 then attackactivate = 1 end if if npc.x(npclook) = stringdirection1+1 and npc.y(npclook2) = stringdirection2-1 then attackactivate = 1 end if if npc.x(npclook) = stringdirection1-1 and npc.y(npclook2) = stringdirection2+1 then attackactivate = 1 end if next npclook2 next npclook
' attackactivate = 1
case 101 'number 5 for input keyvalue if stepping = 0 then noticestep = 1 stepping = 1 else noticestep = 0 end if
case _VK_DOWN direction = -1 if sailing <> 1 then cxx=cxx-32
if player.y + 1 < map.height Then new.pos$ = map$(player.x,player.y+1) If new.pos$<>"r" and new.pos$ <> wstring$ Then 'ww noclip activated screen.y = screen.y + walk.val Else screen.y=0 End if spi = abs(not(spi)) #main.gbx "spriteImage player player";1+spi;".bmp" 'pidid End if end if case _VK_UP cxx=cxx+32 direction = 1 if player.y - 1 >0 Then new.pos$ = map$(player.x,player.y-1) If new.pos$<>"r" and new.pos$ <>wstring$ Then screen.y = screen.y - walk.val Else screen.y=0 End if spi = abs(not(spi)) is$ = sailing$(new.pos$,direction,player.x,player.y) #main.gbx "spriteImage player player";spi+5;".bmp" 'pidid if sailing = 4 then'4- is$ = sailing$(new.pos$,direction,player.x,player.y) end if End if case _VK_LEFT cx=cx+32 direction = 5 if player.x - 1 > 0 Then new.pos$ = map$(player.x-1,player.y) If new.pos$<>"r" and new.pos$ <>wstring$ Then screen.x = screen.x - walk.val Else screen.x = 0 End if spi = abs(not(spi))
if O = -1 then #main.gbx "spriteImage player player";4;".bmp" O = 0 else #main.gbx "spriteImage player player";3;".bmp" O = -1 end if is$ = sailing$(new.pos$,direction,player.x,player.y) 'pidid if sailing = 4 then 'sailing 4 is new ship id is$ = sailing$(new.pos$,direction,player.x,player.y)'shipid end if End if case _VK_RIGHT cx=cx-32 direction = -5 if player.x +1 < map.width Then new.pos$ = map$(player.x+1,player.y) If new.pos$<>"r" and new.pos$ <>wstring$ Then screen.x = screen.x + walk.val Else screen.x=0 End if spi = abs(not(spi))
is$ = sailing$(new.pos$,direction,player.x,player.y) #main.gbx "spriteImage player player";7+spi;".bmp" 'PIDid if sailing = 4 then '4- is$ = sailing$(new.pos$,direction,player.x,player.y) end if End if case _VK_INSERT mapactivate = 1
case _VK_ESCAPE '[escape] to quit or [trapclose] goto [quit.main]
' case 47 'health reset ' special = special - 25 ' health = health - 25 ' if health < 0 then ' health =100 ' special = 100 ' end if
' shimmer = 1 ' if shimmer = 1 then ' shimmer = 0 ' end if 'goto [attackloop] 'case chr$(10) 'L key for special ' special = weapon(weapon,1) ' specialactivate = 1 '
case _VK_CONTROL 'chat input CTRL instead of ENTER"
print #main.textbox, "!contents? textchat$"; print #main.textbox, "!disable" outputchat$ = textchat$ 'OUTPUTCHAT=VAL(CHATPARSE$(OUTPUTCHAT$)'TURN 1-27 ALPHABET INTO 0-27 NUMBERS 0 = " " (space) 28-30+ = . , ; ECT. print #main.textbox, "PRINT #M lol nato sending...." send = loadtext(outputchat) print #main.textbox, "" if debug = 1 then 'debug for adding tiles print #main.textbox, "~" check$ = commands$(outputchat$) else check$ = commands$(outputchat$) end if print #main.textbox, "!enable" 'admin commands restyled into funtionableility end select
'pickup item 'if item.x(player.x) > 0 and item.y(player.y) > 0 then 'if item.x(player.x) = item.y(player.y) then 'func= pickup(selected,player.x,player.y, selecteditem, deleteid, pos) ' end if 'end if
#main.gbx, "spritexy map ";cx;" ";cxx ' #main.gbx "drawsprites" goto [moveMap]
' if debug = 1 then
' end if [activate] 'for x y tile activation
'print #main.textbox, "DEBUG XY:";pos$ '2811 dirt path '715 map teleport 'data 6113 teleport to 6410 vs versa '6210 fishing spot 6209 3718 1211 334 324 344 '247 object '2515 2516 0425 fishing '2112 1719 building '2216 camp fire for cooking '1823-2523 fishing '5918, 5819, 5720 5821, 6217 fishing spot in view of each other
'---------SKILLS INFO TIMERS AND VARIABLES------------------------
[Woodcuting] if skill = 2 then for inventoryslotskill = 1 to 9 if inventory(inventoryslotskill)= woodcuting then woodcut = 1 end if
if woodcut = 1 then inventoryslotskill = 9 end if next inventoryslotskill
if woodcut = 1 then addexp = addxp( 2, 1) 'draw animation end if woodcut = 0 new= newitem(idforlog,itemid) end if [Fishing] if skill = 3 then for inventoryslotskill = 1 to 9 if inventory(inventoryslotskill)= fishingpole then isfishing = 1 end if
if isfishing = 1 then inventoryslotskill = 9 end if next inventoryslotskill
if isfishing = 1 then addexp = addxp( 3, 1) 'draw animation 'show cutscreen isfishing = 0 'single click for now end if
' new= newitem(idforrandomfish(1-X)) 'cutscene
[Mining] if skill = 4 then for inventoryslotskill = 1 to 9 if inventory(inventoryslotskill)= pickaxe then mining = 1 exit for end if next inventoryslotskill
if mining = 1 then addexp = addxp( 4, 2) 'draw animation mining = 0 end if
'new= newitem(idforrock) 'rnd for gems gem= (rnd(1)*100)/.33+4 if gem > 25 then for inventoryslot = 1 to 9
if inventory(inventoyslot) = 0 then inventory(inventoryslot) = 1000+int(rnd(1)*10) '1000 series gems end if 'large rnd for bigger gems next inventoryslot end if end if [Smelting] if skill = 5 then for inventoryslotskill =1 to 8 if inventory(inventoryslotskill)= ore then smelting = smelting + 1 end if next inventoryslotskill
'draw animation for slot = 1 to 8 if inventory(slot)=ore then addexp = addxp( 5, 1) 'deleteitem(slot) 'new=newitem(idforbar) end if 'showsprites next slot end if
end if [Firemaking] if skill = 8 then for inventoryslotskill = 1 to 8 if inventory(inventoryslotskill) = log then lightfire = 1 end if next inventoryslotskill if lightfire = 1 then for inv = 1 to 8 if inventory(inv) = log then 'deleteitem(invtory(inv)) addexp = addxp( 8, 1) map$(player.x,player.y)="f" 'should stay "burning" until log off fire = 1 exitfor = 1 exit for end if if exitfor = 1 then exitfor =0 exit for end if next inv end if end if [Cooking] if skill = 11 then if map$(player.x+dirx,player.y+diry) = "f" then for inv = 1 to 8 for cookfish = 1 to amountoffish if inventory(inv) = rawfish(cookfish) then inventory(inv) = cookedfish(cookfish) addexp = addxp( 11, 1) end if next cookfish next inv end if end if [Herblaw] 'required items 'animation 'maybe xy mapping 'combine items 'new item
[Crafting] 'required items 'animation 'maybe xy mapping 'new item goto [nextpart] '-------------------------------------------------------------------------------END-SKILLS INFO TIMERS AND VARIABLES------------------------ [Luck] 'rnd toggle 1-2 toggle = toggle + 1 if toggle = 2 then luck = oldluck luck = luck + (luck * luck) / .125 toggle = 0 else luck = oldluck end if goto [branch]
[fillseafloor] for x =1 to ram for y= 1 to ram '1- fishing 2 - free 3 free 4 big fish 5 free 6 free 7 fish 8 free 9 run a ground 10 free floor = rnd(1)*10+1 sea(x,y) = floor next y next x
return
[redimm]'reset variables and arrays for new map loading note load file to new string in memory$ then load rest of code itemdata$="" id$="" map.width=0 map.height=0 redim npc.x(100) redim npc.y(100) redim old.npc.x(100) redim old.npc.y(100) redim map$(mapX,mapY) redim tile(1000,1000) 'natoreplacementylol
redim room$(1000,1000) redim room2$(1000,1000)
'dim mapitems(MAPX,MAPY) redim item(totalitems,3) '1 =unsed/id 2=type 3=unsed/unique id for trading redim mapitem(mapX,mapY) redim itemdisplay(totalitems, 2)
redim objdisplay(objcount, 2) redim objdisplay2(objectcount, 2)
redim inventory(8) redim bank(10)
redim specialattack(4)
redim playerfiles$(clientcount, 4)'1=health, 3=hit, 2=npc 4=graphic combo code/id *attire amulets swords ; ect.
player.x=0 player.y=0 playerpos$="" pos=0 pos$="00" if room = 1 then room = 2 gosub [LOADMAPTWO] end if
if room = 2 then room = 1 end if goto [branch]
'------------------------------------------------------------------------ '------------------------------------------------------------------------
[quit.main]'credit: cundo unloadbmp "empty.bmp" bmps = 9 ' for unload = 1 to bmps ' unloadbmp unload$+".bmp" ' next unload unloadbmp "moon.bmp" '15 '16 obj1 obj2
'loading screen 'unloadbmp "gif.bmp" playwave "" for i = 1 To 11 'tiles unloadbmp left$(word$(tile.list$,i),1);".bmp" Next
for i = 1 TO 8 'player id unloadbmp "player";i;".bmp" next ' for i = 14 TO 16 'player id ' unloadbmp i;".bmp" ' next
if npc.n Then FOr L = 1 To npc.n unloadbmp npc.bmp.name$(L) NExt End if
if obj.n Then FOr L = 1 To obj.n unloadbmp obj.bmp.name$(L) NExt End if
if items.n Then FOr L = 1 To items.n unloadbmp items.bmp.name$(L) NExt End if
Close #main 'debug notice "Framework credit, justBasic proforums . com / Member: cundo" END
'------------------------------------------------------------------------ '------------------------------------------------------------------------ ' ' Functions '------------------------------------------------------------------------ function musica(museid) select case museid case 1 playwave "music1.wav" case 2 playwave "music2.wav" case 3 playwave "music3.wav" case 4 playwave "music4.wav" case else playwave "background.wav" end select
end function
function directionparse$(direction$) 'if left$(direction$,1) = "UP" then 'if right$(direction$, 2)=player.x+1 or right$(direction$,2)= player.x-1 then 'if right$(direction$,1) = player.y+1 or right$(direction$,1) = player.y-1 then
'end if 'end if end function
function direction$(player.x,player.y,direction) 'return direction XY pointing select case direction case -1 if map$(player.x,player.y+1) = "w" then sailingmsg$ = " Do you have ship in bottle?" else 'sailingmsg$="" end if direction$ = "DOWN ";str$(player.x);" ";str$(player.y+1)+sailingmsg$
case 1 if map$(player.x,player.y-1) = "w" then sailingmsg$ = " Do you have ship in bottle?" else 'sailingmsg$="" end if direction$ = "UP ";str$(player.x);" ";str$(player.y-1)+sailingmsg$
case 5 if map$(player.x-1,player.y) = "w" then sailingmsg$ = " Do you have ship in bottle?" else 'sailingmsg$="" end if direction$ = "LEFT ";str$(player.x-1);" ";str$(player.y)+sailingmsg$
case -5 if map$(player.x+1,player.y) = "w" then sailingmsg$ = " Do you have ship in bottle?" else 'sailingmsg$="" end if direction$="RIGHT ";str$(player.x+1);" ";str$(player.y)+sailingmsg$
end select
print #main.textbox, direction$ end function
Function addxp(skill,amount) select case skill case 1 skill(1,1) = skill(1,1) + amount case 2 skill(2,1) = skill(2,1) + amount case 3 skill(3,1) = skill(3,1) + amount case 4 skill(4,1) = skill(4,1) + amount case 5 skill(5,1) = skill(5,1) + amount case 8 skill(8,1) = skill(8,1) + amount case 9 skill(9,1) = skill(9,1) + amount case 10 skill(10,1) = skill(10,1) + amount case 11 skill(11,1) = skill(11,1) + amount case else Notice "Fatal Error:";skill END end select End Function
Function msgs$(varr,varrlog) 'notice function for messages for gameplay see array msg$() at top of code and [activate] if logx(varrlog) > 0 then notice message$(varr) logx(varrlog)=0 end if End Function
Function mousehandler()'finds mouse gui area 'unused 'Tile$ = MouseXY.Tilefinder$()
clickarea$ = word$(Tile$,1)
pos = val(word$(Tile$,2))
select case clickarea$
case "inventory" retur$ = inventory.handler$(selected, pos)
case "special" reset = click(lastselected, selected) prime = specialbar(specialbar)
case "four tiles" null = null case "itempickup" playerposx = player.x : playerposy = player.y reset = click(lastselected, selected) retur = pickup(selected, playerposx,playerposy, itemid, selecteditem, deleteid, pos,objl)
case "other" reset = click(lastselected, selected) end select
End Function
function click(lastselected,selected) 'resets selected when click on non clickable area of game/map if lastselected <> 0 then lastselected=0 selected=0 end if
if incombat = 1 then incombat = stopcombat() end if
'delay = pause(lag) debug = 9:debug=debug(debug)
end function
function pause(lag) ' startpausetime = time$("ms") 'for lagg = 1 to lag/div '' null = null 'add a bit of lag here ' next lagg ' pause = time$("ms")-startpausetime end function
Function item.handler(selecteditem, selecteditem, deleteid, pos, playerposx, playerposy) 'here we use a parsing parse parser parsing = inventory(selecteditem) parser = parse(parsing)' find item type id if parser = 2 then '2 = food 'DELETE ITEM, ADD HEALTH deleteid = 1 delete = deleteitem(selected, selecteditem, deleteid, pos, playerposx, playerposy,objl) deleteid = null end if if lastselected = 0 then lastselected = selecteditem selecteditem = 0 else if item(selecteditem,2) = item(lastselected,2) then 'if items second entry id matches nulled = deleteitem(selected, selecteditem, deleteid, pos, playerposx, playerposy,objl)' pos unsed nulled = deleteitem(selected, lastselected, deleteid, pos, playerposx, playerposy,objl)'pos unsed reset = click(lastselected, selected) 'reset click memory new=item(lastselected,2) retur = newitem(new,itemid) 'create new item from matched id end if end if End Function
Function parse(selecteditem) parse = item(selecteditem,2) 'find itemtypeid 0=null/regular item? 1= item 2=food 3= 4+ = new combined item id and .bmp End Function
function ship(player.x,player.y,shipid) 'set shipid everytime ' #main.gbx, "spritexy ship";shipid;" 50 50"
'if map$(player.x,player.y) = "w" then ' #main.gbx, "spritevisible ship";shipid;" on" 'else ' #main.gbx, "spritevisible ship";shipid;" off" 'end if end function
Function MouseXY.Tilefinder$() 'unused needs 64x64 mapping 'get mouse sx mouse y input prase through the 8 inventory post four tiles around player, special bar 'select case <> for each area 'return as three part string item position area string$
MouseX = MX : MouseY = MY
'item pickup if MX > (((SCREEN.WIDTH*64)/2)-32) and MX < (((SCREEN.WIDTH*64)/2)+32) then if MY > ((SCREEN.HEIGHT*64)/2)-32 and MY < ((SCREEN.HEIGHT*64)/2)+32 then pos = 1 END IF END IF
'four tiles - unused
'right hand side if MX > 400 and MX < ram then if MY >100 and MY < 200 then pos = 5 end if end if
if MX > 400 and MX < ram then if MY >300 and MY < 400 then pos = 6 end if end if
if MX > 400 and MX < ram then if MY >400 and MY < ram then pos = 7 end if end if
if MX > 400 and MX < ram then if MY >ram and MY < 600 then pos = 8 end if end if 'right handside/ 'bottom of screen
if MY > ram and MY < 600 then if MX > 100 and MX < 200 then pos = 9 end if end if
if MX > 400 and MX < ram then if MY > 200 and MY < 300 then pos = 10 end if end if
if MX > 400 and MX < ram then if MY > 300 and MY < 400 then pos = 11 end if end if
if MX > 400 and MX < ram then if MY >400 and MY < 500 then pos = 12 end if end if
'end bottom/
'four tiles
'special
if pos = 0 then pos = -1 end if
if pos > 0 and pos < 4 then clickarea$ = "four tiles" 'unused end if
if pos > 4 and pos < 13 then clickarea$ = "inventory" end if
if pos = 14 then clickarea$ = "special" end if
if pos = 15 then clickarea$ = "null" end if
if pos = 1 then clickarea$ = "itempickup" end if
if pos = -1 then clickarea$ = "other" end if
MouseXY.Tilefinder$ = clickarea$;" ";str$(pos)
End Function
Function inventory.handler$(selected, pos) 'returns item id of inventory item at position pos selecteditem = inventory(pos) if selecteditem = 0 then inventory.handler$="0" else inventory.handler$ = item.handler$(selecteditem) end if End Function
function sailing$(new.pos$,direction,player.x,player.y)
if new.pos$ = "w" then if direction <> -1 then boat = boat + 1 if boat > 2 then 'print #main.textbox, sea(player.x,player.y) 'displayship direction gfx ship[direction] end if end if end if end function
Function bank()
End Function
Function gui() 'draw sprite
End Function
Function pickup(selected, player.x, player.y, itemid, selecteditem, deleteid, pos, objl)' single item per square pickup if deleteid then null=null else deleteid = 3 end if func = deleteitem(selected, selecteditem, deleteid, pos, player.x, player.y,objl) 'delete item deleteid = null 'renew=serverexchange(serverdata) 'server exchange data 'notice "" newitem=objl func = newitem(newitem, itemid) 'create new item in inventory selecteditem=0 End function
Function deleteitem(selected, selecteditem, deleteid, pos, player.x, player.y,objl) ' TileX = left$(str$(pos,1)) ' TileY = right$(str$((pos,2))
for objl = 1 to obj.n if mapobjectX(player.x, objl) > 0 then if mapobjectY(player.y, objl) > 0 then #main.gbx, "spritexy ";obj.sprite.name$(objl);" 6400 6400" obj.x(objl)=100 obj.y(objl)=100 exitfor=1 end if if exitfor=1 then objl = obj.n end if end if mapobjectX(player.x,objl)=0 mapobjectY( player.y,objl) =0 next objl
'renew=serverexchange(serverdata)
' if deleteid = 1 then '1 = inventory ' if selected = inventory(pos) then 'debugged ' inventory(pos)=null ' end if ' end if
objl = 0 deleteid = 0 End Function
Function newitem(newitem, itemid)'multi-use selected variable also for new quest items and trade not included currently for inventorys = 1 to 8 if full = 8 then inventorys = 8 'null debug notice "Inventory full" exit for end if inventoryslot = inventoryslot+1 if inventory(inventoryslot) = 0 then 'check if slot is free if not null = null else it is a free slot inventory(inventoryslot) = newitem
inventoryid$(inventoryslot) =str$(itemid) inventorys = 8 else full = full + 1 null = null end if
'if inventory(8) > null then 'notice "item lost full" 'else 'notice "deebug" 'inputs selected data here for new item on next draw ' inventoryslot = 10' exit for ' end if 'make sure draw sprites command renews graphics
next inventorys inventoryslot = 0 newitem = 0 End Function
Function inventorygui$(object$)'draws all ten items via select case
'inventory(4)=1 'items$(4)="object1" 'inventory(5)=1 'items$(5)="object1" 'inventory(6)=1 'items$(6)="object1" 'inventory(7)=1 'items$(7)="object1" 'inventory(8)=1 'items$(8)="object1"
for inventorydraw = 1 to 10
select case inventorydraw
case 1 if inventory(1) > 0 then itemidstring = inventory(1) 'items$(1)="object1" object$ = obj.sprite.name$(itemidstring) ' print object$ print #main.gbx, "spritexy ";object$;" ";TILESIZE;" ";TILESIZE*4 'draw sprite str$(itemidstring) end if case 2 if inventory(2) > 0 then itemidstring = inventory(2)
object$ =obj.sprite.name$(itemidstring) print object$ print #main.gbx, "spritexy ";object$;" ";TILESIZE;" ";TILESIZE*5 'draw sprite str$(itemidstring) end if case 3 if inventory(3) > 0 then itemidstring = inventory(3)
object$ =obj.sprite.name$(itemidstring) print #main.gbx, "spritexy ";object$;" ";TILESIZE*2;" ";TILESIZE*5 'draw sprite str$(itemidstring) end if case 4 if inventory(4) > 0 then itemidstring = inventory(4)
object$ =obj.sprite.name$(itemidstring) print #main.gbx, "spritexy ";object$;" ";TILESIZE*3;" ";TILESIZE*5 'draw sprite str$(itemidstring) end if case 5 if inventory(5) > 0 then itemidstring = inventory(5)
object$ = obj.sprite.name$(itemidstring) print #main.gbx, "spritexy ";object$;" ";TILESIZE*4;" ";TILESIZE*5 'draw sprite str$(itemidstring) end if case 6 if inventory(6) > 0 then itemidstring = inventory(6)
object$ =obj.sprite.name$(itemidstring) print #main.gbx, "spritexy ";object$;" ";TILESIZE*5;" ";TILESIZE*5 'draw sprite str$(itemidstring) end if case 7 if inventory(7) > 0 then itemidstring = inventory(7)
object$ =obj.sprite.name$(itemidstring) print #main.gbx, "spritexy ";object$;" ";TILESIZE*7;" ";TILESIZE*5 'draw sprite str$(itemidstring) end if case 8 if inventory(8) > 0 then itemidstring = inventory(8)
object$ = obj.sprite.name$(itemidstring) print #main.gbx, "spritexy ";object$;" ";TILESIZE*7;" ";TILESIZE*4 'draw sprite str$(itemidstring) end if end select
next inventorydraw End Function
function health(health) select case health
if health < 25 then #main.gbx "spritexy object8 40 20" end if
if health > 30 and health < 49 then #main.gbx "spritexy object9 40 20" end if
if health > 49 and health < 65 then #main.gbx "spritexy object10 40 20" end if
if health > 65 and health < 80 then #main.gbx "spritexy object11 40 20" end if
if health > 80 then #main.gbx "spritexy object12 40 20" end if
end function
Function specialbargui(special) if special = 100 then
#main.gbx "spritexy object17 20 100" 'draw sprite special(1) end if if special = 75 then #main.gbx "spritexy object16 20 100"
'draw sprite special(2) end if ' if special = 66 then 'end if if special = 50 then #main.gbx "spritexy object15 20 100" end if ' if special = 33 then ' end if if special = 25 then #main.gbx "spritexy object14 20 100" end if if special = 0 then #main.gbx "spritexy object13 20 100" 'draw sprite(7) end if End Function
Function gamedatahandler() GameData$ = str$(vvar)'after retriving server data .db and loading to vvar
'set lenindex 'using 10 len string of a number var to indicate animaition bmp set for indexable = 1 to lenindex animationfinder$ =mid$(GameData$, 10, indexable)
if left$(animationfinder$, 2) = "10" then '10 indiates animation code 100100001-109959999 direction 01 animations 0000001 "-" is a invisble logical divider for reading purposes only not code animationgfx$(currentanimations)=right$(animationfinder$,8) end if if left$(datafinder$, 2) = "11" then 'username 8 char usernames$(indexable)=right$(datafinder$,8)'need to maintain GameData$ order with indexable end if
' if left$(datafinder$, 2) = "12" then '12- health Note: health luck skill are all client based non transferring data to server saved on local file; if you want, encypted ' health$(indexable)=right$(datafinder$,3) '7 open variable slots here ' end if
if left$(datafinder$, 2) = "13" then 'hit hit$(indexable)=right$(datafinder$,7) ' 1-4 direction xxyy 2-hit 1-40ish 'one avalible variable here end if
if left$(datafinder$, 2) = "14" then 'playerxy xxyy : 0099 playerxy$(indexable)=right$(datafinder$,4) 'option for second input of quick move being different before being read need to change current loop' end if
if left$(datafinder$, 2) = "17" then ' trade$(indexable)=right$(datafinder$,8)'trade item id 000-999 | direction 1-4 | tradeoffer item id 000-999 example 0012520 item 001 traded for item 520 with direction 2 of player view (to find other player in the data) end if
if left$(datafinder$, 2) = "18" then 'basic chat txt = txt + 1 txt$(txt)=time$("ms");" ";str$(indexable);" ";right$(datafinder$,8) end if
if left$(datafinder$, 2) = "19" then ''19 option gives an addition 8 charcters to message txt$ = txt$(txt) txt$(txt)=txt$;" ";right$(datafinder$,8) end if
if left$(datafinder$, 2) = "20" then ''20 option gives an addition 8 charcters to message 0000... ect is blank txt$ = txt$(txt) txt$(txt)=txt$;" ";right$(datafinder$,8) end if
if left$(datafinder$, 2) = "25" then ' txt$ = txt$(txt) txt$(txt)=txt$;" ";right$(datafinder$,8) end if
next indexable txt=0 End Function
'combat
Function stopcombat() stopcombat = null 'return 0 as if then not allowing combat next loop End Function
Function weaponattackgfx(weapontiming,weaponofchoice) weapontiming = weapontimes(weaponofchoice) timeweapon = time$("ms") 'display weaponbmp(weaponofchoice) middle of screenXY, while time$("ms") < timeweapon+weapontiming ' #main.gbx "spriteImage wgfx wgfx";spi;".bmp" wend 'display bmp2
End function
Function attack(attacktime, attacktimer, attacktime1, attacktime2, luck)'via button if attacktime1 > 0 then if a = 5 then a = 0 end if end if a = a + 1 attacktime = attacktime(a) - luck*luck '16-18 15-19 ' if attacktime+attacktimer<attacktime2+attacktime+luck then '* gotoattack = 1 attacktime = 0 : attacktimer = 0 : attacktime2 = 0 : attacktime1 = 0 ' end if attack = gotoattack End Function
Function defend(defendtimer, defendtime1, defendtime2, luck)'via space bar or key
if defendtime1 > 0 then if b = 5 then b = 0 end if end if b = b + 1
defendtime = attacktime(b) - luck*luck '16-18 15-19 using array for both if defendtime+defendtimer<defendtime2+defendtime+luck and defendtime+defendtimer>defendtime2+defendtime+luck then defend = (defendtime2-defendtime1)/2+luck' defendtime = 0 : defendtimer = 0 : defendtime2 = 0 : defendtime1 = 0 end if End Function
Function specialbar(special) 'mouse click if weaponspecial < special then 'see if there's enough special left special = special - weaponspecial 'subtract special end if incombat = stopcombat() ' require reclick? specialbar = special End Function
'luck
Function limiter(time2,time1,ms,buffer,timestatement) 'need for to be implemneted on a faster machine, possible a more lite weight os if time2-time1 < ms then timestatement = (time2-time1)-int(luck*3+1) limiter = timestatement end if End Function
'filesystem 'see bottom of code datafunction() data function
'animations
Function animations()
'display x y starts and stops 'step program thru loop 8 frames; (4) animation frames twice per theoretical slowed down second 1000ms / 8 'count 'aninum = count ' readnow= loadanimations() 'for ani = 0 to readnow ' print #w.g, "addsprite ";animation$;" "animation1$;" ";animation2$;" "animation3$ ' print #w.g, "cyclesprite ";animation$;" 1" ' print #w.g, "spritemovexy ";animation$;" 4 0" ' loadnanimations = aninum End Function
Function setup() 'credit to cundo #main.gbx "setfocus;" ;_ "When characterInput [keys]; ";_ "Getbmp back.bmp 1 1 10 10;" ;_ "Background back.bmp;" ;_ "DRAWSPRITES" End Function
Function globalint$(playerfile$,downloadfile$,offline$) playerfile$="player" downloadfile$=playerfile$+"A" 'attribute to files, will add "offline" to name if player is not online offline$="OFFLINE"' not used currently End Function
'splashscreen loading menu
Function splashscreen(percentage,TILESIZE, SCREENWIDTH, SCREENHEIGHT, OFFSET, GAMEWIDTH, GAMEHEIGHT,BackgroundColor$,UpperLeftY, UpperLeftX) select case percentage case 1 '11 bmps. 10 with percentages
'start first screen case 5 '5, ect. case 10
case 20
case 30
case 40
case 60
case 67
case 70
case 95
case 98
delay=pauses(lag) 'a bit of epic pause here, hopefully be used later in-game delay=pauses(lag) case 100
case else errornumber = 1 null = noticeerror(errornumber,percentage,null) end end select End Function
'pause function null Function pauses(lag) for paus = 1 to 4 'ready game window delay=pauses(lag) next paus End Function
'extras
Function fps(fps,time,loopx) 'print #main.gbx, "/text fps(";int(actualfps) End Function
'commands unsable right now Function commands$(inputcommand$) 'EXAMPLE: 'ctrl$+map/npc/oject 0X 0Y refID$' then [Enter] key ctrl$ = "S" 'COMMAND KEY INT. -> "S" char. if left$(outputchat$, 1) = ctrl$ then commands = commands + 1 'keep track of commands commandsarray$(commands) = word$(outputchat$,1) commandtype$ = commandsarray$(commands) xmap= val(word$(inputmap$, 2)) ymap= val(word$(inputmap$, 3)) mapcommandtile$ = word$(outputchat$, 4)
print ":COMMANDISSUED:SET>";left$(outputchat$, 4);" ";str$(xmap);" ";str$(ymap);"<"; word$(outputchat$,4) ;">tileRefID$: "
select case commandtype$ case "Smap" map$(xmap,ymap)=mapcommandtile$ 'actual input line command here case "Snpc" ' = val(mapcommandtile$) npc.x(null) =xmap 'update game data here npc.y(null) =ymap 'npc object commands case "Sobject"
case "Sitem"
case else notice "invalid entry" end select
commands$=commandtype$ 'for ref end if End Function 'debug Function debug(debug) if debugnull = 1 then select case debug
case 2 notice frames;" x ";seconds;" seconds / frames (Double Click) [ENTER]" notice "Continue [enter]" 'pause break case 3 print currentplayercount;" current player count" case 4 print (time2-time1);" ms game compiled frame in pause of no input, ";timestatement;" lag/wait until next frame of scaaning input, enter pauses here for verifying SCAN and Input [keys]" timerstatement = timerstatement' - buffer case 5 timerstatement = timerstatement + 1000 * seconds ' wait for debug next frame case 6 print "closing for now 0% upload not featured in code yet" case 7 print playerpos$ 'debug case 8 print hit case 9 print delay delay = 0 case 101 ' print time$("ms") - clickms case 1000 loopx = loopx + 1 clientloop = clientloop + 1
if clientloop = frames*seconds then 'frames = 10 FPS, refer fps() for actual fps clientloop = 0
debug = 2:debug = debug(debug)
timer 1000*seconds, [timer] wait
' text=loadtext() 'load text once per second end if end select debug = 0 'reset debug end if End Function
'fail to load error notice Function noticeerror(errornumber,percentage,null) notice "32x linux only; windows 64/32" select case errornumber case 1 notice "ERROR ";errornumber;" ";percentage;" loaded." case 2 notice "ERROR ";errornumber;" ";null;" loaded." case 3 notice "ERROR ";errornumber;" ";null;" loaded." case else notice "ERROR ";Err$;" ";null;"null number" end select end function
'download every users file of "XX YY" 'add more data here 'now$ = uploadtolan$(updateXY$,npcname$,healthnull,myg) ' currentplayercount$ = playercount$(playerfile$,count$,playercount) 'for PID = 1 to val(currentplayercount$) 'download every users file of "XX YY" 'add more data here ' cache$ = downloadplayerfile$(PID, currentplayercount) 'function downloads pid file and updates npc.x(pid) npc.y(pid) ' playerfiles$(PID) = cache$ 'next PID 'next playercount loop ' updateXY$ = playerpos$(player.x,player.y, screen.y, screen.x, map.x, map.y)
Function serverexchange(serverdata) 'BASIC MODAL LOGIC SET gather= datafunction() 'fileserverformat line1 line2 animtion1 username2 hit1 health2 direction1 trade2 chat 'nulled line '00000001-00002002 = animation1 usernamee " b b" '... - ... hit health '00315205-00402002 = tradeitem003 direction 1 for item 5205 '27010203 = "zaba" chat input 'chat is parsed two charcters at a time with a total of 4 characters serverexchange = gather End Function
Function datafunction() 'actual server End Function
Function serverexchangetrade(userID,player.x,player.y,direction) null = null End Function
Function trade() 'unfinished exchang = serverexchangetrade(userID,player.x,player.y,direction) 'deleteitem(selected) 'newitem()=exchange End Function
' ' A|ways Missing function select$(s$)
if left$(s$,1)="," then nextvarl = 1 end if if right$(s$,1)="," then nextvarr = 1 end if
if nextvar1 = 1 then nextvar1 = 0 select$ = right$(s$,1) s$="" end if
if nextvarr = 1 then nextvarr = 0 select$ = left$(s$,1) s$="" end if if s$<>"" then select$ = s$ end if end function
|
|