Textboxes!
Displaying 1-18 of 18 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
RPGirl

Since I'm not quite ready for the advanced stuff, i think I'll concentrate on the basics. My textboxes can only hold one line of short text. How can I make my textboxes look nicer?

PS-How do I make a database?? @_@



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 17:04:56

rpgking

int boxpic;

void TextBox(string a, string b, string c)
{
int thx, thy; //x & y positions of textbox

boxpic = loadimage("textbox.pcx"); //textbox pic
thx=screenx/2-160;
thy=screeny-65;

unpress(0);
while(!b1)
{
UpdateControls();

Render();
TcopySprite(thx, thy-1, 320, 66,boxpic);
GotoXY(thx+6,thy+5);
PrintString(1,a);
GotoXY(thx+6,thy+24);
PrintString(1,b);
GotoXY(thx+6, thy+43);
PrintString(1,c);
ShowPage();
}
free(boxpic);
}

-------------------------------
See how that worked? With this function, you should be able to display up 3 three lines of text. If you want to print 3 lines, do this:
TextBox("This is an example","of displaying up to",
"3 lines of text!");
Or 1 line:
TextBox("This is just one line.","","");

And see those empty strings on the previous line? That's because those lines don't have any text in them(but you might have already figured that out).

Hope this helped...

-rpgking

P.S. Check out my webpage at www.mastercain.com/rpgking
...and download my demo. You won't be disappointed!



Out of clutter, find simplicity. -Einstein

Posted on 2001-07-06 18:37:25

rpgking

On the above code, I assumed that the textbox pic was 320*66 pixels...

Good luck figuring out Verge2.

-rpgking



Out of clutter, find simplicity. -Einstein

Posted on 2001-07-06 18:38:57

RPGirl

When I try to write with the script you gave me, you know, TextBox("Like this.","",""). I get an error message in MapEd saying, "TEST.VC(8) Unknown token." I don't know what's wrong!!! I'm going to post my test.vc and let you all see if you can figure it out.
I made a .pcx document called textbox.pcx (it's just a black rectangle sized exactly to 320x66). When I try to use V2, and leave aiko's house (a map that leads into the map named test) I CAN'T MOVE!



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 19:12:28

RPGirl

This is my map.vc (test.vc) what's wrong!? @#$%!
event // autoevent
{
palettemorph(0,0,0,0,63); // sets the palette
setplayer(0); // lets you control entity #0 (the one you just spawned)
}
event// 1
{
TextBox("Mina: Hey Aiko! Still Chasing after Li?","","");
TextBox("Aiko: Ahahahahaha.... Yes.","","");
TextBox("Mina: Aiko! You should be worried about"," your mom, not Li!","","");
TextBox("Aiko: Minaaaaaaaaaaaaa!!!","","");
}
event// 2
{
TextBox("Li: Hi Aiko, what's up?","^_^","","");
TextBox("Aiko: N-Nothing!!!","^_^;;","","");
}
event// 3
{
TextBox("Skya: Oh, Aiko... just go home!","","");
TextBox("Aiko: Sure Skya.... o.O","","");
TextBox("Skya: What was that!?","","");
TextBox("Aiko: Nothing...","","");
}
event// 4
{
TextBox("Li's House","","");
}
event// 5
{
TextBox("Aiko's House","","");
}
event// 6
{
TextBox("CASHANK! Cool! A free drink!","","");
}
event// 7
{
UnPress(1);
while(!b1)
{

Map("aikoshou.map");
}
UnPress(1);
}




Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 19:14:58

Roto

Did you even spawn an entity? Cuz if not, not going to work. Also, third line in event 1, you have 4 ""s, should be 3 ""s. Event 2, 1st line, again, should be 3.

The rest seems fine for a hastened skim.




Posted on 2001-07-06 19:28:23

Roto

The unknown token comes from the extra string, by the way.

Since your textbox was basically Textbox(string a, string b, string c), the extra "" threw it off.







Posted on 2001-07-06 19:30:55

RPGirl

-___- yes, in fact I have spawned an entity, but I have to do it within MapEd for some reason beyond my comprehension.



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 19:31:06

rpgking

I'd change event #7 if I were you(and I assume you're trying to switch maps with this?). You should never put a Map() function within a while loop. When you put something in a while loop, it's supposed to happen indefinitely until the condition you gave occurs. In this case, it would end when b1(Enter) is pressed...

But there's no point in putting a Map() statement within a while loop, because it should just be called once(and only once). What you have MAY work, but it's not a good habit(and if it DOES crash, now you know why).

And another thing I noticed is that you have 2 textbox calls that use 4 strings, instead of 3(which I made the limit). One is in event#1, and the other is in event#2. If you leave your code like that, you'll get an unknown token error...

-rpgking




Out of clutter, find simplicity. -Einstein

Posted on 2001-07-06 19:41:46

RPGirl

;_; I fixed that stuff... but i still get the same error message... :'(



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 19:59:53

Roto

Same error. Hmmm, it is still line 8?



Posted on 2001-07-06 20:59:38

RPGirl

yup. ;_;



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 21:10:29

RPGirl

I bet you the problem is in my system.vc... I'll post it... I'm more than sure that's it.



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 21:12:46

Roto

Test.vc (8) means that the error is occuring in line eight of test.vc. This is what I was referring to previously. Sorry in advance if I stated it a bit awkwardly before.

TextBox(
"Mina: Aiko! You should be worried about",
"your mom, not Li!",
"",
"");

See the extra at the end, cut that out and the comma after the thrid "" and it should work fine. Check others as well.

In any case, I'm still here to help.



Posted on 2001-07-06 23:05:40

RPGirl

I think that something is wrong with the system.vc because I think that it doesn't recognize the TextBox command... I have done what you and Gerf told me to, and STILL i get the message!!!!



Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-06 23:21:56

Roto

Hmmm, most likely nothing is wrong with your Textbox. If there was a problem with your Textbox function, it would've spotted it earlier.

But since you're really considered with whether or not your Textbox function, post it here.



Posted on 2001-07-07 01:49:05

RPGirl

event // autoevent
{
palettemorph(0,0,0,0,63); // sets the palette
setplayer(0); // lets you control entity #0 (the one you just spawned)
}

event// 1
{
TextBox("Mina: Hey Aiko! Still Chasing after Li?","","");
TextBox("Aiko: Ahahahahaha.... Yes.","","");
TextBox("Mina: Aiko! You should be worried about"," your mom, not Li!","");
TextBox("Aiko: Minaaaaaaaaaaaaa!!!","","");
}

event// 2
{
TextBox("Li: Hi Aiko, what's up?","^_^","");
TextBox("Aiko: N-Nothing!!!","^_^;;","");
}

event// 3
{
TextBox("Skya: Oh, Aiko... just go home!","","");
TextBox("Aiko: Sure Skya.... o.O","","");
TextBox("Skya: What was that!?","","");
TextBox("Aiko: Nothing...","","");
}

event// 4
{
TextBox("Li's House","","");
}

event// 5
{
TextBox("Aiko's House","","");
}

event// 6
{
TextBox("CASHANK! Cool! A free drink!","","");
}

event// 7
{
UnPress(1);
while(!b1)
{

Map("aikoshou.map");
}
UnPress(1);
}




Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-07 17:46:02

RPGirl

Here is my system.vc:

void TextBox(string a, string b, string c)

{
int thx, thy; //x & y positions of textbox
int boxpic;

boxpic = loadimage("textbox.pcx"); //textbox pic
thx=screenx/2-160;
thy=screeny-65;

unpress(0);
while(!b1)
{
UpdateControls();

Render();
TcopySprite(thx, thy-1, 320, 66, boxpic);
GotoXY(thx+6,thy+5);
PrintString(0,a);
GotoXY(thx+6,thy+24);
PrintString(0,b);
GotoXY(thx+6, thy+43);
PrintString(0,c);
ShowPage();
}
free(boxpic);
}




Que Sera Sera, Whatever will be, will be.-Doris Day, "The Man Who Knew Too Much"

Posted on 2001-07-07 17:48:03


Displaying 1-18 of 18 total.
1
 
Newest messages

Ben McGraw's lovingly crafted this website from scratch for years.
It's a lot prettier this go around because of Jon Wofford.
Verge-rpg.com is a member of the lunarnet irc network, and would like to take this opportunity to remind you that regardless how babies taste, it is wrong to eat them.