Jump to content


Photo

Next2 Script Command


  • Please log in to reply
4 replies to this topic

#1 javierlog08

javierlog08

    Advanced Member

  • Members
  • PipPipPip
  • 85 posts
  • Emulator:Hercules
  • Github:javierlog08

Posted 26 March 2014 - 05:45 PM

I had a problem like in this old Post From Rathena...
 
I got the solution to solve that problem, that is usually generated after  a menu choice.
 
Then in most of cases is imposible delete the Text after choice an item from the menu.
Seems that just append to existing npc's dialog.


Posted Image
 
So.....
 
I create this new function called next2, Wich cleans the old text before choice a new menu item.
trun/src/map/script.c
BUILDIN(next2){	TBL_PC* sd;	int fd;	sd = script->rid2sd(st);	fd = sd->fd;	if( sd == NULL )		return true;	clif->scriptclear(sd,sd->npc_id);	return true;}AND APPENDvoid script_parse_builtin(void) {	struct script_function BUILDIN[] = {		// NPC interaction		BUILDIN_DEF(mes,"s*"),		BUILDIN_DEF(next,""),		BUILDIN_DEF(close,""),		BUILDIN_DEF(close2,""),		BUILDIN_DEF(menu,"sl*"),		BUILDIN_DEF(select,"s*"), //for future jA script compatibility		BUILDIN_DEF(prompt,"s*"),		BUILDIN_DEF(next2,""), //Javierlog08 NEXT comand simulation without CLICK next button from client                .....................................

 

i just append to my script  next2 after choice an menu item 
 

mes "Que nivel de jugador tienes?";if(select("Usuario Experto:Principiante")==1) { next2; cutin "jpn_anni02",2; mes "^9933ff[Rates]^000000"; mes "^A0A0A0~Usa el comando @rates^000000"; mes "^9933ff[Cartas MVPs]^000000";


END RESULT:

Posted Image


Edited by javierlog08, 30 March 2014 - 06:44 PM.


#2 Mysterious

Mysterious

    Advanced Member

  • Administrators
  • 3656 posts
  • LocationProntera ;3
  • Github:Mystery

Posted 26 March 2014 - 10:13 PM

Although you're showing a NPC, you're not dealing with a script; you're editing the source. Thus, will be moved to source releases.

http://upaste.me a paste site with Athena syntax!
Now with the ability to test your athena pastes!


#3 Whimmyd89

Whimmyd89

    Newbie

  • Members
  • Pip
  • 4 posts
  • Emulator:Hercules

Posted 27 March 2014 - 08:51 PM

Its bit unnecessary modify source code for that, you just need to put a "next" before use menu commands. This "problem" as you say only happens when you use "select" or "menu" right after "mes".

But anyway, this command can reduce some lines of code.

Edited by Whimmyd89, 27 March 2014 - 08:53 PM.


#4 sbk_

sbk_

    Advanced Member

  • Members
  • PipPipPip
  • 90 posts
  • LocationSão Paulo - Brasil
  • Emulator:Hercules
  • Github:https://github.com/SoulBlaker

Posted 27 December 2014 - 01:02 PM

fd? who is waging uses.

 

work:

BUILDIN(next2){	TBL_PC* sd;	sd = script->rid2sd(st);	if( sd == NULL )		return true;	clif->scriptclear(sd,sd->npc_id);	return true;}


#5 IeYasuru

IeYasuru

    Newbie

  • Members
  • Pip
  • 6 posts
  • Emulator:Hercules

Posted 08 May 2015 - 04:09 PM

 As @Whimmyd89 mentioned, it's a neat idea, but kinda pointless. Just put "next;" before you use select()/prompt()/menu; and you get the same result basically, albeit with a next button to click before the menu pops up. And anyway, in my opinion, depending on the dialogue between the NPC and the player with menu selections, appending text to the message box after a menu selection (up to a reasonable limit so scrolling isn't necessary, or at least kept to a minimum) makes the "conversation" flow, like the player and NPC are having an actual conversation. But, that's just my personal preference at least.






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


This topic has been visited by 176 user(s)