This may be considered slightly hackish but here goes:
Make a server side console command by adding this at the bottom of
your server class:
static ConCommand
armar_set_model_transparency("armar_set_model_transparency" ,
setModelTransparency, "Set the transparency for a model", 0);
Then add a corresponding method in the same class:
void setModelTransparency(void) {
if(engine->Cmd_Argc() == 3){
char* model_name = engine->Cmd_Argv(1);
byte alpha = (byte) atoi(engine->Cmd_Argv(2));
if(strlen(model_name) > 0) {
//Msg("Trying to set the transparency on model %s to
%d\n",
model_name, alpha);
CBaseEntity* aModel =
dynamic_cast<CBaseEntity*>(gEntList.FindEntityByName( NULL,
model_name));
if(!aModel) {
Warning("Didn't find entity %s..can't set
transparency\n", model_name);
} else {
//Msg("Got the base entity\n");
aModel->SetRenderMode(kRenderTransColor);
aModel->SetRenderColorA(alpha);
}
} else {
Warning("Tried to set the transparency on a model with
a null string\n");
}
}
}
Then, from the client call the server console command like this:
char command[64];
sprintf(command, "armar_set_model_transparency mymodel 255");
engine->ClientCmd(command);
Good Luck!
Steve
On Mon, May 4, 2009 at 2:34 AM, Walter Gray <[email protected]> wrote:
> Hey list,
> I'm trying to create a hammer output field for one of my entities,
> but I've run into a bit of a roadblock.
> The entity is used to control the playback of full screen movies,
> and networked so that the server side and thus hammer can be used to
> start or stop the movie while the client side is responsible for
> actually playing the video files. I want to have an output fire when
> the movie ends, but that would require that when the movie ends on the
> client side either because it finishes normally or the player stops it,
> data be transmitted from the client to the server.
> As I understand it, CNetworkVars only transmit from server to
> client, so the only way I can think of right now would be to encode the
> information in the key press info (create an unbound IN_MOVIEENDED
> button). Is there a better, non-hacky way to go about this?
>
> _______________________________________________
> To unsubscribe, edit your list preferences, or view the list archives, please
> visit:
> http://list.valvesoftware.com/mailman/listinfo/hlcoders
>
>
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders