AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Modifying this gamemessage (https://forums.alliedmods.net/showthread.php?t=17951)

LynX 09-12-2005 09:49

Modifying this gamemessage
 
From JGHG trace :

Code:
L 09/08/2005 - 11:44:54: [JGHG Trace] {MessageBegin type=Explosion(92), dest=all_reliable(2), classname=nil netname=nil L 09/08/2005 - 11:44:54: [JGHG Trace] WriteCoord coord=-1773.436768 L 09/08/2005 - 11:44:54: [JGHG Trace] WriteCoord coord=2792.144531 L 09/08/2005 - 11:44:54: [JGHG Trace] WriteCoord coord=971.843384 L 09/08/2005 - 11:44:54: [JGHG Trace] WriteLong long=400 L 09/08/2005 - 11:44:54: [JGHG Trace] WriteByte byte=0 L 09/08/2005 - 11:44:54: [JGHG Trace] MessageEnd}

Allright, I want to change the color of this message(explosion).
The colors existing
Code:
0,1,2,3,4,5

WriteByte byte=0 represents that this message is blue.
How could I alter that without creating a new message on server to modify that?
So how should I modify it with register_message thingy?
Thnx

LynX 09-12-2005 13:13

C'mon, I'm sure its possible to modify it... please... :cry:

Xanimos 09-12-2005 13:19

There arent color values that can be set. So I dont think you can change the color

LynX 09-12-2005 13:39

Damn... Well, then, is it anyhow possible to change it at all, like getting the origin of it then creating red explosion while overriding other explosion?
I really need this... :cry:

Xanimos 09-12-2005 13:49

You need to get your own exploding model and use it i guess and then stop the first exploding one.
Or if you got a model that when used with the exploding one changes it so its red would possilbly work for you.

LynX 09-12-2005 13:58

Ummm... First of all , this is sprite what I'm talking about.
The game has 6 sprites for this, white, blue , red ,yellow, green, pink...
The thingy defined in the last parametar of message is the color used for it, therefore, the sprite used.
0 - 5 is color indexs
So I guessed I could alter it...

LynX 09-12-2005 15:27

I really think this can be modified since I saw closed-source plugins which manipulate with this message, modifying its size... Please :cry:

PM 09-12-2005 16:00

Check out register_message from the engine module :o

LynX 09-12-2005 16:09

I did... Appereantely, I can't do anything without knowing what to put in the function forwarded in register...
So I need this:

Code:
public plugin_init() { //... register_message( get_user_msgid("Explosion"), "ColorChange") return PLUGIN_CONTINUE } public ColorChange( WHAT_TO_PUT_HERE??!!?? ) { set_msg_arg_int(WHAT_TO_PUT_HERE??!!??, ARG_BYTE, 3 ) / set to yellow explosion return PLUGIN_CONTINUE }

That's the main reason I asked for help in this thread... I don't know what to do...
I guess this is the way...

PM 09-12-2005 16:45

Try this:
Code:
// In plugin_init: register_message( get_user_msgid("Explosion"), "ColorChange"); // then: public ColorChange(msg_id, msg_dest, msg_entity) {    set_msg_arg_int (5, 0, /* your new color index */); }


All times are GMT -4. The time now is 14:22.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.