Author Topic: (no subject)  (Read 1894 times)

DarkElite

  • Member
  • *
  • Posts: 1452
    • View Profile
    • http://cryosoft.mysticsoftware.net/Home.html
(no subject)
« 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$)
« Last Edit: December 31, 1969, 06:00:00 PM by DarkElite »
DarkElite

Dei vobem omniam proditiverunt.  Iam vobis quis deposcibitis sacrificium rersum vitae est!

Cesque

  • Member
  • *
  • Posts: 2178
    • View Profile
    • http://cesque.mysticsoftware.net
(no subject)
« Reply #1 on: December 06, 2003, 12:18:16 PM »
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
« Last Edit: December 31, 1969, 06:00:00 PM by Cesque »
TKGB cancelled Spyder.

Bastard.

DarkElite

  • Member
  • *
  • Posts: 1452
    • View Profile
    • http://cryosoft.mysticsoftware.net/Home.html
(no subject)
« Reply #2 on: December 06, 2003, 01:11:00 PM »
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...

Code: [Select]
#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
« Last Edit: December 31, 1969, 06:00:00 PM by DarkElite »
DarkElite

Dei vobem omniam proditiverunt.  Iam vobis quis deposcibitis sacrificium rersum vitae est!

DarkElite

  • Member
  • *
  • Posts: 1452
    • View Profile
    • http://cryosoft.mysticsoftware.net/Home.html
(no subject)
« Reply #3 on: December 06, 2003, 01:12:11 PM »
*#load battle is one of my custom commands  :rolleyes:
« Last Edit: December 31, 1969, 06:00:00 PM by DarkElite »
DarkElite

Dei vobem omniam proditiverunt.  Iam vobis quis deposcibitis sacrificium rersum vitae est!

Cesque

  • Member
  • *
  • Posts: 2178
    • View Profile
    • http://cesque.mysticsoftware.net
(no subject)
« Reply #4 on: December 06, 2003, 05:13:48 PM »
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...
« Last Edit: December 31, 1969, 06:00:00 PM by Cesque »
TKGB cancelled Spyder.

Bastard.

DarkElite

  • Member
  • *
  • Posts: 1452
    • View Profile
    • http://cryosoft.mysticsoftware.net/Home.html
(no subject)
« Reply #5 on: December 07, 2003, 08:52:35 AM »
does anyone else no? Wink
« Last Edit: December 31, 1969, 06:00:00 PM by DarkElite »
DarkElite

Dei vobem omniam proditiverunt.  Iam vobis quis deposcibitis sacrificium rersum vitae est!

Dont_Think_So

  • Member
  • *
  • Posts: 76
    • View Profile
(no subject)
« Reply #6 on: December 09, 2003, 09:05:57 PM »
Easy Smile.



Code: [Select]
#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.
« Last Edit: December 31, 1969, 06:00:00 PM by Dont_Think_So »