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 → The Deactivated Message
The Deactivated Message
2001-04-15, 2:48 PM #1
I'm working on the thermal cog. I've done some work on the way it fires, and now, the deactivated message runs before I let go of the key. And then runs again when I do let go of it. I don't know of anything else that could do it except "call deactivated," and that's not in there.

What's happening? [http://forums.massassi.net/html/confused.gif]

------------------
And though your very flesh and blood
..Be what your Eagle eats and Drinks,
You'll praise him for the best of birds,
..Not knowing, what the Eagle thinks. -Cassandra
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-15, 2:50 PM #2
BTW, I'd post the cog, but I don't think anyone understood the last cog I posted. -I guess it was just way too long to make sense of.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-17, 12:43 PM #3
This question can't be too hard.

------------------
And though your very flesh and blood
..Be what your Eagle eats and Drinks,
You'll praise him for the best of birds,
..Not knowing, what the Eagle thinks. -Cassandra
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-17, 2:39 PM #4
We can't help you if we can't see the code.

------------------
Together we stand.
Divided we fall.
2001-04-17, 3:08 PM #5
Here's Activated, Fire, and Deactivated:

Code:
#===========================================
activated:
   player = GetSourceRef();
   mode = GetSenderRef();
   if(GetThingHealth(player) <= 0) Return;
   if(GetInv(player, 4) < 1.0)
   {
	PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
	if(GetAutoSwitch() & 1) SelectWeapon(player, AutoSelectWeapon(player, 1));
	Return;
   }

   if(!getinv(player, thermgun))
   {
	if (mode > 1) Return;
	PlaySoundThing(clickSound[mode], player, 1.0, -1.0, -1.0, 0x80);
	if(preThrowTrack == -1 && prePOVThrowTrack == -1)
	{
	      prePOVThrowTrack = jkPlayPOVKey(player, prePOVThrowAnim, 1, 0x14);
	      preThrowTrack = PlayMode( player, 38 );
	      ActivateWeapon(player, 0, mode);
	}
   }
   
   if(getinv(player, thermgun))
   {
	jkSetWaggle(player, '0.0 0.0 0.0', 0);
	powerBoost = GetInv(player, 63);
	ActivateWeapon( player, fireWait/powerBoost, mode );
   }

   Return;
# ...........................................
fire:
Print("fire");
player = GetSourceRef();
mode = GetSenderRef();
if(GetInv(player, 4) < 1.0)
{
	PlaySoundThing(outSound, player, 1.0, -1.0, -1.0, 0x80);
	if(GetAutoSwitch() & 1) SelectWeapon(player, AutoSelectWeapon(player, 1));
	Return;
}

if(getinv(player, thermgun))
   if(mode == 0)
   {
   Print("Mode0");
	SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
	dummy = FireProjectile(player, projectile3, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', 1, 0x20, autoAimFOV, autoAimFOV*2);
	ApplyForce(player, VectorScale(GetThingLVec(player), -60));
	ChangeInv(player, 4, -1.0);
	jkPlayPOVKey(player, povfireAnim2, 1, 0x38);
	powerBoost = GetInv(player, 63);
	ChangeFireRate(player, fireWait/powerBoost);
   }

# ...........................................
deactivated:
   player = GetSourceRef();
   mode = GetSenderRef();
   delayTime = DeactivateWeapon(player, mode);
   if (GetCurWeaponMode() != -1) Return;

Print("Deactivated");

   if(!getinv(player, thermgun))
   {
	if(delayTime > 2) delayTime = 2;
	if(mode == 0) if(delayTime < 0.7) delayTime = 0.7;
	else if(delayTime < 0.25) delayTime = 0.25;
	if(preThrowTrack != -1 && prePOVThrowTrack != -1)
	   {
	      jkStopPOVKey(player, prePOVThrowTrack, 0);
	      StopKey(player, preThrowTrack, 0);
	      preThrowTrack = -1;
	      prePOVThrowTrack = -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[mode], -1, 15, '0.05 0 0', '0 0 0', delayTime, 0x1, 0.0, 0.0);
	   ChangeInv(player, 4, -1.0);
	   SetMountWait(player, throwWait);
	   jkSetWaggle(player, '0.0 0.0 0.0', 0);
	   SetTimerEx(throwWait, 0, 0, 0);
   }

if(getinv(player, thermgun))
if(mode == 1)
{
Print("Mode1");
	if(delayTime > 2) delayTime = 2;
	if(delayTime < 1) delayTime = 1;
	SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
	dummy = FireProjectile(player, projectile3, fireSound, 8, '0.0135 0.1624 0.0', '0 0 0', delayTime, 0x1, autoAimFOV, autoAimFOV*2);
	ApplyForce(player, VectorScale(GetThingLVec(player), -60));
	ChangeInv(player, 4, -1.0);
	jkPlayPOVKey(player, povfireAnim2, 1, 0x38);
	powerBoost = GetInv(player, 63);
	ChangeFireRate(player, fireWait/powerBoost);
}

   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   DeactivateWeapon(player, mode);

Return;
# ...........................................


The if(getinv(player, thermgun)) is to find out whether the thermal gun is supposed to be used. And if it is, the gun will fire a different projectile.

Whatever the reason, deactivated is running before I let go of the fire key(mode 0 or 1).

------------------
And though your very flesh and blood
..Be what your Eagle eats and Drinks,
You'll praise him for the best of birds,
..Not knowing, what the Eagle thinks. -Cassandra

[This message has been edited by SaberMaster (edited April 24, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-17, 3:53 PM #6
A while ago I did something that used decativaed it the middle, and i found out that it called apon the deactivate message if you hold down or tap the fire buttion , it calls apon the decativate message anyway , i don't think there is a way around it , unless you use a int message to stop it.
2001-04-20, 6:42 AM #7
So there's no way around it? But anyway, why does it happen in the first place? There must be a reason this cog does that or all the cogs would do it.

------------------
And though your very flesh and blood
..Be what your Eagle eats and Drinks,
You'll praise him for the best of birds,
..Not knowing, what the Eagle thinks. -Cassandra
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-24, 6:51 AM #8
boosting...
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-24, 12:26 PM #9
I think I have a way around it.
2001-04-24, 7:15 PM #10
why are your message lines commented out?
2001-04-24, 7:39 PM #11
Oh, posting error. I'll fix it.

You've found a way, Seifer? What?

[This message has been edited by SaberMaster (edited April 24, 2001).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-04-24, 11:12 PM #12
no return; after your fire message
2001-04-25, 12:14 PM #13
It was that simple... [http://forums.massassi.net/html/redface.gif]

Well, I just put in that return and it works fine. Thanks a lot, Jipe [http://forums.massassi.net/html/wink.gif]

------------------
Warning! User is not Windows compatible.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!