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 → Reflect shots
Reflect shots
2003-04-02, 1:53 AM #1
Hi!
I have posted this in Main editing forum but they say this is more of a COG question. So...

Full detail!
I have an object that is supposed to be a player. This object has a ready made weapon and is stuck to him in his right hand. Now this weapon is nothing bet a hunk of metal. And it has the same damage as fists. (If you must know, I replaced fists with this hunk of metal.) Now I want the player to treat this piece of metal like if it was Magneticaly Sealed so when someone fires at him, he will swing his peice of metal like if it was a LightSaber and reflect shots.

And I say again. The actor and metal are ONE object.

/Edward
Edward's Cognative Hazards
2003-04-02, 12:47 PM #2
Enable the lightsaber flags, duh. [http://forums.massassi.net/html/redface.gif] [http://forums.massassi.net/html/smile.gif]

------------------
-Hell Raiser
Remember kiddies, trial and error.
Without struggles there is no progress
DBZ: The Destruction is Real

[This message has been edited by Hell Raiser (edited April 02, 2003).]
-Hell Raiser
2003-04-02, 6:51 PM #3
SetActorFlags(player, 0x2000);


------------------
-RayNbow
-RayNbow
2003-04-02, 10:48 PM #4
That didn't work... The player just stood there accepting all shots!
Now I don't want the player to have a LightSaber, just a piece of metal that is Magnetically Sealed!
Is there some way so that when a bolt hits me from infront, a key is played and the Magnetically Sealed flag is turned on for a very short while?

/Edward
Edward's Cognative Hazards
2003-04-03, 1:06 AM #5
since you made the weapon part of the player model you can only make the whole model magsealed. so even if he missed the block it would bounce of his body, so i suggest just coming up with a new method completely.

------------------
roses are red, violets are blue, I am schizophrenic, and so am I!
roses are red, violets are blue, I am schizophrenic, and I am too!
2003-04-03, 3:21 AM #6
Oh boy........................................
This is going to take a while.................
Edward's Cognative Hazards
2003-04-03, 4:34 PM #7
SetActorFlags(player, 0x2000);
the code for autoblock, it should work...

------------------
I'm just an old man with a skooma problem.
I'm just an old man with a skooma problem.
2003-04-03, 6:09 PM #8
Make sure you have a "blocked" message in the weapon cog...

------------------
May the forks be with you.
AOL - providing excellent internet connection until you leave their domain.
Catloaf, meet mouseloaf.
My music
2003-04-05, 11:30 AM #9
The saberfighting system is pretty complicated and just setting one flag is not going to enable it.

BTW, the blocked message would go in the actors or player's class cog - in this case, kyle.cog.

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2003-04-05, 12:51 PM #10
Quote:
<font face="Verdana, Arial" size="2">Originally posted by SaberMaster:
The saberfighting system is pretty complicated and just setting one flag is not going to enable it.

BTW, the blocked message would go in the actors or player's class cog - in this case, kyle.cog.

</font>

Funny... After the previous guy said blocked message, I had a look at the saber cog: Nada... I had a look at Kyle cog: A blocked message with SaberKeyPov and SaberKey. BUT! I found nothing saying "If(Kyle's holding saber) { Begin Blocking"... Just "Blocked? Begin Blocking"...
As the greate scientist would say... Hmmm...

/Edward
Edward's Cognative Hazards
2003-04-05, 2:09 PM #11
The saber has to be enabled first. You can make a transparent mat and use that for the saber mats. THEN you enable the autoblocking.

------------------
-Hell Raiser
Remember kiddies, trial and error.
Without struggles there is no progress
DBZ: The Destruction is Real
-Hell Raiser
2003-04-06, 12:35 AM #12
are you ppl stuipid or something? put it in the wepon cog so taht wehn its activated a invisible large flat magneticaly sealed 3DO is placed right infrount of the player and kept there, then the shots will bounse of that, but only if you (and the ivisable shild) are faceing the shot wehn it hits.

------------------
I am pjb.
Another post......
another moment of my life wasted.....
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-04-07, 6:12 PM #13
You realize the blocked message can be used in any cog, right? The saber block is used in kyle.cog because kyle is the thing sending the message, not the saber, and blocked only works when (you guessed it) something is blocked. Depending on the thing type, it is sent when certain requirements are met. I'll send a cog in tomorrow (unless someone else already has by then).

And Pjb...
You can't magseal a weapon mesh since it is only a model, plus when it is set, it becomes a part of the player. A thing must also have a template before it will accept flags. Thirdly, your method lacks the ability for animations; so next time you make a jab like that, make sure you at least provide a solution that will work.

------------------
May the forks be with you.
AOL - providing excellent internet connection until you leave their domain.
There is a great disturbance in my shorts...
Catloaf, meet mouseloaf.
My music
2003-04-08, 1:02 AM #14
Huh? why would the shild be a wepon mesh? cant you read mr. disterbed shorts? i said create a object (a 3DO not a wepon mesh) infrount of the player! like a sheet of glass, or some kind of clear barrier,(rember the partical feild for foce protection? mutch like that but a 3DO and magseling the 3do not the player.), i dont know what AOL have done to you mate but my meathod is just as good as any other, if not easyer too.

(p.s. AOL (unless the broardband vertion) has the heavyes lag in any multiplayer JK game, for flips sake, bt openworld is faster, and do you know hoe badly made that ISP is?)


oh and my name is either capitalised or not, i am not Pjb i am PJB or pjb, rember that, it makes me mad.
------------------
I am pjb.
Another post......
another moment of my life wasted.....

[This message has been edited by [SF]pjb (edited April 08, 2003).]
I am Darth PJB!
well, go on, run away!

i have a plastic lightsaber and a jedi cape.. am i a nerd?

If gravity is a crule mistress, and bar tenders with bad grammar are untrustworthy, what is air?
2003-04-08, 7:33 PM #15
Sorry I took so long with this cog, but I forgot I would be so busy today when I told you I would have it. Then after looking at your original post, I realized you still wanted to be able to be able to punch, so I had to re-write the cog. So finally, here it is.
Code:
# Cog Script
# by Brandon Bull (a.k.a. DogSRoOL)
# weap_shield.cog (not to be confused with "item_shields.cog")
# GuitarOfGold@aol.com
# Strings_of_Gold@hotmail.com

symbols
model       povModel=fistv.3do
model       weaponMesh=fistg.3do

keyframe    mountAnim=FistVmnt.key			local
keyframe    dismountAnim=FistVdis.key		local
keyframe    povfireAnim1=FistVl.key		local
keyframe    povfireAnim2=FistVr.key		local
keyframe    holsterAnim=kyhlstr.key  		local

# ---Blocking Animations (Change if necessary) ---
keyframe    povBlockAnim0=SabVblk0.key       	local
keyframe    povBlockAnim1=SabVblk1.key       	local
keyframe    povBlockAnim2=SabVblk2.key       	local
keyframe    blockAnim0=KYblock0.key          	local
keyframe    blockAnim1=KYblock1.key          	local
keyframe    blockAnim2=KYblock2.key          	local
# ------------------------------------------------

sound       fireSound1=SwingFist01.wav		local
sound       fireSound2=SwingFist04.wav		local

template    projectile=+punch			local

thing       player					local

flex        leftWait=0.25				local
flex        rightWait=0.25				local
flex        mountWait				local
flex        holsterWait				local

int         trackID=-1				local
int         nextAnim=0				local
int	     holsterTrack				local
int         blockPOVTrack=-1                 	local
int         blockTrack=-1                    	local
int	     nextblock=0				local

message     startup
message     activated
message     deactivated
message     selected
message     deselected
#message    newplayer
message     autoselect
message     fire
message     timer
message     blocked

end

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

code

startup:
   player = jkGetLocalPlayer();
   leftWait = GetKeyLen(povfireAnim1);
   rightWait = GetKeyLen(povfireAnim2);
   mountWait = GetKeyLen(mountAnim);
   Return;

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

fire:
   if(GetThingHealth(player) <= 0)
   {
      Return;
   }

   if(nextAnim == 0)
   {
      SetPOVShake('-0.01 -.01 0.0', '1.0 0.0 0.0', .05, 80.0);
      PlaySoundThing(fireSound1, player, 1.0, 0.5, 2.5, 0x80);
      FireProjectile(player, projectile, -1, 8, '-0.02 0.03 0', '0 0 0', 1.0, 0, 0.0, 0.0);
      SetFireWait(player, leftWait);
   }
   else
   {
      SetPOVShake('0.01 -.01 0.0', '1.0 0.0 0.0', .05, 80.0);
      PlaySoundThing(fireSound1, player, 1.0, 0.5, 2.5, 0x80);
      FireProjectile(player, projectile, -1, 18, '0.02 0.03 0', '0 0 0', 1.0, 0, 0.0, 0.0);
      SetFireWait(player, rightWait);
   }
   jkPlayPOVKey(player, povfireAnim1[nextAnim], 1, 0x0a);
   nextAnim = 1-nextAnim;

   Return;

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

activated:
   player = GetSourceRef();
   mode = GetSenderRef();

   jkSetWaggle(player, '0 0 0', 0);
   ActivateWeapon( player, leftWait, mode );

   Return;

deactivated:
   player = GetSourceRef();
   mode = GetSenderRef();

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

   Return;

selected:
   player = GetSourceRef();
   PlayMode(player, 40);
   jkSetPOVModel(player, povModel);
   jkSetWeaponMesh(player, weaponMesh);
   SetArmedMode(player, 0);
   jkSetWaggle(player, '10.0 7.0 0.0', 350);
   trackID = jkPlayPOVKey(player, mountAnim, 0, 20);
   SetMountWait(player, mountWait);
   jkClearFlags(player, 0x5);
   SetCurWeapon(player, 1);

   Return;

deselected:
   player = GetSourceRef();

   jkPlayPOVKey(player, dismountAnim, 0, 18);
	
	holsterWait = GetKeyLen(holsterAnim);
   SetMountWait(player, holsterWait);
   holsterTrack = PlayKey(player, holsterAnim, 1, 0x4);
	SetTimerEx(holsterWait, 2, 0, 0);
	if (trackID != -1)
	{
		jkStopPOVKey(player, trackID, 0);
		trackID = -1;
	}
   jkSetWaggle(player, '0 0 0', 0);

   Return;

autoselect:
   ReturnEx(100);

   Return;

blocked:
   if(player != GetSenderRef()) Return;
   if (blockPOVTrack != -1)
   {
      jkStopPOVKey( player, blockPOVTrack, 0.1 );
      blockPOVTrack = -1;
   }
   if (blockTrack != -1)
   {
      StopKey( player, blockTrack, 0.1 );
      blockTrack = -1;
   }
   blockPOVTrack = jkPlayPOVKey(player, povBlockAnim0[nextBlock], 2, 0x1a);
   blockTrack = PlayKey(player, blockAnim0[nextBlock], 2, 0x1a);
   nextBlock = nextBlock + 1;
   if(nextBlock > 2)
      nextBlock = 0;
   Return;

timer:
	StopKey(player, holsterTrack, 0);
	Return;

end


DISCLAIMER: This cog has not been tested. I'm shall not be held responsible if it freezes your system (yes, this is[/i] possible to do).
Also since I haven't tested this, I don't know if it works properly. I simply coppied the blocked section from kyle.cog (and corresponding symbols) to the fists cog and made a few other modifications & changes.

I also forgot how much I loathe weapon cogs.

------------------
May the forks be with you.
AOL - providing excellent internet connection until you leave their domain.
There is a great disturbance in my shorts...

[This message has been edited by DogSRoOL (edited April 08, 2003).]
Catloaf, meet mouseloaf.
My music

↑ Up to the top!