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 → Pause?
Pause?
2000-12-22, 5:38 PM #1
I am making a pause button for JK DeathMatch.
It freezes the player and makes him invulnerable. He cannot fire weapons, use the console, anything. Here is the cog:
Code:
# Jedi Knight Cog Script
#
# boss.cog
# Immobalizes the player and disables the ability to use weapons.
# Also makes him invinceable.
# A bloody pause button for JK.
# 12/22/00
#(C)Aglar 2000 Jay Inc. All Rights Reserved
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message      activated                                                        

thing        player                                                           

end                                                                           

# ========================================================================================
code

activated:

d00d = GetLocalPlayerThing();

on = 0;

if (on==0)

{

	SetActorFlags(d00d,0xA00008);

	Print ("Paused");	

	on = 1;

}
else
{
	if (on==1)

			{

	
				ClearActorFlags(d00d,0xA00008);

		Print("Unpaused");

		on = 0;

	}
}

Return;

end

The problem? I press the button once, it pauses. Works like a bloody charm. The thing is, when I press it again, it doesn't do anything. Is there something about the Totaly Imobalized flag that disables input, thus making it ignore everything I do once it changes my flags? I thought that may be so, so I tried partially imobalized. This time when I pressed it after being paused it just printed paused again, and I assume it set my flags, again. What, exactly, am I doing wrong here?

------------------
All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither,
Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
2000-12-23, 7:13 AM #2
MAKE SPACES between == and the rest of the cog. if(on == 1).. like that.
2000-12-23, 7:14 AM #3
I did, made no difference.

------------------
All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither,
Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
2000-12-23, 7:21 AM #4
heeb, that doesn't matter...

aglar, its because you have on=0; right after activated, so no matter what you do it will alwyas set that to 0, and wont call the part for if(on == 1);
I'm just an old man with a skooma problem.
2000-12-23, 8:15 AM #5
Gunny was right, but that was only part of the problem. The problem was the flag, once it was it it ignored anything the player did.

------------------
All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither,
Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
2000-12-23, 10:57 AM #6
I'm surprised that nobody mentioned this
dood isn't declared anywhere in the symbols section, and therefore the call to assign a value, or do anything to dood doesn't do anything at all
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2000-12-23, 11:05 AM #7
I defined it right under the activated message. If it wasn't defined it would have done nothing. Trust me, that was not the problem, I already said what was.

------------------
All that is gold does not glitter, Not all those who wander are lost; The old that is strong does not wither,
Deep roots are not reached by the frost. From the ashes a fire shall be woken, A light from the shadows shall spring; Renewed shall be blade that was broken, The crownless again shall be king.
2000-12-24, 5:10 PM #8
im not sure if you knew this midget basher, but you dont have to declare any int's or things in symbols unless you need to set them to a value up there. like id=-1 or model=ky.3do
I'm just an old man with a skooma problem.
2000-12-24, 7:03 PM #9
I didn't know that
I read somewhere that you needed to define them in the symbols section
thank you gunboy
that just made my life sooooooooooo much easier

[This message has been edited by Midget Basher (edited December 24, 2000).]
And meanwhile the bus with legs has destroyed half of disneyland . . . and nobody cares!
2000-12-25, 11:45 AM #10
Well, what do you know? You learn something new each day. [http://forums.massassi.net/html/smile.gif]

I still prefer to explicitly define the variables I use, in the symbols section. Call me old fashioned (or a C programmer) [http://forums.massassi.net/html/smile.gif]

In the mean time, I'll investigate those actor flags.

Raynar


------------------
... the Jedi I admire the most, met up with Darth Maul, now he's toast ...
Rbots - a project to develop a working Bot for Jedi Knight... download the latest development version here
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis

↑ Up to the top!