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 → Multiplayer Cog
Multiplayer Cog
2004-08-28, 5:20 AM #1
How might I go about writing a cog where a player on a team (there will only be 4 players, so each player can be on a different team) has a 'battery pack', that, as he walks, depletes. user0 messages (from weapons, etc.) also deplete his power based on extra values sent with them.

When the power runs out, it would play a sound at his thing and then dim only his screen and slow down his actor speed.

Also, a certain trigger should be able to pwoer him down with a different sound, spark generation, and a message.

I guess this would require client/server cogs? I'm pretty much clueless about MP coding, though, so any help/examples would be greatly appreciated.

------------------
Life of Grismath
and
Rites of Xanthus
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2004-08-28, 8:18 AM #2
You should be able to start out by changing the item_irgoggles.cog into your own item_batterypack.cog. In it, change the effects used, the inventory bin, the sounds, etc. Then place your user0 and trigger handlers in it.
If you want the power loss to happen only while player is walking, detect player movement using code from SaberMaster. Plus, you need to setup the corresponding inventory bin in items.dat.

I'll let others more experienced with MP cogs tell you the best ways of using them.

[http://forums.massassi.net/html/smile.gif]
2004-08-28, 9:22 AM #3
First off, is this a mod or something you want to be self-contained within a level. I can help you with either, but the coding is vastly different between the two.

For a mod, basically no client/server coding is needed. A tweak to each weapon cog to send a message to a new item bin that controls everything in a client-side but still network sync'd cog would do the trick.

For a level, you'd just have a cog that starts processing at startup and detects movement. To make shooting your gun power yourself down more, you'd need to attach a class cog to every projectile (really simple to do) and have them send a message to the main cog (using SetMasterCog and GetMasterCog should do the trick) upon creation.

There's really no client/server stuff needed whatsoever, except to give the "main" battery cog a trigger message to receive the signal to do the sparks/different sound powerdown thingy.

QM

↑ Up to the top!