Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Scrolling? (https://forums.graalonline.com/forums/showthread.php?t=24592)

lordhelmut 02-26-2002 03:33 AM

Scrolling?
 
I am working on a bank menu and it uses showimg (Shrimp helped me make it nice). Im wondering how to use showimg so that u can hold left or right and scroll between 0 and playerrupees. So like it would show:

How much to Deposit:
>0
Done

And you hold left or right and it adds 1. Im trying to think of how to do this and then for Withdrawl


How much to Withdrawl:
>0
Done

and it scrolls between max money they have deposited and 0

lordhelmut 02-26-2002 03:52 AM

// NPC made by Stalin
if (playerenters) {
message Deposit;
setstring playerdeposit,0;
}
if (playertouchsme) {
disabledefmovement;
setani idle,;
showimg 510,@Arial@b@ENTER THE AMOUNT TO DEPOSIT,(screenwidth/2)-80,(screenheight/2-120);
showimg 511,@Arial@>#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100);
showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80);
changeimgvis 510,4;
changeimgvis 511,4;
changeimgvis 512,4;
timeout=.05;
}
if(timeout){
if(keydown(3)&&strtofloat(#s(playerdeposit))<playe rrupees){
setstring playerdeposit,#v(strtofloat(#s(playerdeposit))+1);
showimg 511,@Arial@b@>#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100);
timeout=.05;
}
if(keydown(2)){
showimg 511,@Arial@b@#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100);
showimg 512,@Arial@b@>Done,(screenwidth/2)-80,(screenheight/2-80);
timeout=.05;
}
timeout=.05;
}

I tried but it no worked =(

Lomgren 02-26-2002 08:12 AM

Here is what I noticed,

- left is keydown(1)
- the first showimgs dont have all the bicus in them
- you only need to set the timeout once, at the end before you
end the if
- showimgs in timeout, see above
- change
NPC Code:
showimg 511,@Arial@b@>#v(#s(playerdeposit)),(screenwidth/2)-80,(screenheight/2-100); 


into
NPC Code:
showimg 511,@Arial@b@>#v(strtofloat(#s(playerdeposit))),(screenwidth/2)-80,(screenheight/2-100); 



Other than that I don't see anything wrong

joseyisleet 02-26-2002 11:12 AM

-=Josey=-
I know this isn't scripting related, but, Lomgren where in Missouri do you live?

lordhelmut 03-01-2002 03:48 AM

for some reason if I hit a key it disappears

Lomgren 03-01-2002 04:39 AM

I think my graal is messed up, alot of scripts aren't working when they should... I live in Jefferson Count, hyuh

Saga2001 03-01-2002 05:45 AM

Lomgren
Senior Member, Anti-Spam

how did u get that?

nyghtGT 03-01-2002 05:47 AM

Quote:

Originally posted by Saga2001
Lomgren
Senior Member, Anti-Spam

how did u get that?

someone is making em for people cause Loriel had one a while back that said Guest ...

edit:
*i think*

Phenom1K 03-01-2002 08:07 AM

Index it, then save it. Then just use the key functions to go back and forth between 1 and variablehere. When it reaches the end and the player presses the forward button again, just rewind all the way back to 1 yo.

Faheria_GP2 03-01-2002 08:41 AM

he joined in March, when you could set status without having 1000 posts

Lomgren 03-01-2002 09:27 AM

*Note* read the first part of my sig, I am not really Lomgren...

user13-xo 03-01-2002 02:05 PM

This works:

// NPC made by Stalin
if (playerenters) {
message Deposit;
}
if (playertouchsme) {
playerdeposit=0;
disabledefmovement;
showimg 510,@Arial@b@ENTER THE AMOUNT TO DEPOSIT,(screenwidth/2)-80,(screenheight/2-120);
showimg 511,@Arial@>#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100);
showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80);
this.mode=1;
this.mode4=0;
this.mode2=1;
timeout=.05;
}

if(timeout && this.mode==1 && this.mode4==0){
setani idle,;
if(this.mode2==1){
showimg 511,@Arial@>#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100);
}else{
showimg 511,@Arial@#v(playerdeposit),(screenwidth/2)-80,(screenheight/2-100);
}

if(this.mode2==2){
showimg 512,@Arial@>Done,(screenwidth/2)-80,(screenheight/2-80);
}else{
showimg 512,@Arial@Done,(screenwidth/2)-80,(screenheight/2-80);
}

changeimgvis 510,4;
changeimgvis 511,4;
changeimgvis 512,4;

if(keydown(0)){
this.mode2=1;
this.mode3=1;
timeout=.05;
}
if(keydown(2)){
this.mode2=2;
this.mode3=0;
timeout=.05;
}
if(keydown(3) && playerdeposit<playerrupees && this.mode3==1){
playerdeposit+=1;
timeout=.05;
}
if(keydown(1) && playerdeposit>0 && this.mode3==1){
playerdeposit-=1;
timeout=.05;
}
if (keydown(4) && this.mode2==2) {
enabledefmovement;
hideimg 510;
hideimg 511;
hideimg 512;
this.mode4=1;
}
timeout=.05;
}

lordhelmut 03-02-2002 07:09 AM

I wasnt really looking to have it all made for me but thanks man. No one else would help and you did =D

user13-xo 03-02-2002 07:45 AM

No problem. I was bored cause i cant connect to graal.


All times are GMT +2. The time now is 02:10 PM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.