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 → Something wrong with this cog?
Something wrong with this cog?
2003-05-29, 7:27 AM #1
I downloaded here the shootable switch cog, and when I shoot the switch, the door just plays open noice but doen't do anything!

posted May 28, 2003 05:40 AM
--------------------------------------------------------------------------------
Here is the cog:

Code:
# Jedi Knight Cog Script
#
# TJC_shootdoor.cog
#
# Script for a door controlled by two shootable switches.
#
# This Cog is Not supported by LucasArts Entertainment Co
symbols
surface switch mask=0x448 
surface switch2 mask=0x448 
thing door 
flex speed 
message damaged 
message timer 
sector doorsector 
int garbage local 
int activeono=0 local 
int which local
message startup 
end 

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

code
startup:
SetSectorAdjoins(doorsector, 0);
damaged:
if (activeono == 1) return;
if (GetSenderRef() == door) return;
garbage = SetWallCel(GetSenderRef(), 1);
which = GetSenderRef();
SetSectorAdjoins(doorsector, 1);
MoveToFrame(door, 1, speed);
WaitForStop(door);
SetTimer(delay);
return;

timer:
MoveToFrame(door, 0, speed);
WaitForStop(door);
SetSectorAdjoins(doorsector, 0);
garbage = SetWallCel(which, 0);
activeono = 0;
return;
# ........................................................................................
end


Thanks for anyhelp

------------------

[Code tags, please....]

[This message has been edited by GBK (edited May 29, 2003).]
There 10 kinds of people in the world: Those who understand binary arithmetics, and those who don't.
2003-05-29, 8:14 AM #2
if you think its the cog you can try this one.
Code:
#=====
# Jedi Knight Cog Script
# TJC_shootdoor.cog
# -Script for a door controlled by two shootable switches.
# This Cog is Not supported by LucasArts Entertainment Co.
#=====
symbols
#-----
message   startup
message   damaged
message   arrived
message   timer
surface   switch1     linkid=1 mask=0x48
surface   switch2     linkid=1 mask=0x48
thing     door=-1     linkid=2
flex      move_spd=8.0
flex      openWait=2.0
sector    door_sec     local
int       is_on=0     local
#-----
end
#=====
code
#-----
startup:
  door_sec = GetThingSector(door);
  SetSectorAdjoins(door_sec, 0);
return;
#-----
damaged:
  if(is_on == 1) return;
  if(GetSenderID() == 2) return;
  is_on = 1;
  SetWallCel(GetSenderRef(), 1);
  SetSectorAdjoins(door_sec, 1);
  MoveToFrame(door, 1, move_spd);
  ReturnEx(0);
return;
#-----
arrived:
  if(GetSenderRef() != door) return;
  if(GetCurFrame(door) == 1)
    SetTimer(openWait);
  else
    SetSectorAdjoins(door_sec, 0);
return;
#-----
timer:
  MoveToFrame(door, 0, move_spd);
  SetWallCel(switch1, 0);
  SetWallCel(switch2, 0);
  is_on = 0;
return;
#=====
end

its just a modified version of the one you posted so the setup is almost the same.
but if its making the moving noise but not moving it may be something else.
if the cog doesnt work post the template of the door.

ps- code tags would be nice.

------------------
Famous last words - "It seemed like a good idea at the time."

[This message has been edited by DSLS_DeathSythe (edited May 29, 2003).]
Famous last words - "It seemed like a good idea at the time."
2003-05-29, 7:38 PM #3
Ok, thanks. I'll try it when I get to home. The door is just simple door which can be selected from walkstructs section.
btw, how do you add those code tags?

------------------
There 10 kinds of people in the world: Those who understand binary arithmetics, and those who don't.
2003-05-29, 7:54 PM #4
Type (code) before the code and (/code) after it for code tags. NOTE: replace the ( with a [ I only used the parenthesis so that it wouldn't actually make code tags.
Hope you understood that.

------------------
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
Sam: "Sir we can't call it 'The Enterprise'"
Jack: "Why not!"
2003-05-30, 7:27 AM #5
go here to check out what code tags are.

------------------
Famous last words - "It seemed like a good idea at the time."
Famous last words - "It seemed like a good idea at the time."

↑ Up to the top!