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 → MotS Player Actions for Cliff Hanger
MotS Player Actions for Cliff Hanger
2001-07-11, 6:51 PM #1
Okay...I'm redoing Cliff Hanger for MotS and the Army TC. I want to use player actions to determine strafing, jumping, crouching, turning, moving, etc. But the problem is, they don't seem to work in mid-air. And the whole point of this is so you can touch a ledge surface in mid air, freeze/grab it, then shimmmy, fall down, or pull up. I just need to get this to work.

Here's my COG:


# Jedi Knight COG Script
#
# script.cog
#
# Created by Emon. E-Mail: emon@coruscant.net - Zone: EJM_Emon - ICQ: 35960628
# Feel free to use this COG as long as credit is given in the readme file.
#
# Description
#
#
# This COG is not supported by LucasArts Entertainment Co.

flags=0x240

symbols

thing Player local

keyframe HangAnim=cliffhang.key
keyframe ClimbAnim=cliffclimb.key

sound GrabSound=kylerun01.wav
sound GrabVoice=kyljpa.wav

surface Ledge1

int HangTrack local
int CurWeap local

message startup
message touched
message playeraction

end

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

code

startup:

Player = GetLocalPlayerThing();
Return;

touched:

CurWeap = GetCurWeap(Player); // Gets current weapon. For some crap that's not completed.
SetThingVel(Player, 0, 0, 0); // Stop current velocity.
SetActorFlags(Player, 0x40000); // Make sure the player stop even if they hold down a movement key.
Sleep(.001); // ""
ClearActorFlags(Player, 0x40000); // ""
HangTrack = PlayKey(Player, HangAnim, 1, 0x0);
SetActionCog(GetSelfCog(), 0x7fffffff);
ClearPhysicsFlags(Player, 0x1);
Return;

playeraction:

If(GetParam(0) == 5 || GetParam(0) == 6 || GetParam(0) == 3)
{
SetThingVel(Player, 0, 0, 0);
Print("No shooting, moving or turning!");
ReturnEx(0);
}

else
{
ReturnEx(1);
}

Return;



end




Any help would REALLY be appreciated...

Btw, I DID read
both Player Action
tutorials at massassi.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-07-12, 4:40 PM #2
Another problem I have is, when another person force pushes you, or shoots you with the conc, you'll start to float away due to the force. I wanted to use player action to disable the movement, as you can see above. It works when on the ground (I have a test level with the ledge surface on a plain wall to test), but not in mid-air. I would just use SetActorFlags(player, 0x40000); and put and IsThingMoving(player)..disconnect the player, blah blah etc. inside a pulse, but the problem with that is when I need to climb up, or shimmy, the player moves. Then the pulse would disconnect me from the ledge. I suppose I COULD just use ints to indicate when I'm moving, then disable the pulse temporarily...but that's a little unrealistic if someone can blow me off while I'm still and not blow me off when I'm moving. I SUPPOSE I could get rid of that thing altogether, but it would be nice to have...I mean if I didn't have it, it's not like a few more concs or rail dets wouldn't finish the guy off, but it would REALLY be cool to be on a mountain, then shoot a guy with a rail det and watch him fall to his death, know what I mean? [http://forums.massassi.net/html/smile.gif]


Okay...I'm done ranting...again, I'd really like ANY help. If I sound confusing, just ask me to clear up what I said and I will.

Email me at: emon@coruscant.net or post a reply.

Thanks all. [http://forums.massassi.net/html/smile.gif]
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-07-13, 4:50 PM #3
I didn't quite understand what you meant about the conc. As for the player actions, do you mean the very same code that works when GetThingAttachFlags returns 0x1 or 0x2 (player standing on surface or on thing) doesn't work when AttachFlags is 0x0 (in air)?
Dreams of a dreamer from afar to a fardreamer.
2001-07-13, 5:22 PM #4
Okay, about that Conc. If your hanging on the cliff, your stopped with SetThingVel(Player, 0, 0, 0); and have no gravity, or PhysFlags 0x1 removed, and your movement is disable with player actions (aside from the shimmying, etc), how would I make it so that if the player gets shot with the concussion rifle while hanging, he falls? Or if somone Force Pushes him off?

And when I said my player actions wouldn't work mid-air, I mean exactly that...I never tried anything with GetThingAttachFlags or whatever, though..but what does that do?

If you need help understanding what I'm saying, save that COG, pop up JED in the MotS default cube, and make one of the walls the Ledge surf in the cog. First run into in on the ground (I know the keys wont work, but that's okay), then jump onto the wall and see what happens.

Let me know if that helps. Thanks.
Bassoon, n. A brazen instrument into which a fool blows out his brains.
2001-07-14, 3:45 AM #5
Well, I'm on vacation and I don't have access to JK or MotS, so I won't be able to try it out till the end of the month. I can still elp you, though...

To make the player fall from conc damage, add a damaged message to the cog.
Code:
damaged:

if (GetSenderRef() != player) Return;
if ((GetThingTemplate(GetSourceRef() == +concbullet [I can't remember what it's called]) || (GetThingTemplate(GetSourceRef() == whatever other templates)
{
   ClearActorFlags(player, 0x40000);
   SetActionCog(-1, 0);
   SetPhysicsFlags(player, [gravity flag]);
   // you can turn off any other ints you want here
}


As a matter of fact, the whole template check isn't necessary if you want the player to fall from any type of damage.

As for Force powers, you have to put in a skill message, and add the same code, except with a bin checker: if (GetSourceRef() == [force pull bin ID]). I'm not sure it's GetSourceRef(), though, you should check in an actor cog, like the stormtrooper's.

Now, I'm not sure these cog message work in a non-template cog. You might have to merge them in with kyle.cog (or kyle_m.cog in MotS). In this case the best way is to have the surface cog you place in the level send a message, say user6, to kyle.cog to indicate when hanging is taking place. In other words:
Code:
touched:
   SendMessageEx(GetThingClassCog(player), user6);

Return;

Now, in Kyle.cog you'd do this:
Code:
user6:
   hanging = 1;
   Return;

//and in damaged and skiled message:
if (hanging)
{
   //the previous code I wrote as well as...
   hanging = 0; // he's falling, so he isn't hanging anymore
}


Right, I hope you understand. Try to get this stuff to work, since I can't use jk/mots from where I am.

[This message has been edited by Fardreamer (edited July 14, 2001).]
Dreams of a dreamer from afar to a fardreamer.
2001-07-14, 3:52 AM #6
By the way, you don't use SetThingVel right:
it's SetThingVel(player, '0 0 0'). And you should use StopThing(player) instead, or at least as well as SetThingVel.
Dreams of a dreamer from afar to a fardreamer.

↑ Up to the top!