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 → Complicated Cog.
Complicated Cog.
2004-06-20, 1:12 PM #1
I am interested in a cog, i would make it myself if i knew how, but i dont so, here it goes. What i wanted the cog to do was control doors, if someone was in say, the room, and someone else comes along and tries to open the door, it wont open, but if no one is in the room, then the door opens. I assume it will be nearly impossible because the person would want to get out after entering.


Vane

------------------
There's only one thing that im scared of, and it's Pixels... THERE EVERYWHERE!!!! AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! *runs threw a wall*
There's only one thing that im scared of, and it's Pixels... THERE EVERYWHERE!!!! AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! *runs through a wall*
2004-06-20, 5:16 PM #2
Code:
# Jedi Knight Cog Script
#
# Control doors -- sector is the control sector; only players in that sector may open
#  the door, or if there's no one in the sector, anyone may open it.
# 
# [Darth Slaw]
# 
# This Cog is Not supported by LucasArts Entertainment Co

symbols

message   activated
message   arrived
message   timer

sector    ctrlsector

thing     door

flex      speed=5.0
flex      wait=2.0

end

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

code
activated:
	if((GetCurFrame(door) == 0 && !IsThingMoving(door)) && (GetSectorPlayerCount(ctrlsector) == 0 || GetThingSector(GetSourceRef()) == ctrlSector))
	{
		MoveToFrame(door, 1, speed);
	}
stop;
# ........................................................................................
arrived:
	if(GetCurFrame(door) == 1 && !IsThingMoving(door))
	{
		SetTimer(wait);
	}
stop;
timer:
	MoveToFrame(door, 0, speed);
stop;
end

[edit]Heh, I realized I forgot to parse; parsec saved me a heap of trouble -- I messed up on my parenthases, had one extra [http://forums.massassi.net/html/redface.gif]

[This message has been edited by Darth Slaw (edited June 20, 2004).]
May the mass times acceleration be with you.
2004-06-21, 9:29 AM #3
Thanx a lot [http://forums.massassi.net/html/smile.gif], i havent tried it yet, but i will soon.

------------------
There's only one thing that im scared of, and it's Pixels... THERE EVERYWHERE!!!! AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! *runs threw a wall*
There's only one thing that im scared of, and it's Pixels... THERE EVERYWHERE!!!! AHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH! *runs through a wall*

↑ Up to the top!