Jump to content
  • 0
Alayne

Display cutin from dynamically composed name

Question

Hello peoples,

 

here my problem today.

I'm working on a script where peoples might collect cards through quest.

I can actually do all that, but wanted the results to be display through cutin. I know it's a real pain in the ash, but I was even ready to compose all the combinaison that cards earning may need (which mean basically 5000 cutin, as there's 9 card per page, 100 cards to collect).

 

I compose the name of the cutin to display according to variable results. For instance, as the first page contain cards 1 to 10, I loop through this values to compose a name like "GI_BookPage1_100101010" if the player concerned has cards 1, 4 6 and 8. This leads me to a cutin which corresponds to the page 1 with the specified cards.

 

BUT, and that's the main issue, it won't display. I know the cutin worked, cause if I use the name manually it works, but through the composed name, it doesn't...

 

Any idea?

Share this post


Link to post
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Okay so I guess there's no solution for this issue.

Thanks anyway.

You should really post on how you generated and used the variable in cutin command

Share this post


Link to post
Share on other sites
  • 0

^

I just composed a test case script and it worked calling cutin with both name in variable, or composed right on the spot.

prontera,151,151,0	script	VarTest	2_BULLETIN_BOARD,{
	cutin "kafra_07",2;
	mes "Hello!";
	next;
	cutin "",255;
	mes "Where'd my pic go?";
	next;
	.@var = 7;
	//.@var$ = "kafra" + "_" + "07";
	cutin "kafra" + "_0" + .@var,2;
	mes "Is it here?";
	close;
}

Share this post


Link to post
Share on other sites
  • 0

Yes, it works, thats why I said show how it works on TopicStarter script , mostly there is some typo error

Share this post


Link to post
Share on other sites
  • 0

Sure, here's the treatment I use:

 


	set .@basePageName$, "GI_BookPage" + .@pageIndex + "_";
	for (set .@i,.@startIndex; .@i<.@maxToDisplay; set .@i,.@i+1)
	{
		set .@compare, compare(.@idArrayInString$, ""+.@idCards[.@i]);
		if (.@compare == 0)
		{
			mes "^FF0000 " + .@i + " ~ " + .@name$[.@i] + "^000000";
		}
		else
		{
			mes "^00FF00 " + .@i + " ~ " + .@name$[.@i] + "^000000";
		}
		set .@basePageName$, .@basePageName$ + .@compare;
	}
	debugmes "page: " + .@basePageName$;
	cutin .@basePageName$, 2;

It basically give something like I said on the start topic. If you need the complete thing (with the sql request, the args and so on, just tell me.

Share this post


Link to post
Share on other sites
  • 0

First, does your debugmes display the proper name? Secondly, if it does, does it match your cutin name correctly? Thirdly, if both 1 & 2 are working as intended, try creating a simple version of the script function first.

e.g : Make a menu with 3 options. Option 1 = Show cards 1,2,3. Option 2 = Show card 4,5,6. Option 3 = Show cards 7,8,9. However have it build the cutin name like normal, by using variables instead of sql for the test.

At this point you have nothing to lose out on, a simple check will remove this from the list of possible issues.

Share this post


Link to post
Share on other sites
  • 0

Well I've allready made those test in fact. But I'll answer point by point:

 

So, 1 - yes, the name appeared to be correctly build through the debugmes

2 - yes too, as if I use the cutin command directly with the outputed name, it's displayed correctly

3 - Well I'm not sure to understand what you mean, as it's the same test as point 2 except it's in a menu, right? Thought I'll still give it a try out of sql command to be sure there's no conflict, even though i can see which.

Share this post


Link to post
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.   Restore formatting

  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.

Loading...

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.