View Full Version : Reflect shots
Edward
04-02-2003, 04:53 AM
Hi!
I have posted this in Main editing forum (http://forums.massassi.net/html/Forum2/HTML/010625.html) 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
Hell Raiser
04-02-2003, 03:47 PM
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 (http://tdir.hellraiser64.com)
[This message has been edited by Hell Raiser (edited April 02, 2003).]
RayNbow
04-02-2003, 09:51 PM
SetActorFlags(player, 0x2000);
------------------
-RayNbow
Edward
04-03-2003, 01:48 AM
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
Han5678
04-03-2003, 04:06 AM
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!
Edward
04-03-2003, 06:21 AM
Oh boy........................................
This is going to take a while.................
GuNbOy
04-03-2003, 07:34 PM
SetActorFlags(player, 0x2000);
the code for autoblock, it should work...
------------------
I'm just an old man with a skooma problem.
DogSRoOL
04-03-2003, 09:09 PM
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.
SaberMaster
04-05-2003, 02:30 PM
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 (http://www.geocities.com/sabersdomain/fileframe.html), Parsec (http://www.geocities.com/sabersdomain/fileframe.html), Scribe (http://www.geocities.com/sabersdomain/fileframe.html), and the EditPlus Cog Files (http://www.geocities.com/sabersdomain/fileframe.html).
Edward
04-05-2003, 03:51 PM
<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
Hell Raiser
04-05-2003, 05:09 PM
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 (http://tdir.hellraiser64.com)
[SF]pjb
04-06-2003, 04:35 AM
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.....
DogSRoOL
04-07-2003, 09:12 PM
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...
[SF]pjb
04-08-2003, 04:02 AM
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).]
DogSRoOL
04-08-2003, 10:33 PM
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.
# 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 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).]
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.