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 → Need to know what cog to use on elevator in MotS...
Need to know what cog to use on elevator in MotS...
2001-12-19, 2:29 AM #1
Ok, I am taking the Basic Elevators tutorial, but it turns out it was written for JK. So everything's the same until we get to the cog I need for the elevator- it's not the same as the one I need in MotS, apparently, because I cannot find it.

I am trying to make a simple elevator that if you step on it, brings you down to the level below. Don't wanna deal with switches if I don't have to, so can someone let me know what cog to use, and what I need to do with it once I've got it?
2001-12-19, 5:51 AM #2
Put simply, I dont think there are ANY JK cogs that wont run in MOTS. However, the basic LEC elev cog suxors, try this one:

Code:
# Door script.  Operated by:
#
# On startup.
# Activation.
# Thing killed.
# Crossing adjoin.
# Entering sector.
# Touching surface/thing.
#
# 11/2001, 12/2001 GBK
#
# Version 0.6

Symbols
Message Startup
Message Activated
Message Killed
Message Crossed
Message Entered
Message Touched
Message Timer
Message Arrived
Message Blocked
Thing Player				Local
Thing Door0				LinkID=2
Thing Door1				LinkID=2
Thing Door2				LinkID=2
Thing Door3				LinkID=2
Flex Movespeed=4.0
Int Lastframe=1
Flex Sleeptime=5.0		#How long to wait before closing door.  -1 = dont close door.
Int Allow_door=1		#Allow door to be directly acitvated?  0/1 - no/yes
Thing Victem
Flex Kill_wait		#How long to wait before opening door after death of victem.
Thing Touch_thing			LinkID=1
Surface Touch_surface		LinkID=1
Surface Switch0			LinkID=3
Surface Switch1			LinkID=3
Surface Adjoin
Sector Enter_sector
Int Allow_block=1		#Allow door to be blocked?  0/1 - no/yes
Int Start_up=0		#Open door on startup?  0/1 - no/yes
Flex Start_wait=1.0		#If so, how long to wait?
Sound Beep=Beep2.wav
Int I=0				Local
Int Door=0				Local
End
Code
Startup: Player = Getlocalplayerthing();
If(Start_up == 0) Stop; 
Sleep(Start_wait); Call Movedoor; Stop;
Activated: If(GetsenderID()==3 && Isthingmoving(Door0) == 0 && 
Isthingmoving(Door1) == 0 && Isthingmoving(Door2) == 0 && 
Isthingmoving(Door3) ==0 && Getcurframe(Door0)==0 &&
Getcurframe(Door1)==0 && Getcurframe(Door2)==0 &&
Getcurframe(Door3)==0) { Call Kill_timer; Setwallcel(Switch0, 1); Setwallcel(Switch1, 1); 
Playsoundpos(Beep, Surfacecenter(Getsenderref()), 1.0, -1, 4, 0); Call Movedoor; }
If(Allow_door == 0) Stop;
If(GetsenderID() == 2) { Call Movedoor; } Stop;
Killed: If(Getsenderref() == Victem) { Sleep(Kill_wait); Call Movedoor; } Stop;
Crossed: If(Getsenderref() == Adjoin) { Call Movedoor; } Stop;
Entered: If(Getsenderref() == Enter_sector) { Call Movedoor; }
Touched: If(GetsenderID() == 1) { Call Movedoor; } Stop;
Movedoor: If((Isthingmoving(Door0) == 0) && (Getcurframe(Door0) == 0)) {
For(I=0;I<=3;I=I+1) { Movetoframe(Door0, Lastframe, Movespeed); } } Stop;
Arrived: If(GetsenderID() != 2) Stop;
Call Kill_switch;
If(Sleeptime == -1) Stop;
Door = Getsenderref(); 
If(Getcurframe(Door) == Lastframe && Isthingmoving(Door) == 0) {
KilltimerEX(Door); SettimerEX(Sleeptime, Door, 0, 0);  } Stop;
Timer: Door = GetsenderID(); Movetoframe(Door, 0, Movespeed); Stop;
Blocked:  If(Allow_block == 0 || GetsenderID() != 2) Stop;
Door = Getsenderref(); Killtimer(Door); 
If(Getgoalframe(Door) == 0) { Stopthing(Door); 
Movetoframe(Door, Lastframe, Movespeed); }
Else { Stopthing(Door); Movetoframe(Door, 0, Movespeed); Call Kill_switch; }
Stop;
Kill_switch: If(Getwallcel(Switch0) == 1) { 
Setwallcel(Switch0, 0); Setwallcel(Switch1, 0); } Stop;
End




 


I intended it to be a door cog, but I have found it can handle simple elevators quite well.


To set up a simple elevator:

 

Set 'Door0' as your elevator.

Set 'Allow_door' to 0.

Set 'Touch_thing' as your elevator.

Set 'Allow_block' to 0.

Tweak the 'Lastframe', 'Movespeed', and 'Sleeptime' variables to your liking, but it should work fine with the default settings.


------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-19, 5:57 AM #3
Hmm, I just re-read your post.

Copy the cog into notepad. Save it as "GBK_Udoor.COG".

Place this cog in your project directory.

In the cog resource picker, click on the 'project dir' heading.

Select the cog.

Complete the variables.


 

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-20, 3:24 AM #4
Ok, I did what you said, but when I go to "Add Cog" and select "Project Directory" it shows there is no cogs in there. That may be because on my stupid comp, I can't change the format of a file just by adding another ending to it.
For example, the file I saved thatw as supposed to be the cog ended up

GBK_UDoor.COG.txt

Not good.
2001-12-20, 4:05 AM #5
Click the view tab in Folder Options. You'll see a checked option which reads, "Hide file extensions for known file types." Uncheck that option and OK the dialog box. You'll see the file's extension and be able to change it by renaming.

------------------
Incognito
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2001-12-20, 4:10 AM #6
Another way to get around this: When you save in notepad, change the save as type combo box to '*.* All Files' (rather than *.txt - text files).

------------------
"Sleeping makes me tired."

-Inspector Gadget
COUCHMAN IS BACK BABY
2001-12-20, 10:08 AM #7
Folder Options? Hmmm? Where is that?

And also, what exact folder should I put the cog in? The folder I have in my JED directory called "Projects"?
2001-12-20, 11:37 AM #8
In win98, Start/Settings/Folder Options.

Click on the 'View' tab at the top, youll see the option.


Place in in the same dir as your .JED file.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-21, 3:07 AM #9
AAAAAAAAHHHHHHHH! Ok, so I unchecked the thing in Folder Options, and sure enough, it now shows the file extensions. But it still won't change them, even when I change .txt to .COG. [http://forums.massassi.net/html/frown.gif]
2001-12-21, 4:39 AM #10
Right-click the following link, and click on 'Save target as'.

GBK_Udoor.cog.



------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-21, 9:35 AM #11
Bahhhhh, I gve up [http://forums.massassi.net/html/frown.gif]

I did what you said, and it saved it as a .txt file! [http://forums.massassi.net/html/frown.gif] AARRRRRRRGGGGGGGHHHHHH! I didn't tell it to, it just did [http://forums.massassi.net/html/frown.gif]
2001-12-21, 9:55 AM #12
Re-download it. In the combo box, select 'all files' in the 'Save as type' menu. Then, download it.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-21, 1:17 PM #13
No luck. No matter how I try to save it, in considers it a .txt file.
If somone were to send it to me, like over ICQ, already saved as a .COG, you think that woudl work?
2001-12-21, 1:39 PM #14
Quote:
<font face="Verdana, Arial" size="2">Originally posted by Connemara:
even when I change .txt to .COG.</font>


Try this: Strip all of the extensions off of the file. Make it a bare 'GBK_Udoor'. The icon for it should change to the default 'unknown file type'. Then, add the '.cog' extension.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-21, 3:43 PM #15
Nope, it's soemthing in my comp, apparently that automatically interprets files of that type as .txt. I don't know why, but it's an internal settng it seems.
2001-12-22, 3:30 AM #16
However, I still think of somone could actually send me the file off their comp, in .COG format, it would be fine. I have all the .cog files that came with JED, but my comp will not allow me to save anything as .COG
2001-12-22, 5:09 AM #17
Click me.


Thats in ZIP format. Decomress it to your project dir.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.
2001-12-22, 9:21 AM #18
Ok, yay! The cog is there [http://forums.massassi.net/html/smile.gif]

Now, what do yu mean by "Set 'Door0' as your elevator" and "set Touch_thing as your elevator"?
2001-12-22, 10:02 AM #19
Ok, step by step instructions:

 

Add the cog.

Set 'Allow_door' and 'Allow_block' to 0.

Select your elevator.

Click on the entry box for 'Door0'.

Press the 'Get selected item' button.

Click on the entry box for 'Touch_thing'.

Press the 'Get selected item' button.

Press the 'Refresh' button.


Task complete.

------------------
Success is the inverse relationship between effort, gain, and loss.
And when the moment is right, I'm gonna fly a kite.

↑ Up to the top!