Jump to content
Eternal Lands Official Forums
Sign in to follow this  
fred_penner

Click to talk

Recommended Posts

I'd like to be able to click on a player and have the "/playername" appear in the console. Some players have screwed up names and it's hard to type them in, especially if they're walking away...

Share this post


Link to post
Share on other sites

hmm, not a bad idea in fact. maybe have it trigger by typeing / and then looking at a person as that passes the name to the text display anyways...

Share this post


Link to post
Share on other sites

I would suggest associate it with the right click of the mouse in the default (walk) mode...

 

I started to write a code for do it... (just for fun, if anyone wants to use it or if anyone wants to put that in game, i will put the final code here...)

I am just trying to find now how to write the /Username in the command field... and how to get the username...

Share this post


Link to post
Share on other sites

Almost getting there... Found a very interestign function in the code, why noone told me about it??? lol.. is VERY usefull!!!

 

If You type "//" that is reclaced by /Player, where player is the last player you have pmed... Very usefull, isnt it? Should be announced, i thought lol...

Share this post


Link to post
Share on other sites

I use that already.. it's been implemented for a long time :P

Think the manuak says something about it? maybe not.......

Share this post


Link to post
Share on other sites

Well... I am trying hard to find it.... But didnt found it yet... Maybe anyone could help me?

 

How can i get the name of the player under the mouse? I developed the function to make the fred_penners suggestion, but i am havind problems in getting the players name... Something like last_pm_name (the fuction i wrote works fine with that variable lol...) But that is not what i want... I tried to find a similar variable that has the name of the player under the mouse in other files but found nothing...

 

Her is the fuction usign the last_pm_name (put it in the check_mouse_click function in interface.c, together with the //TRADE, //ATACK, etc...

 


//PM

if((current_cursor==CURSOR_EYE && right_click) || (action_mode==action_look && left_click))

 {

	 if(object_under_mouse==-1)return;

	 if(thing_under_the_mouse!=UNDER_MOUSE_PLAYER)return;

	 int i;

	 int l=strlen(last_pm_from); //last_pm_from need to be changed to a variable that has the name of the player under the mouse...

	 input_text_line[input_text_lenght++]='/';	//and a space after it

	 for(i=0;i<l;i++)input_text_line[input_text_lenght++]=last_pm_from[i]; //last_pm_from need to be changed to a variable that has the name of the player under the mouse...

	 input_text_line[input_text_lenght]=' ';	//and a space after it

	 input_text_line[input_text_lenght+1]='_';

	 input_text_line[input_text_lenght+2]=0;

	 input_text_lenght++;

	 return;

 }

 

BTW: I DONT TAKE ANY RESPONSABILITIES IF YOU USE MY CODE AND IT DAMAGES YOUR GAME :wink:

Share this post


Link to post
Share on other sites

Ok, i am almost there... i can now pick names from the actors_list (thankz Saderz for guiding me...), just dont understood (yet) how it works lol.... Looks like the way i did picks something like a random player name lol... And i need to find outo how to pick JUST the name, without the guild ID...

 

Whell...But now i have no time, I am going to university now, if anyone continued to write the code let me know...

 

//PM

if((current_cursor==CURSOR_EYE && right_click) || (action_mode==action_look && left_click))

 {

	 if(object_under_mouse==-1)return;

	 if(thing_under_the_mouse!=UNDER_MOUSE_PLAYER)return;

	 int i;

	 int l=strlen(actors_list[UNDER_MOUSE_PLAYER]->actor_name);

	 input_text_line[input_text_lenght++]='/';	//and a space after it

	 for(i=0;i<l;i++)input_text_line[input_text_lenght++]=actors_list[UNDER_MOUSE_PLAYER]->actor_name[i];

	 input_text_line[input_text_lenght]=' ';	//and a space after it

	 input_text_line[input_text_lenght+1]='_';

	 input_text_line[input_text_lenght+2]=0;

	 input_text_lenght++;

	 return;

 }

 

Btw, if anyone is asking "why is he doing that if Ent could write the code in one minute?", the answer is: Just because I am interested in learning how the game was made, and i think trying to make small things will help more than just reading codes.... ;-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×