Strange Behavior
Displaying 1-4 of 4 total.
1
Please enter a numerical value for the importance of this sticky.
Enter 0 to unsticky.
Browciu

First of all I would like to say Hi to this community :)

I have a problem with Verge3.

Well this function doesn't do much, but from what you can see it should display items that are in the possesion of the player. I wanted to use var 'cosik' to increment only when the quantity of the item (which is var ilosc in my language). But when ingame the list just flashes before my eyes disappearing below the screen like crazy. If I replace 'cosik' with 'i' as y-pos modifier all displays fine (in a sense, that it doesn't ruin the display). I hope you understood my problem, and know the reason :>

void itmmenu()
{
int i;
int cosik=0;
while(!b2)
{
render();
for(i=0;i<8;i++)
{
if(ilosc[i]>0)
{

printstring(10,10+10*cosik,screen,0,name[i]);
printstring(100,10+10*cosik,screen,0,str(ilosc[i]));
cosik++;
}
}
showpage();
}

}

Posted on 2005-05-05 16:13:48

ThinIce

What's wrong with using i ?

the problem is that you're not resetting the value of cosik when you go back through the while loop.

A simple adjustment:

void itmmenu()
{
int i;
int cosik;
while(!b2)
{
cosik=0; // ADD THIS HERE!!!
render();
for(i=0;i<8;i++)
{
if(ilosc[i]>0)
{
printstring(10,10+10*cosik,screen,0,name[i]);
printstring(100,10+10*cosik,screen,0,str(ilosc[i]));
cosik++;
}
}
showpage();
}
}


However using cosik is rather pointless because i is doing the same thing, judging from your code this is a mere display and isn't for any data manipulation.

Posted on 2005-05-05 16:24:37 (last edited on 2005-05-05 16:26:48)

Browciu

OMG so true ;]
But using 'i' will result in holes in display. If I won't have item 2,3,5,6, then there will be blank spaces when 'i' would have 2,3,5,6 values.

Posted on 2005-05-05 16:38:42

ThinIce

tru

Posted on 2005-05-05 16:46:33


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