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 → Hmm...
Hmm...
2005-06-23, 11:38 AM #1
Why dosen't this work?

Code:
# FORCE_SEEING.COG

symbols

thing       player                           local

flex        cost=0.0                         local
flex        mana                             local

sound       seeingSound=ForceSee01.WAV      local
sound       seeingSound2=ForceSee02.WAV     local
int         channel=-1                       local

int         rank=0                           local
int         flags=0                          local
int         old_flags=0                      local

int         effectHandle=-1                  local

template    blah=blah		             local

message     activated

end

code

activated:
   player = GetLocalPlayerThing();
   if(toggle)
   {
      SetThingCurGeoMode(player, 5);
      Print("Invibility OFF");
      toggle = 0;
   }
   else
   {
      SetThingCurGeoMode(player, 0);
      Print("Invisibility ON");
      toggle = 1;
   }
   SetInvActivated(player, 23, toggle);
   Return;

newplayer:
   Sleep(2.0);
   SetInvActivated(player, toggle);
   SetInvAvailable(player, 23, 4);
   SetInv(player, 23, 4);
   if(!IsInvActivated(player, 23))
   {
      if(GetThingCurGeoMode(player) == 5))
      SetThingCurGeoMode(player, 0);
   }

Return;

end


Basically, when I turn it on it should make the player invisible, and visible again when I activate it. If it's on and I die, it should still be on when I respawn.

But...it dosen't work.

Any help would be great.

ReT
2005-06-23, 1:24 PM #2
Well, for one, you haven't told the cog what 'player' is.

add

Code:
startup:
player = GetLocalPlayerThing();
Return;
-There are easier things in life than finding a good woman, like nailing Jello to a tree, for instance

Tazz
2005-06-23, 1:53 PM #3
Still dosen't work...thanks though.

ReT
2005-06-23, 2:04 PM #4
Does it Print anything? Also, insert a print just below activated and see if at least this works...
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2005-06-23, 2:28 PM #5
Code:
if(GetThingCurGeoMode(player) == 5))
is messed up, too many end parenthesis.

Under newplayer:, you used SetInvActivated() and SetInvAvailable() incorrectly.

There is no proper GeoMode 5 (you should be using 4 instead).

Under activated:, player = GetSourceRef(); is more proper than player = GetLocalPlayerThing();.

The Sleep() under newplayer: is pointless.

The variable "toggle" isn't initialized in the symbols section (or in a startup:/newplayer: section) and "blah" is pointless.

QM
2005-06-24, 1:39 PM #6
Well, I tried everything and it still dosen't work. Don't worry about it though, it's not terribly important.

Any ideas on keeping the invisbility on? It always turns off upon death. If anyone could figure that out, that would be great.

ReT
2005-06-25, 2:29 AM #7
In kyle.cog, put a call to this cog?
2005-06-25, 8:17 AM #8
I think I got this figured out, I'm going to use the 0x10 flag instead.

Thanks all.

ReT

↑ Up to the top!