Mystic Software Forums
Miscellaneous => Archives => Archive => Topic started by: DarkElite on December 06, 2003, 12:06:27 PM
-
how would i set a variable into an image and into a include program?
#setimage(enemy1$stance.bmp,30,30,64,64)
#include ("enemy1$.prg")
** enemy1$ is a set name for an enemy ina method...like #method
battle(enemy1,enemy2$)
-
Hmm, I don't get it completely but...
1. Putting #method into a file and then including the file includes the method.
2. To execute program named XXX use #rpgcode(XXX), of course first do things like
#program$ = "#" + variable$ + "! = 1"
#rpgcode(program$)
Did I got your point? No? Whoa. Sad
-
i dont no....what im trying to do is put a variable into an image filename, and into a program name...
here's a small part of my program...
#Method Battle(enemy1$,enemy2$,enemy3$,bkg$,midi$)
{
#Include("BattleManager.prg")
#Include("BattleMethods.prg")
#Include("system.prg")
#TargetLocation(lastx!,lasty!)
#SaveScreen()
#MidiRest()
#Bitmap("White.bmp")
#BorderColor(255,255,255)
#Wav("Thunder.wav")
#Delay(.1)
#RestoreScreen()
#BorderColor(0,0,0)
#MidiPlay(midi$)
#Delay(2)
#Clear()
#LoadBattle(enemy1$,enemy2$,enemy3$,bkg$)
****enemy image setting****
#If (enemies!=1){#setimage("+enemy1$+"stance.bmp,30,30,64,64)}
you see...at the part where it will set the image of the enemy...i dont want to have to change the file name every time...so im trying to input the variable "enemy1$", into the bmp name....... and the same with a program so i can access info on the enemy while only having to type in the name for the parameters
(#Battle(Zombie,Bat,Dead,"Cave.bmp,"Battle.mid") )
*thats what the command would look like when done
-
*#load battle is one of my custom commands :rolleyes:
-
Hmmm... I dunno... As for longer parts of code, it's good to make them methods included in a different program...
You should ask Xorlak (on his message board) or someone...
-
does anyone else no? Wink
-
Easy Smile.
#Moose$ = "#filename$=" + enemy1$ + ".bmp"
#rpgcode(moose$)
#setimage(filename$,30,30,64,64)
First, Moose$ contains the command that would set filename$ to enemy1.bmp (where enemy1 is the variable's value). Then, #rpgcode executes teh command in Moose$, so it sets filename$ to that value. Finally, setimage takes advantage of teh set variable (filename$), and adds it to its values.
Hope that helped Smile.