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 → Cog request, I really need it.
Cog request, I really need it.
2001-07-28, 10:04 AM #1
I've made a weapon like a saw, now what I need is so that when it touches another person, it will cause damage, and when it touches a wall it will throw sparks, and you don't have to use either fire buttons, I'm not sure if that is possible, is it?
I also want to have it so that when the player swings it, (I'll do the keys, don't worry about that.) it'll do damage or throw sparks.

Please help.

------------------
Get a life.
2001-07-28, 10:07 AM #2
Oh, and I also need it to be playing a keyframe of the blade spinning in 1st person view.

------------------
Get a life.
2001-08-07, 10:12 AM #3
Well, first you could make a tpl like this:

Code:
+sawslash           _weapon            size=.001 movesize=.001 mass=25 explode=+rpt_sparks fleshhit=+rptfleshhit damage=10 damageclass=0x1 typeflags=0x200d range=.15 force=25


Then in the weapon cog you could set a pulse for 50ms that fires the +sawslash projectile.

To make it play a key you could first add this to the symbols section of your cog:

Code:
keyframe pSawSwing1=<your first pov swing key>.key local
keyframe pSawSwing2=<your second pov swing key>.key local

keyframe sawSwing1=<your first extern swing key>.key local
keyframe sawSwing2=<your second extern swing key>.key local


Then you could set your fire: message to this:

Code:
fire:
   player = GetSourceRef();

   // Check that the player is still alive.
   if(GetThingHealth(player) <= 0)
      Return;

	SendMessageEx(GetThingClassCog(GetLocalPlayerThing()), user1, 3, 0, 0, 0);

   SetPOVShake('0.0 -.003 0.0', '1.0 0.0 0.0', .05, 80.0);
   jkPlayPOVKey(player, POVswing1Anim[mode], 1, 0x38);
   PlayKey(player, swing1Anim[mode], 1, 0x38);

   powerBoost = GetInv(player, 63);
   ChangeFireRate(player, fireWait/powerBoost);
Return;


To have it play a keyframe of the blade spinning in POV you can add this to the symbols section:

Code:
keyframe pBladeSpin1=<your blade spinning key>.key local

int spinID=-1 local


Then add this to the selected: message:

Code:
 if (spinID != -1)
  StopKey(player, spinID, 0.0);
 spinID = jkPlayPOVKey(player, pBladeSpin1, 1, 0x1);


And this to the deselected: message:

Code:
 if (spinID != -1)
  StopKey(player, spinID, 0.25);
 spinID = -1;


I haven't tested this and it might not work, so if you use this you should probably backup your weapon cog.

Thanks
JKMeteor
"Maybe you like rainbows"
I can't remember what to say!!!!
Click here for my homepage.

↑ Up to the top!