Massassi Forums Logo

This is the static archive of the Massassi Forums. The forums are closed indefinitely. Thanks for all the memories!

You can also download Super Old Archived Message Boards from when Massassi first started.

"View" counts are as of the day the forums were archived, and will no longer increase.

ForumsCog Forum → I hate MP cogs
I hate MP cogs
2002-12-23, 8:46 AM #1
No, I really do sometimes. Why won't the killed message be called in this one. I've tried both with flags and without.
Code:
# Jedi Knight Cog Script
#
# AQUA_FOG.COG
#
# Creates a fog/mist like effect when it rains hard
# For CTF_Aquatic
#
# [DP]
#
flags=0x240

symbols

message   startup
message   newplayer
message   entered
message   killed

sector    on
sector    off
sector    off2

int       fog                        local
int       infog                      local
int       mainfogr=100
int       mainfogg=100
int       mainfogb=100

flex      tinger=0.25
flex      tingeg=0.25
flex      tingeb=0.25

end

# ========================================================================================

code

Startup:
   player = GetLocalPlayerThing();

Newplayer:
   If(GetThingSector(player) == on)
   {
      infog = 1;
      fog = newColorEffect(0, 0, 0, 0, 0, 0,  mainfogr, mainfogg, mainfogb, 1);
      AddDynamicAdd(player, tinger, tingeg, tingeb);
   }
   Return;

# ........................................................................................

Entered:
   If(GetSenderRef() == on)
   {
      If(infog) Return;
      infog = 1;
      fog = newColorEffect(0, 0, 0, 0, 0, 0,  mainfogr, mainfogg, mainfogb, 1);
      AddDynamicAdd(player, tinger, tingeg, tingeb);
   }
   Else
   {
      infog = 0;
      FreeColorEffect(fog);
      AddDynamicAdd(player, 0, 0, 0);
   }
   Return;

# ........................................................................................

Killed:
   If(!infog) Return; 
   infog = 0;
   FreeColorEffect(fog);
   AddDynamicAdd(player, 0, 0, 0);
   Return;

end
Stupid MP cogs, making post a cog question on the cog forums and listening to the whines of GBK.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-23, 8:53 AM #2
"AddDynamicAdd() adds an RGB tint to the screen which quickly fades away. The RGB values are integers with a minimun of 0 and a max of about 290."
Why do you use that verb? Especially with a 0/0/0 color, which can't be seen?
Anyway, add a Print Statement below killed: and see if it prints or not. But I guess you have already done that, no?

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-12-23, 9:28 AM #3
Yep, tried that.I might add some things on later, just leave it be for right now.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-23, 9:40 AM #4
Even with the 240 flag, "Getlocalplayerthing()" doesnt return anything but the host in MP. Use "Getsenderref()" under 'Newplayer' instead.
And when the moment is right, I'm gonna fly a kite.
2002-12-23, 12:12 PM #5
That still don't help me very much. I need to know why the killed message doesn't work!

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-23, 12:13 PM #6
Quote:
<font face="Verdana, Arial" size="2">Originally posted by GBK:
Even with the 240 flag, "Getlocalplayerthing()" doesnt return anything but the host in MP. Use "Getsenderref()" under 'Newplayer' instead.</font>


Say what?!?

I have used Getlocalplayerthing() all through TB's cogs!! I'm sure it works.
Team Battle.
2002-12-23, 1:46 PM #7
Nevermind, I've found another way. Maybe not as framerate friendly or as simple, but it shall look nicer (if implemented).

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-12-23, 3:18 PM #8
Hmm.
And when the moment is right, I'm gonna fly a kite.
2002-12-23, 3:56 PM #9
Try defining the player as an integer, dunno why but it might work.
Team Battle.
2002-12-24, 1:45 AM #10
It makes me want to come by here sometimes...

About GetLocalPlayerThing() working in mp, it may be because you're using it for the player himself and never for any other player, like in kyle.cog.

It will definitely not work, if used on a cog on a thing that reacts to certain events upon players. You can see by printing GetLocalPlayerThing() playing with multiple players to see how it does.

Defining doesn't really make much of a sense in cog, anything is an integer anyway. To be a little technical, all the cog verbs know what kind of type to pass and converts all the input values to proper type, or applies to proper material in the level.

As for the first post question, I think the cog doesn't know "who" is killed, unless the cog is attached to the player or CaptureThing'ed in the newplayer and masked so in symbol section.

I forgot, but does startup ever get called in multiplayer?

And to make the cog a little bit cleaner, there is a message called exited for use of clearing the fog.

I hope my really old knowledge helps.

------------------
http://millennium.massassi.net - MILLENNIUM
JK Mods : Sniper Arena! - Enhancement Pack!
2002-12-24, 1:54 AM #11
Yes, startup is called in mp.
Team Battle.

↑ Up to the top!