A problem with the 'player' variable....
Displaying 1-5 of 5 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
AKSepter01

There is a predefined variable called player, if I am not mistaken. I am trying to make a function (a textbox) where if the player is where the textbox will appear (y



Posted on 2001-01-28 12:27:13

TheGerf

You can't use the less than or greater than signs, it cuts off the code, see your post.



TheGerf, not just any gerf.

Posted on 2001-01-28 14:38:38

AKSepter01

OK, Repost.
I have this idea to make a textbox where if the player is behind the textbox (which would be y=80 or less) than the textbox is displayed at the bottom of the screen, instead. I got it to work, except for the 'player' variable... If I am not mistaken, this should work right=

//dis be the textbox function. duh
int textboxim;
void TextBox(string line1, string line2, string line3, string line4)
{
textboxim = LoadImage("textbox.gif");//loads image
while (!b1)
{
if (entity.y[player]*less than*=80);
{
Render();
CopySprite(0,0,320,80,textboxim);
GotoXY(4,4); PrintString(0,line1);
GotoXY(4,23); PrintString(0,line2);
GotoXY(4,42); PrintString(0,line3);
GotoXY(4,61); PrintString(0,line4);
ShowPage();
UpdateControls();
free(textboxim);
}
else
{
Render();
CopySprite(0,160,320,80,textboxim);
GotoXY(4,164); PrintString(0,line1);
GotoXY(4,183); PrintString(0,line2);
GotoXY(4,202); PrintString(0,line3);
GotoXY(4,221); PrintString(0,line4);
ShowPage();
UpdateControls();
free(textboxim);
}
}
}

However, the scriptor complains about the 'player' variable, even though it SHOULD always equal the player's sprite/entity number. If anybody knows how to work around this, can they tell me?
Thanks!



Posted on 2001-01-28 19:44:01

el_desconocido

It may be the board playing tricks, or a typo, but I think the problem may be the extra ; after your if()

if (entity.y[player]*less than*=80); <-- that one.

Sometimes the compiler gets confused, and doesn't actually point you to the problem.

<ps> you can use &lt; and &gt; to have the board show < and > respectively.</ps>



-Pontifex
"How many rocks are there, in the whole world?"

Posted on 2001-01-28 20:05:02

AKSepter01





-------------------------------- "Even monkey fell tree." -Japanese proverb

Posted on 2001-01-28 20:11:37


Displaying 1-5 of 5 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.