Jump to content
  • 0

How to make next/previous options?


Santino

Question


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  198
  • Reputation:   47
  • Joined:  08/01/12
  • Last Seen:  

so i have this script when you click to an npc it shows pictures using this :

this is the script i'm currently using: ''idea from the_sign_quest script''

- script Danica Torres 111,{

callfunc "F_UpdateSignVars";

cutin "danica_1",4;

mes "^3355FFDanica Torres^000000";

next;

cutin "danica_1",255;

cutin "danica_2",4;

mes "^3355FFDanica Torres^000000";

next;

cutin "danica_2",255;

cutin "danica_3",4;

mes "^3355FFDanica Torres^000000";

next;

cutin "danica_3",255;

cutin "danica_4",4;

if (!sign_q) set sign_q,1;

mes "^3355FFDanica Torres^000000";

close2;

cutin "danica_4",255;

end;

}

Yes, it is working, but what i want is, to have a "next/previous/close" options in the menu so that i can browse back to the previous photo or to the next one, or close it.

really noob at scripting :P need some help

Link to comment
Share on other sites

4 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

prontera,155,188,0	script	test	910,{
set .@i, 1; // start with "danica_1"
do {
	if (.@i == 0) set .@i, 4; // #1, Previous wraps around to #4
	if (.@i == 5) set .@i, 1; // #4, Next wraps around to #1

	// remove old image and show current one
	cutin "",255;
	cutin "danica_"+.@i, 4;

	// _____1___2_3________4
	select("Next::Previous:Close");
	set .@i, .@i - (@menu - 2);
} while (@menu != 4);
cutin "",255;
close;
}

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  198
  • Reputation:   47
  • Joined:  08/01/12
  • Last Seen:  

Thank you sir.

but what will i change in this script if i want to add more photos?

like making it to 16 photos, cuz i think i messed up when changing the 4's to 16 XD

what should i change?

& btw, when clicking the close option, the pic is not remove.

Edited by Santino
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  75
  • Topics Per Day:  0.02
  • Content Count:  2223
  • Reputation:   593
  • Joined:  10/26/11
  • Last Seen:  

Make your images follow the filename format:

danica_1

danica_2

danica_3

danica_4

danica_5

danica_6

danica_7

danica_8

danica_9

danica_10

danica_11

...

then you just have to edit these lines:

        if (.@i == 0) set .@i, 4;
       if (.@i == 5) set .@i, 1;

Change 4 to the number of photos you have. (16)

Change 5 to [the number of photos] plus one. (17)

& btw, when clicking the close option, the pic is not remove.

oops, I fixed it and updated post #2. Thanks!

Edited by Brian
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  25
  • Topics Per Day:  0.01
  • Content Count:  198
  • Reputation:   47
  • Joined:  08/01/12
  • Last Seen:  

Make your images follow the filename format:

danica_1

danica_2

danica_3

danica_4

danica_5

danica_6

danica_7

danica_8

danica_9

danica_10

danica_11

...

then you just have to edit these lines:

		if (.@i == 0) set .@i, 4;
	if (.@i == 5) set .@i, 1;

Change 4 to the number of photos you have. (16)

Change 5 to [the number of photos] plus one. (17)

I have done all of that sir, & it's messed up hmm, it's like when clicking the next buttons, it just stops on the 1st photo.

here's the current script.:

lunette,132,134,3 script Danica Torres 910,{

set .@i, 1; // start with "danica_1"

do {

if (.@i == 0) set .@i, 16; // #1, Previous wraps around to #4

if (.@i == 17) set .@i, 1; // #4, Next wraps around to #1

// remove old image and show current one

cutin "",255;

cutin "danica_"+.@i, 4;

// _____1___2_3________4

select("Next::Previous:Close");

set .@i, .@i - (@menu - 2);

} while (@menu != 4);

cutin "",255;

close;

}

@edit

Oh forgot about changing the

} while (@menu != 4);

4 into 16. PROBLEM SOLVED Thx alot!

@edit v2 XD

It's ok now, but the close button is not working LOL haha. another prob XD

when clicking close button, it's functioning as next lol

i guess i'll just remove the close option =) in Next::Previous:Close thx again!

Edited by Santino
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...