Client Effects
by Aaron Murray · in Torque Game Engine · 02/27/2002 (12:26 pm) · 4 replies
Alright, here's the situation... What would be the best way to go about sticking client effects into the game, for example, some particles jumping out at where the player is aiming after he casts a spell. Should I use the script's messageAll function to send a "create particles" message or something, or is there another method reserved for things such as client effects and so on. Any help would be appreciated, thanks!
#2
Badguy: those are just ways of messaging clients, Ive used em for hud popups and stuff, but there's no hard and fast rule about what they are for.
Phil.
02/27/2002 (1:09 pm)
I'm with badguy here, best to make a weapon class, call it a spell class, derive lots of things from it.Badguy: those are just ways of messaging clients, Ive used em for hud popups and stuff, but there's no hard and fast rule about what they are for.
Phil.
#3
02/27/2002 (4:08 pm)
Hmm, alright, thanks for help... I'll look into that!
#4
MessageAll (And other messages) are structured with a "callback" in them which can be used to send variables to the client.
eg.. callback = "MsgBla
ServerSide
Client Side
This can be useful for making the clients "attach" and run functions when certain things happen. An example is when another client joins the game, the message is send to all clients who attach to the callback and run their respective functions client side.
:)
02/27/2002 (5:35 pm)
I woudl agree with Badguy and Phil but just for clarification of BadGuys Question.MessageAll (And other messages) are structured with a "callback" in them which can be used to send variables to the client.
eg.. callback = "MsgBla
ServerSide
messageClient(%client,'MsgBla',"this is the text", %a, %b, %c);
Client Side
function handleBlaData(%type, %msg, %a, %b, %c)
{
echo("data = ",%a," ",%b," ",%c);
}
addMessageCallback( 'MsgBla', handleBlaData );This can be useful for making the clients "attach" and run functions when certain things happen. An example is when another client joins the game, the message is send to all clients who attach to the callback and run their respective functions client side.
:)
Torque Owner Badguy
would be a weapon ..
and from that you can create the desired particle effect
as for the messageAll, messageClient..
im sure this is for relaying text messages to the output window only?
correct me if im wrong please..