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 → Scary
Scary
2002-11-28, 6:30 AM #1
Its very scary when a cog, clean checked by Parsec, just flat out refuses to work. NO print statements appear, nothing moves. It just simply won't work! I'd bet its something small, that I missed and it'll make me look n00bish, but I jsut can't get it to work. And watch my useage of the w00tage code tags
Code:
# Jedi Knight Cog Script
#
# SECRET_ELEV.cog
#
# Elevator under the bed in Inflitration. Moves by touched and the call switch.
# Bed moves at same speed as elevator.
#
# [DP]
#

symbols

message         entered
message         activate
message         arrived
message         timer

surface         call

thing           elevator
thing           bed

flex            start_wait=0.1
flex            sleeptime=3
flex            speed=4

sound           wav0=Activate02.wav

end

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

code
Entered:
   Print("Entered: called");
   If((GetSenderRef() != elevator)||(GetCurFrame(elevator) != 0)) Return;
   Sleep(start_wait);
   MoveToFrame(elevator, 1, speed);
   Return;

# ........................................................................................

Activate:
   Print("Activate: called");
   If(GetSenderRef() == bed)
   {
      If(GetCurFrame(bed) == 0) MoveToFrame(bed, 1, speed);
   }
   Else
   {
      If(GetWallCel(call) == 1) Return;

      SetWallCel(call, 1);
      PlaySoundPos(wav0, SurfaceCenter(call), 0.6, -1, -1, 0);
      MoveToFrame(elevator, 1, speed);
   }
   Return;

# ........................................................................................

Arrived:
   If(GetSourceRef() == bed) Return;
   If(GetCurFrame(elevator) == 0)
   {
      SetWallCel(call, 0);
      PlaySoundPos(wav0, SurfaceCenter(call), 0.6, -1, -1, 0);
   }
   Else SetTimer(sleeptime);
   Return;

# ........................................................................................

Timer:
   MoveToFrame(elevator, 0, speed);
   Return;

end
Remember kids, only dumb***es don't use code tags. [http://forums.massassi.net/html/wink.gif]

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-11-28, 8:42 AM #2
A guess in the dark, but I know certain words are reserved and using them as variables in not allowed.

For example you can't use something like

STOP = GetTHingModel(player);

because stop; is a verb.

I think you using 'call' as a variable
might be conflicting with the call function.

Example:

call stop_power;
- Wisdom is 99% experience, 1% knowledge. -
2002-11-28, 9:43 AM #3
[http://forums.massassi.net/html/redface.gif] yep, that'd be it. I always seem to forget the call verb. Spare me the lecture. I understand more about cog then you've just given me credit for.

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.

[This message has been edited by Descent_pilot (edited November 28, 2002).]
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-11-28, 10:24 AM #4
Sorry.
- Wisdom is 99% experience, 1% knowledge. -
2002-11-28, 10:44 AM #5
I once tried using return as an integer... but lets not go into that.
Team Battle.
2002-11-28, 11:03 AM #6
Try using '//' for your comments instead of '#' in the code section [http://forums.massassi.net/html/smile.gif]

Raynar
Pagewizard_YKS: "making your own lightsaber doesn't make you a nerd... "
Raynar - the man with a 10.75" ePenis
2002-11-29, 2:27 PM #7
So your secret elevator will be a bed...interesting.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2002-12-01, 2:56 PM #8
James Bond type of elevator. It's above the upside down topside of the bed. ( For those who can't figure out what that means, like me, its under the bed. [http://forums.massassi.net/html/tongue.gif] ) Bet'cha didn't expect that!

------------------
The Sniper Missions. Current project, The Sniper Missions

The Magician Saber System.
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack

↑ Up to the top!