Game Development Community

messageClient ? BEGINNER

by james burch · in Torque Game Engine · 04/21/2016 (7:44 pm) · 7 replies

hello , all ,
In a message function or 2 , an argument that gets passed is a simple %1 or %2 or %1:%2 . Could you bother to enlighten me just a bit please . and I thank you . Have a nice day .

About the author

Bare-Bones beginner , 49 yrs old , sooo im setting my sights on becoming an accomplished hobbyist with the patient cooperatin of the kindly knowledge folks . and THANK YOU :)


#1
04/22/2016 (11:22 am)
You will need to provide more precise details for a complete answer as all of this is thoroughly covered in the documentation and Torquescript references.
#2
04/22/2016 (7:21 pm)
Thank you Mr Love for your valuable time ,
Sry , I guess its a little hard for me to explain . It'll say something like , theCmdfunction('messageclient" , c0 whatevemsg %1)...
basically . It appears to me to be some sort of html kind of syntax with the c0 thing but its the %1 part that i really have no idea :) really . Im at this point because im interested in the messages related to inventory messages such as the pickup message . TY and very kind of you to bother
. bet that really cleared it up :)
#3
04/22/2016 (8:08 pm)
Hmm, it really depends on the context; I've never seen arguments like c0 whatevermsg %1 UNLESS they are separated by commas.

Provide an exact example from source and we'll figure it out!
#4
04/23/2016 (11:55 am)
Thank you , that I will do then ,
messageclient(%client, 'msgClientJoined',\c2Welcome ! To The Torque Demo App %1.',%client.name,%client%client.sendguid, etc) semiColon:)

and here , Mr Love , is one that just got me thinking more , after looking more closely at the first example , as i was gathering these two samples .

chatMessageAll(client,'\c4%1: %2', Client.name , text) semiCologne

Mr Love , Is it that they refer to the following variable/s ?
In the first case to client.name and , in the second case , the senders name and the variable stuffed with the text string called text ? or no! wrong for the elevendy millionth time ..TODAY! ?


And , again , I thank you very much for your time , Mr. Love
#5
04/23/2016 (12:23 pm)
Quote: Is it that they refer to the following variable/s ?
Yes, you got that right!

Let's go over the second example as it is a bit more straightforward.

chatMessageAll is the function name, obviously.

All the following text are arguments. Each argument is separated by a comma.

%client refers to the client ID. Even on a single machine, T3D runs a server and creates a client which connects to the server. This helps because whether you build for single-player or online/lan multiplayer, the code structure remains the same.

The second argument '\c4%1: %2' is a tagged string, as indicated by the ' symbol. It is a string which is meant to be sent across the network, packaged for this very purpose.

\c4 means that the following text should be of color 4, whatever that is.

%1 : %2 is similar to how you format printf output in C, C++.

%1 refers to the first following argument : %client.name
%2 refers to the second following argument : text

So the complete string could be evaluated as ClientName: text

The first example you've provided is what write "Welcome To the Torque Demo App Playername!" in the upper left message log in T3D.

Again, all of this is thoroughly covered in tutorials and documentation. Make sure to visit The T3D wiki. It take time and dedication but anyone can do it!
#6
04/24/2016 (9:35 am)
Mr Love you are the MAN!
Typically , I would not post beyond your your Extremely helpful response but this time I just want to assure you that I appreciate your help . So , if you would , please , just add one more reply to this thread so other in the future can see that Noteable Mr. Simon Love is the final word !. TY

EDIT
well ... you can dismiss that request as I see that the forum list doesnt actually show the repliers name .anyway thanks a lot!:)
#7
04/24/2016 (4:18 pm)
Oh now I get it! I didn't understand the goal of having last words :)

Any question you ask will be helpful to others going through the same challenges so keep asking!