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 → Multi player projectle synching
Multi player projectle synching
2004-03-19, 4:18 PM #1
Code:
# Jedi Knight Cog Script
#
# item_throwthings.cog
#
# Item Script
#
# Item cog that fires three projectiles forward with a differing fire
#  angle for a spread shot.
#
# [3/3/04] - Darth Slaw
#==============================================================#


symbols
keyframe  povFireAnim=detvpst1.key        local
keyframe  prePOVThrowAnim=detvpre1.key    local
template  projectile=+star            local
sound     throwSound=bwoosh1.wav   local
sound     clickSound=bwoosh2.wav     local
thing     player                          local
int       firing=0                        local
int       prethrowtrack=-1                local
flex      fireDelay=1.0                   local
flex      offset=8                        local
vector    vec                             local
message   activated
message   timer
end
#==============================================================#
code
#------------------------------------------------------
activated:
	player = GetSourceRef();
	if(firing == 1) Return;
	firing = 1;
	PlaySoundThing(clickSound, player, 1.0, -1.0, -1.0, 0x80);
	//jkPlayPOVKey(player, prePOVThrowAnim, 1, 0x38);
	prethrowtrack = PlayMode(player, 38);
	SetTimerEx(0.2, 1, 0, 0);
Return;
#------------------------------------------------------
timer:
	if(GetSenderID() == 0)
	{
		// Start waggling after the throw.
		jkSetWaggle(player, '10.0 7.0 0.0', 350);
		firing = 0;
	}
	else if(GetSenderID() == 1)
	{
		StopKey(player, prethrowtrack, 0);
		prethrowtrack = -1;
		SetPOVShake('0.0 -.003 0.0', '0.5 0.0 0.0', .05, 40.0);
		jkPlayPOVKey(player, povFireAnim, 1, 0x38);
		PlaySoundThing(throwSound, player, 1.0, 0.5, 2.5, 0x80);
		FireProjectile(player, projectile, -1, 15, '0.05 0 0', '0 0 0', 1, 0x1, 0.0, 0.0);
		ChangeInv(player, 4, 0.0);
		if(GetInv(player, 4) > 0)
		{
			vec = VectorSet(0, offset, 0);
			FireProjectile(player, projectile, -1, 15, '0.05 0 0', vec, 1, 0x1, 0.0, 0.0);
			ChangeInv(player, 4, 0.0);
		}
		if(GetInv(player, 4) > 0)
		{
			vec = VectorSet(0, -offset, 0);
			FireProjectile(player, projectile, -1, 15, '0.05 0 0', vec, 1, 0x1, 0.0, 0.0);
			ChangeInv(player, 4, 0.0);
		}
		jkSetWaggle(player, '0.0 0.0 0.0', 0);
		if(GetInv(player, 4) < 1 && GetCurWeapon(player) == 4)
		{
			if(GetAutoSwitch() & 1)
			{
				SelectWeapon(player, AutoselectWeapon(player, 1));
			}
			else
			{
				SelectWeapon(player, 1);
			}
		}
		jkSetWaggle(player, '0.0 0.0 0.0', 0);
		//delay before we can fire again
		SetTimerEx(fireDelay, 0, 0, 0);
	}
Return;
#------------------------------------------------------
end


This cog was given to me by darth slaw a while ago but bacause of that static.jkl problem the projectiles dont show up in mp. Because this is an items cog and not a weapon cog it works differently to normal mp synching. Can someone synch the projectiles for me. [http://forums.massassi.net/html/smile.gif]

------------------
Nightfire Mod
Spoting an error in post will result in a $100 reward.
Offer expires on 6/6/06. Valid one per customer, per day.

Rangi
2004-03-20, 2:29 AM #2
Go to Millenium and read about the client/server cogs.

------------------
"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)
2004-03-20, 7:26 AM #3
Yeah, this is the same concept as the weapons, just it is in an item slot. This case is still handled by triggers and a client cog.

------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team
May the mass times acceleration be with you.

↑ Up to the top!