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 → I'm going to ask one more time...
I'm going to ask one more time...
2001-08-23, 7:35 AM #1
I am totally confused by the PlayerAction cogging ability. The one that you can use to for instance make the Jump button not work.

I read Obsidian's tutroial thousands of time, and I sort of understand it, but still I don't understand how to implement it!!!!!!

Code:
SetActionCog(cog1, 0x2000);
If(GetParam(0) == 0) // if he presses the jump key 
{ 
Print("No Jump for You!"); 
ReturnEx(0); // Makes the player NOT jump, even though he pressed the jump key. 
return; 
} 


Should that be under startup?

PLEASE SOMEONE HELP!!!!

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-23, 8:33 AM #2
That depends... If you want it to be inactive the entire game: under startup. If something else (sector enter, button push,...) under the correct cog for sector, button.

------------------
Eminem, Tiger Woods, Bill Clinton, Fred Durst,... Only a few of the big names in this totally pointless list.
2001-08-23, 8:41 AM #3
hmmm i'll give it a try, but it sounds deceptively easy...
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-23, 11:16 AM #4
I think it should be like this...

Code:
Startup:
  SetActionCog(GetSelfCog(), 0x2000);
  return;

PlayerAction:
  If(GetParam(0) == 0) // if he presses the jump key 
  {
    Print("No Jump for You!");
    ReturnEx(0); // Makes the player NOT jump, even though he pressed the jump key.
    return; 
  }
  return;


It is from my head, so you might want to check the syntax(<-- right spelling??)

if you put all of that in the starup section it wouldn't work
2001-08-23, 2:18 PM #5
The syntax looks about right.

Thank you, I'll give it a try. And BTW, does that mean that playeraction should be defined as a message?

I'll try that, too.
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-24, 2:08 AM #6
Nope, :P still doesn't work
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-24, 3:42 AM #7
Just in case set the flag for full 0x7fffffff. So, every keystroke gets trapped.

The cog should be looking like this.

Code:
startup:

SetActionCog(GetSelfCog(), 0x7fffffff);
.
.
.

playeraction:

if(GetParam(0) == 0)
{
   print("No Jump");
   ReturnEx(0);
}
else ReturnEx(1);

return;


And you need to declare playeraction as a message in the symbols section as it's a hardcoded message in the system engine.

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited August 24, 2001).]
2001-08-25, 5:40 AM #8
Thank you oh so very much!!!! I'll try it right away.

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-25, 5:54 AM #9
[http://www.gcwc.net/Images/ss08.jpg]

As you can see, Kyle was able to jump quite well, even with the cog in place :-P [http://forums.massassi.net/html/frown.gif]

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-26, 2:10 PM #10
Let's see the whole cog, and thanks for the *wide* screen shot!

------------------
http://millennium.massassi.net/ - Millennium

[This message has been edited by Hideki (edited August 26, 2001).]
2001-08-28, 12:30 AM #11
But... but...! The COG is HUGE, and placing it in here would compromise various trade secrets. Do you think I should make the PlayerAction thing a seperate COG?

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-08-30, 12:13 AM #12
Well!?!?!?
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-09-03, 10:23 PM #13
Well... Sorry, I was on a vacation.
How about just post the whole playeraction message part and the SetActionCog verb? or I can personally see it through email if you want it that way.

------------------
http://millennium.massassi.net/ - Millennium
2001-09-03, 11:49 PM #14
Code:
symbols

message startup
message playeraction

end

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

code

startup:
SetActionCog(GetSelfCog(), 0x7fffffff);
return;


playeraction:
if(GetParam(0) == 0)
{
   print("No Jump");
   ReturnEx(0);
}
else 
{
ReturnEx(1);
}
return;


The syntax is all apparently correct. I can't seem to find what's wrong, but it still doesn't seem to work.

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2001-09-04, 12:26 AM #15
What the- IT WORKED!!!! IT WORKED!!!!!!!!!!

------------------
Cordially,
Lord Tiberius Grismath
Head Administrator
GCWC.net
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.

↑ Up to the top!