Hell Posted December 6, 2012 Posted December 6, 2012 Is it possible to make a label that change. For example Prontera,59,50,4 script npcnamewqe 100,{ If(something)goto main menu; else goto .@varlable$ main menu: Mes ""; Input .@varlable$ Close; Quote
KeyWorld Posted December 6, 2012 Posted December 6, 2012 No you can't store a label into a variable, you will save its value (numerical) but not it's type. But as far I know you can send a label as an argument to a function or return a label from a function. Well, I think you should re-organize your code to avoid using this structure 2 Quote
Euphy Posted December 6, 2012 Posted December 6, 2012 Would this not work the same way? input .@str$; if (.@str$ == "menu1") {} else if (.@str$ == "menu2") {} else {} Quote
Ryokem Posted December 6, 2012 Posted December 6, 2012 Would this not work the same way? input .@str$; if (.@str$ == "menu1") {} else if (.@str$ == "menu2") {} else {} I think he want to jump in different labels depending on the input. Ex: you input "hello", and you jump to hello: label. There's a nice way to do this, just use functions instead of labels, getd() and callfunc to recall that particular label. Honestly, I did similar things long ago in eAthena and it worked fine, so I believe this can work on rAthena as well. Quote
Euphy Posted December 6, 2012 Posted December 6, 2012 There's a nice way to do this, just use functions instead of labels, getd() and callfunc to recall that particular label. Functions aren't labels either, and I can't see why conditionals wouldn't be a better solution. Quote
Ryokem Posted December 6, 2012 Posted December 6, 2012 Functions aren't labels either, and I can't see why conditionals wouldn't be a better solution. He wanted to make it dynamically, that's why if() statements wouldn't be enough I think. Quote
KeyWorld Posted December 7, 2012 Posted December 7, 2012 Or you can use: input .@label$; doevent strnpcinfo(3) + "::" + .@label$; end; But I still think there is no need to jump to a dynamic label if your code is structured. 1 Quote
Ryokem Posted December 7, 2012 Posted December 7, 2012 Or you can use: input .@label$; doevent strnpcinfo(3) + "::" + .@label$; end; But I still think there is no need to jump to a dynamic label if your code is structured. Agree. Quote
Question
Hell
Is it possible to make a label that change.
For example
Prontera,59,50,4 script npcnamewqe 100,{
If(something)goto main menu;
else goto .@varlable$
main menu:
Mes "";
Input .@varlable$
Close;
7 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.