Jump to content
  • 0

Some scripting Questions.


CrucifiedDeath

Question


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

PLEASE! For scripters or programmers only.

 

1. What programming language does ragnarok is/are currently using?

 

2. Is it possible to call the variable name of the player's name?

 

For example:

 

String PlayerNameVariable = Crucified Death

 

System.out.println("New Player: " + PlayerNameVariable);

 

Output: NewPlayer: Crucified Death

 

if you can understand the system block above, basically I want to add some kind of a "Title" before the player's name.

The language that I used above is java language.

 

That's all.

 

 

Please for experienced scripters or programmers only.

 

 

I'm a programmer my self and knows how to code. But there are some elements that are missing or I didn't know still.

 

THANK YOU GUYS FOR ALL THOSE WHO ARE INTERESTED TO HELP :)!

 

More power rAthena!

 

Shout out to Emistry :)

Link to comment
Share on other sites

18 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

modifying the player name from the database should do the trick.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

What do you mean by modifying? Ok here's the full explaination. Think about it as a BTS quest. Every part that they complete, they will have a title before the player's IGN. I can somehow do the npc script but I don't know how to call the player's name variable (if there's something like that).

 

For example, a specific player completed the first part of the BTS quest which for example is the Valk Helm. after the quest, their name will be "VH Holder Crucified Death" something like that.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  88
  • Reputation:   10
  • Joined:  01/15/16
  • Last Seen:  

PLEASE! For scripters or programmers only.

 

1. What programming language does ragnarok is/are currently using?

 

2. Is it possible to call the variable name of the player's name?

 

For example:

 

String PlayerNameVariable = Crucified Death

 

System.out.println("New Player: " + PlayerNameVariable);

 

Output: NewPlayer: Crucified Death

 

if you can understand the system block above, basically I want to add some kind of a "Title" before the player's name.

The language that I used above is java language.

 

That's all.

 

 

Please for experienced scripters or programmers only.

 

 

I'm a programmer my self and knows how to code. But there are some elements that are missing or I didn't know still.

 

THANK YOU GUYS FOR ALL THOSE WHO ARE INTERESTED TO HELP :)!

 

More power rAthena!

 

Shout out to Emistry :)

 

 

1.- Ragnarok use two types of programming languajes, the game SOURCE its on C and the scripts that you can found in /npc (npc, minor functions, and another things that the players see directly for example) are in "Athena", a lenguaje created for ragnarok itself. its easy to learn and every function and commands for the scripts are in the file doc/script_commands.txt

 

2.- If you want to create a title before the name, or edit all the name, you can edit the source, you can find what are you looking for in src/map/clif.c in the function void clif_charnameack (int fd, struct block_list *bl), i'm sure that you will not have problems finding the way to do this, but if you have problems just PM me

Edited by Enthr
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

my pseudo for that would be,

 

save the original name from database

if quest == completed then

newname = title+originalname
update char name of the character from the character database to newname

Downside of this would be a constant name changing.

Edited by benching
Link to comment
Share on other sites

  • 0

  • Group:  Content Moderator
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  639
  • Reputation:   596
  • Joined:  11/25/11
  • Last Seen:  

Enthr said what I was about to.
Also, take some time to take a close look on the doc folder, all the Script Commands and AtCommands that may be used, avoiding Source Snippets, are listed and explained there.

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can use getnameditem

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  88
  • Reputation:   10
  • Joined:  01/15/16
  • Last Seen:  

PD: Dont forget that the new name to show cant exceed 24 characters

and in the method that i'm saying, the original player name will not change, only the visible name for the players who put the cursor in him


PDD: (And in the scripts, if you only want to know the name of the character for what i was reading in your reply to benching, just use strcharinfo(0))

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

@Enthr
yep, but if he use the method i said, using strcharinfo(0) will cause,
newname = title+(title+newname); // this will happen on 2nd name change and up.

 

with all the info you know from src,

kind of jealous here /heh lol, i should touch src soon

Edited by benching
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

Ok guys thanks but I think you're going on the wrong direction.

 

What I'm trying to say here is if the player completed my custom quest, it'll broadcast the player's name and there will be a "title" added before the player's name.

 

Rank 1 = Newbie

Rank 2 = Seasonal

Rank 3 = Addicted

Rank 4 = Pro

Rank 5 = God

 

If a player completed the 1st quest, the title "Newbie" will be added to his/her name.

eg: Newbie Player

If a player completed the 2nd quest, the title "Seasonal" will be added to his/her name.

eg: Seasonal Player

 

...

 

Also, I want it to be automatic not manually. Manual changing or customizing will be hell of an effort.

 

The quest will be a chain quest. You cant do the Rank 4 quest if you're currently on the Rank 2 quest.

Edited by CrucifiedDeath
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

what you ask is how to add prefix/title to player name,
we give you possible ways to do it, i didn't know you were asking for a whole script.

 

 

if you want to know more, go for @haziel's suggestion,

Enthr said what I was about to.
Also, take some time to take a close look on the doc folder, all the Script Commands and AtCommands that may be used, avoiding Source Snippets, are listed and explained there.


or go to wiki: https://rathena.org/wiki/

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

Lol sorry I'm not asking for a whole script. I'm only asking for how to add a title before the player's name

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

switch ( rank_level ) {
	case 1: .@rank_title$ = "Rank 1"; break;
	case 2: .@rank_title$ = "Rank 2"; break;
	case 3: .@rank_title$ = "Rank 3"; break;
	case 4: .@rank_title$ = "Rank 4"; break;
	default:
		.@rank_title$ = "Default Title"; 
		break;
}
announce "Congratulation to ["+.@rank_title$+"] "+strcharinfo(0)+" for completed the quests.",bc_all;

you could try something like this.

of course there are alot of ways to do this as well.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

Hi Emistry! :). I want the title or prefix for the player to be permanent. Even if the player logged out and in, there's still the title or prefix. Not just in broadcast, but also when you hover on some player's name, there will be a prefix.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  88
  • Reputation:   10
  • Joined:  01/15/16
  • Last Seen:  

So if you want it to be permanent you can just change the name adding the prefix. ¿How do you change it when the player level up? just use explode and change the first term in the new array.

You can see how the explode works in the doc.

If you dont want to change the name of the character, and just only add the prefix like when you hover on a character, you need to change the things that i say in the source and do a function in the scripts to comprobate when you wanna do a broadcast o a thing like that.


Also, the variable that emistry is using, is permanent to the character, it will not go when it logout

Edited by Enthr
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

Wait I'm at school. Please don't close this topic yet. I'll let you guys know if there's any progress. Cheers!~

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  12
  • Topics Per Day:  0.00
  • Content Count:  120
  • Reputation:   48
  • Joined:  07/23/13
  • Last Seen:  

Maybe this is what you want. Try it :)

function<TAB>script<TAB>Func_RefreshRank<TAB>{
switch ( rank_level ) {
case 1: .@rank_title$ = "Seasonal"; break;
case 2: .@rank_title$ = "Addicted"; break;
case 3: .@rank_title$ = "Pro"; break;
case 4: .@rank_title$ = "God"; break;
default:
.@rank_title$ = "Newbie";
break;
}
atcommand "@fakename "+strcharinfo(0)+" - "+.@rank_title$;
return;
}

Just simply run this function "Func_RefreshRank" after you change your rank_level variable.

 

Maybe you need this too. A suggestion:

This will auto change the name for you when character enter a map.

-<TAB>script<TAB>RankSystem<TAB>-1,{
OnPCLoadMapEvent:
Func_RefreshRank();
}
Edited by yuchinin
  • Upvote 1
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  8
  • Reputation:   0
  • Joined:  02/17/16
  • Last Seen:  

Guys sorry if I don't have time trying out your suggestion. I'm kinda busy because of school activities and project. But I will try them all as long as I'm done with my school activities.


Please don't close this topic yet.

 

Thank you!

 

Shout out to Emistry :)

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  26
  • Topics Per Day:  0.01
  • Content Count:  350
  • Reputation:   43
  • Joined:  09/07/12
  • Last Seen:  

 

Maybe this is what you want. Try it :)

function<TAB>script<TAB>Func_RefreshRank<TAB>{
switch ( rank_level ) {
case 1: .@rank_title$ = "Seasonal"; break;
case 2: .@rank_title$ = "Addicted"; break;
case 3: .@rank_title$ = "Pro"; break;
case 4: .@rank_title$ = "God"; break;
default:
.@rank_title$ = "Newbie";
break;
}
atcommand "@fakename "+strcharinfo(0)+" - "+.@rank_title$;
return;
}

Just simply run this function "Func_RefreshRank" after you change your rank_level variable.

 

Maybe you need this too. A suggestion:

This will auto change the name for you when character enter a map.

-<TAB>script<TAB>RankSystem<TAB>-1,{
OnPCLoadMapEvent:
Func_RefreshRank();
}

 

using @fakename will hide the guild name

Edited by benching
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...