Here is the system program
**************************************
*System.prg *
*RPG Toolkit Development System, 2.0 *
*System Library. *
*Copyright 1999 By Christopher B. *
*Matthews *
*****************************************
* This library gives access to extended *
*RPGCode commands. *
*****************************************
*****************************
* #Pause() *
*****************************
* Waits for a key press. *
*Ignores arrow keys. *
*****************************
#Method Pause()
{
#pause_done!=0
#While(pause_done!==0)
{
#Wait(pause_wait$)
#If(pause_wait$~="UP")
{
#If(pause_wait$~="DOWN")
{
#If(pause_wait$~="LEFT")
{
#If(pause_wait$~="RIGHT")
{
#pause_done!=1
}
}
}
}
}
#Kill(pause_done!)
#Kill(pause_wait$)
}
**********************************
* Causes a graphic to move from
* x1,y1 to x2,y2
* mgFilename$ is the filename of the graphic.
* mgspeed! is the speed (1 is fast, 0.5 is slower)
**********************************
#method moveGraphic(mgFilename$, mgx1!, mgy1!, mgx2!, mgy2!, mgspeed!)
{
*calculate delta y and delta x...
#mgDX! = mgx2! - mgx1!
#mgDY! = mgy2! - mgy1!
*calculate slope...
#mgm! = mgDY! / mgDX!
*calculate b...
#mgb! = mgm! * mgx1!
#mgb! = mgy1! - mgb!
*#mwin("<mgx1!>,<mgy1!> <mgx2!>,<mgy2!>")
*
*now we have y = mx + b
#if(mgx1!<=mgx2!)
{
#for (mgc! = mgx1!; mgc! <= mgx2!; mgc! = mgc!+mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#if(mgx1!>mgx2!)
{
#for (mgc! = mgx1!; mgc! > mgx2!; mgc! = mgc!-mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#kill(mgDX!)
#kill(mgDY!)
#kill(mgm!)
#kill(mgb!)
#kill(mgc!)
#kill(mgxx!)
#kill(mgyy!)
#kill(mgFilename$)
#kill(mgx1!)
#kill(mgy1!)
#kill(mgx2!)
#kill(mgy2!)
#kill(mgspeed!)
}
*************************************************
* #NumSetElement(name$, elementnum!, value!) *
*************************************************
* Sets a specific element in a numerical array. *
*************************************************
#Method NumSetElement(sE_Name$, sE_Element!, sE_Value!)
{
#castLit(sE_Element!, sE_LitEle$)
#castLit(sE_Value!, sE_LitVal$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]!"
#sE_com$= "#" +se_Name$+ "="+ se_LitVal$
#RPGCode(se_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value!)
#Kill(sE_com$)
#Kill(sE_LitEle$)
#Kill(sE_LitVal$)
}
*************************************************
* #LitSetElement(name$, elementnum!, value$) *
*************************************************
* Sets a specific element in a literal array. *
*************************************************
#method LitSetElement(sE_Name$, sE_Element!, sE_Value$)
{
#castLit(sE_Element!, sE_LitEle$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]$"
#sE_com$= "#" +se_Name$+ "="+ sE_Value$
#RPGCode(sE_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value$)
#Kill(sE_com$)
#Kill(sE_LitEle$)
}
*************************************************
* #NumGetElement(name$, elementnum!, dest!) *
*************************************************
* Get a specific element in a numerical array. *
*************************************************
#method NumGetElement(gE_Name$,gE_Element!,gE_dest!)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]!"
#gE_com$= "#gE_dest!" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest!)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest!)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
*************************************************
* #LitGetElement(name$, elementnum!, dest$) *
*************************************************
* Get a specific element in a literal array. *
*************************************************
#Method LitGetElement(gE_Name$, gE_Element!, gE_dest$)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]$"
#gE_com$= "#gE_dest$" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest$)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest$)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
alterdimension said:
Here is the system program
**************************************
*System.prg *
*RPG Toolkit Development System, 2.0 *
*System Library. *
*Copyright 1999 By Christopher B. *
*Matthews *
*****************************************
* This library gives access to extended *
*RPGCode commands. *
*****************************************
*****************************
* #Pause() *
*****************************
* Waits for a key press. *
*Ignores arrow keys. *
*****************************
#Method Pause()
{
#pause_done!=0
#While(pause_done!==0)
{
#Wait(pause_wait$)
#If(pause_wait$~="UP")
{
#If(pause_wait$~="DOWN")
{
#If(pause_wait$~="LEFT")
{
#If(pause_wait$~="RIGHT")
{
#pause_done!=1
}
}
}
}
}
#Kill(pause_done!)
#Kill(pause_wait$)
}
**********************************
* Causes a graphic to move from
* x1,y1 to x2,y2
* mgFilename$ is the filename of the graphic.
* mgspeed! is the speed (1 is fast, 0.5 is slower)
**********************************
#method moveGraphic(mgFilename$, mgx1!, mgy1!, mgx2!, mgy2!, mgspeed!)
{
*calculate delta y and delta x...
#mgDX! = mgx2! - mgx1!
#mgDY! = mgy2! - mgy1!
*calculate slope...
#mgm! = mgDY! / mgDX!
*calculate b...
#mgb! = mgm! * mgx1!
#mgb! = mgy1! - mgb!
*#mwin("<mgx1!>,<mgy1!> <mgx2!>,<mgy2!>")
*
*now we have y = mx + b
#if(mgx1!<=mgx2!)
{
#for (mgc! = mgx1!; mgc! <= mgx2!; mgc! = mgc!+mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#if(mgx1!>mgx2!)
{
#for (mgc! = mgx1!; mgc! > mgx2!; mgc! = mgc!-mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#kill(mgDX!)
#kill(mgDY!)
#kill(mgm!)
#kill(mgb!)
#kill(mgc!)
#kill(mgxx!)
#kill(mgyy!)
#kill(mgFilename$)
#kill(mgx1!)
#kill(mgy1!)
#kill(mgx2!)
#kill(mgy2!)
#kill(mgspeed!)
}
*************************************************
* #NumSetElement(name$, elementnum!, value!) *
*************************************************
* Sets a specific element in a numerical array. *
*************************************************
#Method NumSetElement(sE_Name$, sE_Element!, sE_Value!)
{
#castLit(sE_Element!, sE_LitEle$)
#castLit(sE_Value!, sE_LitVal$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]!"
#sE_com$= "#" +se_Name$+ "="+ se_LitVal$
#RPGCode(se_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value!)
#Kill(sE_com$)
#Kill(sE_LitEle$)
#Kill(sE_LitVal$)
}
*************************************************
* #LitSetElement(name$, elementnum!, value$) *
*************************************************
* Sets a specific element in a literal array. *
*************************************************
#method LitSetElement(sE_Name$, sE_Element!, sE_Value$)
{
#castLit(sE_Element!, sE_LitEle$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]$"
#sE_com$= "#" +se_Name$+ "="+ sE_Value$
#RPGCode(sE_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value$)
#Kill(sE_com$)
#Kill(sE_LitEle$)
}
*************************************************
* #NumGetElement(name$, elementnum!, dest!) *
*************************************************
* Get a specific element in a numerical array. *
*************************************************
#method NumGetElement(gE_Name$,gE_Element!,gE_dest!)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]!"
#gE_com$= "#gE_dest!" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest!)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest!)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
*************************************************
* #LitGetElement(name$, elementnum!, dest$) *
*************************************************
* Get a specific element in a literal array. *
*************************************************
#Method LitGetElement(gE_Name$, gE_Element!, gE_dest$)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]$"
#gE_com$= "#gE_dest$" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest$)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest$)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
alterdimension said:
Here is the system program
**************************************
*System.prg *
*RPG Toolkit Development System, 2.0 *
*System Library. *
*Copyright 1999 By Christopher B. *
*Matthews *
*****************************************
* This library gives access to extended *
*RPGCode commands. *
*****************************************
*****************************
* #Pause() *
*****************************
* Waits for a key press. *
*Ignores arrow keys. *
*****************************
#Method Pause()
{
#pause_done!=0
#While(pause_done!==0)
{
#Wait(pause_wait$)
#If(pause_wait$~="UP")
{
#If(pause_wait$~="DOWN")
{
#If(pause_wait$~="LEFT")
{
#If(pause_wait$~="RIGHT")
{
#pause_done!=1
}
}
}
}
}
#Kill(pause_done!)
#Kill(pause_wait$)
}
**********************************
* Causes a graphic to move from
* x1,y1 to x2,y2
* mgFilename$ is the filename of the graphic.
* mgspeed! is the speed (1 is fast, 0.5 is slower)
**********************************
#method moveGraphic(mgFilename$, mgx1!, mgy1!, mgx2!, mgy2!, mgspeed!)
{
*calculate delta y and delta x...
#mgDX! = mgx2! - mgx1!
#mgDY! = mgy2! - mgy1!
*calculate slope...
#mgm! = mgDY! / mgDX!
*calculate b...
#mgb! = mgm! * mgx1!
#mgb! = mgy1! - mgb!
*#mwin("<mgx1!>,<mgy1!> <mgx2!>,<mgy2!>")
*
*now we have y = mx + b
#if(mgx1!<=mgx2!)
{
#for (mgc! = mgx1!; mgc! <= mgx2!; mgc! = mgc!+mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#if(mgx1!>mgx2!)
{
#for (mgc! = mgx1!; mgc! > mgx2!; mgc! = mgc!-mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#kill(mgDX!)
#kill(mgDY!)
#kill(mgm!)
#kill(mgb!)
#kill(mgc!)
#kill(mgxx!)
#kill(mgyy!)
#kill(mgFilename$)
#kill(mgx1!)
#kill(mgy1!)
#kill(mgx2!)
#kill(mgy2!)
#kill(mgspeed!)
}
*************************************************
* #NumSetElement(name$, elementnum!, value!) *
*************************************************
* Sets a specific element in a numerical array. *
*************************************************
#Method NumSetElement(sE_Name$, sE_Element!, sE_Value!)
{
#castLit(sE_Element!, sE_LitEle$)
#castLit(sE_Value!, sE_LitVal$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]!"
#sE_com$= "#" +se_Name$+ "="+ se_LitVal$
#RPGCode(se_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value!)
#Kill(sE_com$)
#Kill(sE_LitEle$)
#Kill(sE_LitVal$)
}
*************************************************
* #LitSetElement(name$, elementnum!, value$) *
*************************************************
* Sets a specific element in a literal array. *
*************************************************
#method LitSetElement(sE_Name$, sE_Element!, sE_Value$)
{
#castLit(sE_Element!, sE_LitEle$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]$"
#sE_com$= "#" +se_Name$+ "="+ sE_Value$
#RPGCode(sE_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value$)
#Kill(sE_com$)
#Kill(sE_LitEle$)
}
*************************************************
* #NumGetElement(name$, elementnum!, dest!) *
*************************************************
* Get a specific element in a numerical array. *
*************************************************
#method NumGetElement(gE_Name$,gE_Element!,gE_dest!)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]!"
#gE_com$= "#gE_dest!" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest!)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest!)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
*************************************************
* #LitGetElement(name$, elementnum!, dest$) *
*************************************************
* Get a specific element in a literal array. *
*************************************************
#Method LitGetElement(gE_Name$, gE_Element!, gE_dest$)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]$"
#gE_com$= "#gE_dest$" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest$)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest$)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
alterdimension said:
Here is the system program
**************************************
*System.prg *
*RPG Toolkit Development System, 2.0 *
*System Library. *
*Copyright 1999 By Christopher B. *
*Matthews *
*****************************************
* This library gives access to extended *
*RPGCode commands. *
*****************************************
*****************************
* #Pause() *
*****************************
* Waits for a key press. *
*Ignores arrow keys. *
*****************************
#Method Pause()
{
#pause_done!=0
#While(pause_done!==0)
{
#Wait(pause_wait$)
#If(pause_wait$~="UP")
{
#If(pause_wait$~="DOWN")
{
#If(pause_wait$~="LEFT")
{
#If(pause_wait$~="RIGHT")
{
#pause_done!=1
}
}
}
}
}
#Kill(pause_done!)
#Kill(pause_wait$)
}
**********************************
* Causes a graphic to move from
* x1,y1 to x2,y2
* mgFilename$ is the filename of the graphic.
* mgspeed! is the speed (1 is fast, 0.5 is slower)
**********************************
#method moveGraphic(mgFilename$, mgx1!, mgy1!, mgx2!, mgy2!, mgspeed!)
{
*calculate delta y and delta x...
#mgDX! = mgx2! - mgx1!
#mgDY! = mgy2! - mgy1!
*calculate slope...
#mgm! = mgDY! / mgDX!
*calculate b...
#mgb! = mgm! * mgx1!
#mgb! = mgy1! - mgb!
*#mwin("<mgx1!>,<mgy1!> <mgx2!>,<mgy2!>")
*
*now we have y = mx + b
#if(mgx1!<=mgx2!)
{
#for (mgc! = mgx1!; mgc! <= mgx2!; mgc! = mgc!+mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#if(mgx1!>mgx2!)
{
#for (mgc! = mgx1!; mgc! > mgx2!; mgc! = mgc!-mgspeed!)
{
#mgxx! = mgc!
#mgyy! = mgm! * mgxx! + mgb!
#scan(mgxx!,mgyy!,0)
#put(mgxx!, mgyy!, mgFilename$)
*#delay(0.1)
#mem(mgxx!, mgyy!, 0)
}
}
#kill(mgDX!)
#kill(mgDY!)
#kill(mgm!)
#kill(mgb!)
#kill(mgc!)
#kill(mgxx!)
#kill(mgyy!)
#kill(mgFilename$)
#kill(mgx1!)
#kill(mgy1!)
#kill(mgx2!)
#kill(mgy2!)
#kill(mgspeed!)
}
*************************************************
* #NumSetElement(name$, elementnum!, value!) *
*************************************************
* Sets a specific element in a numerical array. *
*************************************************
#Method NumSetElement(sE_Name$, sE_Element!, sE_Value!)
{
#castLit(sE_Element!, sE_LitEle$)
#castLit(sE_Value!, sE_LitVal$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]!"
#sE_com$= "#" +se_Name$+ "="+ se_LitVal$
#RPGCode(se_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value!)
#Kill(sE_com$)
#Kill(sE_LitEle$)
#Kill(sE_LitVal$)
}
*************************************************
* #LitSetElement(name$, elementnum!, value$) *
*************************************************
* Sets a specific element in a literal array. *
*************************************************
#method LitSetElement(sE_Name$, sE_Element!, sE_Value$)
{
#castLit(sE_Element!, sE_LitEle$)
#sE_Name$=se_Name$+"["+sE_LitEle$+"]$"
#sE_com$= "#" +se_Name$+ "="+ sE_Value$
#RPGCode(sE_com$)
#Kill(sE_Name$)
#Kill(sE_Element!)
#Kill(sE_Value$)
#Kill(sE_com$)
#Kill(sE_LitEle$)
}
*************************************************
* #NumGetElement(name$, elementnum!, dest!) *
*************************************************
* Get a specific element in a numerical array. *
*************************************************
#method NumGetElement(gE_Name$,gE_Element!,gE_dest!)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]!"
#gE_com$= "#gE_dest!" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest!)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest!)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
*************************************************
* #LitGetElement(name$, elementnum!, dest$) *
*************************************************
* Get a specific element in a literal array. *
*************************************************
#Method LitGetElement(gE_Name$, gE_Element!, gE_dest$)
{
#castLit(gE_Element!, gE_LitEle$)
#gE_Name$=ge_Name$+"["+gE_LitEle$+"]$"
#gE_com$= "#gE_dest$" + "="+ gE_Name$
#RPGCode(gE_com$)
#ReturnMethod(gE_dest$)
#Kill(gE_Name$)
#Kill(gE_Element!)
#Kill(gE_dest$)
#Kill(gE_com$)
#Kill(gE_LitEle$)
}
here is the start program
*******************************************************
**
** Basic Startup Program.
** ----------------------
**
** Look for all lines commented as TBD (to be done)
** to see what you should change.
**
*******************************************************
*******************************************************
* Some initial settings. Maybe you want to change these...
#Fontsize(12)
#itemwalkspeed("slow")
#walkspeed("slow")
#mediaplay("vip - title2.mid")
#characterspeed(2)
#bold("on")
*******************************************************
#BorderColor(0,0,0)
#Fade(1)
*******************************************************
* TBD: Play a title screen file here...
* #MidiPlay("mysong.mid")
*******************************************************
#Clear
*******************************************************
* Draws the title screen...
#drawtitle()
*******************************************************
*******************************************************
* Waits for the user to choose something...
#done!=0
#While(done!=0)
{
#MouseClick(x!,y!) *waits for a mouse click and returns x y coords
#CheckButton(x!,y!,opt!) *checks if we clicked a button
#if (opt!=0)
{
*'new game' clicked
#Color(15)
* TBD: You might want to change the message window graphic...
#WinGraphic("mwin.jpg") *Message window graphic
#Fontsize(12)
#done!=1
#selectGraphics()
#history()
#end
}
#if (opt!=1)
{
*'load game' clicked
#dirsav(dest$)
#if(dest$~="CANCEL")
{
#load(dest$)
#done!=1
#end
}
}
#if (opt!=2) {#dos}
}
#end
*******************************************************
* This method draws the title screen...
*******************************************************
#method drawtitle()
{
#Fade(1)
#Clear
* TBD: Set some graphic for your title screen graphic.
#Bitmap("title.gif")
#WinGraphic("mwin.jpg")
* TBD: Maybe you want to change these buttons...
#setbutton("new.jpg", 0,123,45,125,30)
#setbutton("load.jpg",1,248,45,125,30)
#setbutton("quit.jpg",2,373,45,125,30)
}
* TBD: Put a stroy here...
#method history()
{
*Main story
#MWin("Long, long ago, the land of Hylanka was guarded by")
#MWin("a legendary jewel. One day, things changed...")
#Wait(a$)
}
#method selectGraphics()
{
#bold("off")
#clear
#fontsize(25)
#Italics("on")
#Text(1,1,"Graphics Mode Selection")
#Italics("off")
#ColorRGB(255, 0, 0)
#DrawLine(2,30,600,30)
#ColorRGB(150, 0, 0)
#DrawLine(3,31,599,31)
#ColorRGB(100, 0, 0)
#DrawLine(4,32,598,32)
#fontsize(16)
#ColorRGB(255,255,255)
#Text(3,5,"The RPG Toolkit can draw graphics in different ways.")
#Text(3,6,"Please select the mode you want to use:")
#fontsize(20)
#Bold("on")
#text(7,8,"1 - Parallaxing off (fast!)")
#text(7,9,"2 - Parallaxing on (slower, but with parallax effects)")
#bold("off")
#fontsize(14)
#text(20,15,"Press 1 or 2")
#done! = 0
#while(done! = 0)
{
#wait(a$)
#if(a$="1")
{
#parallaxMode! = 2
#done! = 1
}
#if(a$="2")
{
#parallaxMode! = 1
#done! = 1
}
}
#parallax(parallaxMode!)
#bold("on")
#fontsize(20)
}