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 → Another cog for peeps to make me!
Another cog for peeps to make me!
2002-08-01, 11:29 PM #1
Okay, let me just post a nice list.

It's an elevator cog.
Controls elevator over 3 floors.
3 Switches per floor.
One call. One for down, and one for up.
Controls three sets of doors (double, so 6 doors total), for each floor.
Speed (of course, and various oth things, like door speed, etc.
Sound support for button press, and elevator start, move and stop.
A part which changes the face of a mat... (quite complex... as in multicelled. When not moving, it has to be on either cell 0, 1 or 2. When moving, has to be on frame 3)

If you can't do any, just tell me. And post below, thanks!

------------------
"Yo! Yo! Yo! Yo-yo!"
We're three million years into deep space. Where the smeg did I get a traffic cone?

<font face="Verdana, Arial" size="2">Originally posted by Avenger:
I'm more worried about the waffle intake. That's a lot of waffles.</font>
2002-08-04, 7:27 AM #2
Peeps, eh? Sounds degrading...

If I were you, TK, I'd ask for help with a little more respect. [http://forums.massassi.net/html/rolleyes.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-04, 7:49 AM #3
I am insulted by your lack of respect.


You resuest should have been more like,


"I come humbly before thee, requesting thy miraculous powers be directed toward my benefit...."

------------------
I used to believe that we only want what we can't have. I was wrong. The truth is, the wonderful truth is, we only want what we think we can't have.

JK editing resources.
And when the moment is right, I'm gonna fly a kite.
2002-08-04, 7:50 AM #4
TK, I'll see if I can do this for ya. OK? [http://forums.massassi.net/html/wink.gif]

------------------
There is no emotion; there is peace.
There is no ignorance; there is knowledge.
There is no passion; there is serenity.
There is no death; there is the Force.
2002-08-04, 8:31 AM #5
Hey, TK, is this for SP, or MP?
2002-08-04, 8:40 AM #6
How 'bout I make double-doors that move with the elev?
2002-08-04, 8:46 AM #7
What SaberMaster and GBK said

------------------
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-08-06, 12:58 AM #8
... whoopsie, wanted to... um... er...

Okay. It's for a lab level I'm doing... so it's gonna be multiplayer. All it really needs, now I think about it, is controlling doors (two per floor...), three floor capabilities (maybe more if I bow and bow humbly, o Gods...), a call switch for each level, and up and down switches.

... I'll never post peeps... damn I did it again... I'll never post the 'P' word ever again.

*Bows humbly to Sabermaster and GBK*

------------------
"Yo! Yo! Yo! Yo-yo!"
We're three million years into deep space. Where the smeg did I get a traffic cone?

<font face="Verdana, Arial" size="2">Originally posted by Avenger:
I'm more worried about the waffle intake. That's a lot of waffles.</font>
2002-08-06, 9:38 AM #9
If they be gods worthy of thy worship, I then should be'st a demi-god!

BOW BEFORE ME, MORT-

/me remembers previous 3 page question topics

Errr...
Cordially,
Lord Tiberius Grismath
1473 for '1337' posts.
2002-08-06, 2:41 PM #10
Alright, but don't overdo it.

I'll post the cog tomorrow. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

[This message has been edited by SaberMaster (edited August 07, 2002).]
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-07, 5:20 AM #11
But first you must also aplogize to me!

------------------
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-08-07, 6:44 AM #12
Here's the code:
Code:
# multifloorelev.cog
#
# A cog to manage an elevator moving between multiple floors. There
# are three switches at each floor - one for up, down, and call. The
# elevator must stop to recieve a new move command.
#
# The elevator itself is expected to have a frame on each floor. Frame 0
# should be the bottom-most floor.
#
# There are two doors at each floor. They are assumed to have two frames.
# frame 0 is the closed position, and frame 1 is open. A floor's set of doors
# will stay open as long as the elevator is on that floor. Each floor is expected
# to have one door from the doorA0 array and one door from the doorB0 array.
#
# This cog as it is supports five floors. It could be modified to use more
# by simply adding more variables - remember to update the linkid.
#
# The numFloors variable tells the cog how many floors you plan to use in
# your level. This is used to prevent the cog from trying to move the elevator
# up to a floor that doesn't exist.
#
# [SM]
#==============================================================#
symbols

message   activated
message   arrived
message   timer

thing     elevator             linkid=30
thing     doorA0               nolink
thing     doorA1               nolink
thing     doorA2               nolink
thing     doorA3               nolink
thing     doorA4               nolink
thing     doorB0               nolink
thing     doorB1               nolink
thing     doorB2               nolink
thing     doorB3               nolink
thing     doorB4               nolink

surface   call0                linkid=0
surface   call1                linkid=1
surface   call2                linkid=2
surface   call3                linkid=3
surface   call4                linkid=4
surface   up0                  linkid=10
surface   up1                  linkid=11
surface   up2                  linkid=12
surface   up3                  linkid=13
surface   up4                  linkid=14
surface   down0                linkid=20
surface   down1                linkid=21
surface   down2                linkid=22
surface   down3                linkid=23
surface   down4                linkid=24

int       numFloors
int       id                   local
int       floor                local

flex      elevspeed=8
flex      doorspeed=5

sound     nudge=lvrclik1.wav

end
#==============================================================#
code
#------------------------------------------------------
activated:
	// if the elevator is moving, return.
	if(IsThingMoving(elevator)) Return;
	id = GetSenderID();
	if(id >= 0 && id < 10)
	{
		// return if elev is already at the floor.
		if(floor == id) Return;
		floor = id;
	}
	else if(id >= 10 && id < 20)
	{
		id = id - 10;
		// if the up switch was pressed while the elev
		// was on another floor, return. Or if this is the
		// top-most up switch, return because you can't
		// go higher.
		if(GetCurFrame(elevator) != id || id >= numFloors - 1) Return;
		floor = id + 1;
	}
	else if(id >= 20 && id < 30)
	{
		id = id - 20;
		// if the up switch was pressed while the elev
		// was on another floor, return. Or if this is the
		// down switch for the first floor, return.
		if(GetCurFrame(elevator) != id || id <= 0) Return;
		floor = id - 1;
	}

	// send the elevator to the floor.
	MoveToFrame(elevator, floor, elevspeed);

	// set whatever switch was activated to cel 1.
	SetWallCel(GetSenderRef(), 1);

	// play an activation sound at the switch.
	PlaySoundPos(nudge, GetSurfaceCenter(GetSenderRef()), 1, -1, -1, 0);

Return;
#------------------------------------------------------
arrived:
	if(GetCurFrame(elevator) != floor) Return;

	// open this floor's set of doors.
	MoveToFrame(doorA0[floor], 1, doorspeed);
	MoveToFrame(doorB0[floor], 1, doorspeed);
	SetTimerEx(1, 0, floor, 0);

	// turn off all switches that could have called/sent the elev.
	SetWallCel(call0[floor], 0);
	SetWallCel(up0[floor - 1], 0);
	SetWallCel(down0[floor + 1], 0);

Return;
#------------------------------------------------------
timer:
	// Wait longer if elevator is still on the same floor.
	if(floor == GetParam(0))
	{
		SetTimerEx(1, 0, GetParam(0), 0);
		Return;
	}

	// close the doors.
	MoveToFrame(doorA0[GetParam(0)], 0, doorspeed);
	MoveToFrame(doorB0[GetParam(0)], 0, doorspeed);

Return;
#------------------------------------------------------
end


The header explains how you should have the level set up for this cog. Let me know if you need anything changed. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-08-09, 8:06 AM #13
... Can you please email it to me..? I'm too lazy to copy it out line by line...

And *various bows to various people who wish apologies...* sorrysorrysorrysorrysorrysorrysorrysorry...

------------------
"Yo! Yo! Yo! Yo-yo!"
We're three million years into deep space. Where the smeg did I get a traffic cone?

<font face="Verdana, Arial" size="2">Originally posted by Avenger:
I'm more worried about the waffle intake. That's a lot of waffles.</font>
2002-08-09, 8:14 AM #14
Thank you. [http://forums.massassi.net/html/biggrin.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-08-09, 12:58 PM #15
Click the edit icon at the top of my post. You can copy the exact text from the edit box. That, or you can get Netscrap. [http://forums.massassi.net/html/smile.gif]

------------------
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.

↑ Up to the top!