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 → Hmm my cogknowledge doesn't go this far...
Hmm my cogknowledge doesn't go this far...
2002-07-03, 4:34 AM #1
My next installment in the APT series lacked puzzles so at the Tacc forums made a suggestion. I altered it a bit and made an idea out of it, but an idea I don't have the knowledge for to make reality [http://forums.massassi.net/html/smile.gif].

Here's the idea:

there's a 3do (valve), and when it's activated the first time, it'll spin 3 rounds arround his axis (spinningsound). +

the first time this is done, floodgate00 should move to frame 1
2nd time floodgate01 to frame 1 (woodendoorslide sound)
...
5th time floodgate04 to frame 1
6th time all floodgates return to frame 0 again.

Then there is another 3do (lever) that when activated moves to frame 1 and back to 0.

and IF all floodgates are open:

-changes the sector flags of a couple of sectors to underwater
-changes some surfaces to visable and makes them move (conveyor) (vector: (0/1/0))
-destroy thing B

and when they aren't all open:
-playsoundlocal (jammed sound)

----------------
I'd really appreciate some help on this cog.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-07-03, 10:38 AM #2
Wow, [http://forums.massassi.net/html/eek.gif] it's 1:35 and GBK or SaberMaster hasn't replied to this. Here's a cog for this (I only hope it works the way you want it to [http://forums.massassi.net/html/smile.gif] ).
Code:
# Jedi Knight Cog Script
#
# FLOODGATE.COG
#
# This was writen for ZOOIKes for APT 5, one of the puzzles in it.
# 
# [DP]
#

symbols

thing       rotator
thing       floodgate
thing       floodgate1
thing       floodgate2
thing       floodgate3
thing       floodgate4
thing       lever
thing       destroy

int         time=0                           local
int         allopen=0                        local
int         i                                local
int         rotation                         local
int         active                           local

flex        speed
flex        reset
flex        rotationSpeed
flex        leverSpeed
flex        flowSpeed

sector      water
sector      water1
sector      water2
sector      water3
sector      water4

surface     flow
surface     flow1
surface     flow2
surface     flow3
surface     flow4

sound       jammed

message     startup
message     activated
message     arrived
message     timer

end                                                                           

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

code
startup:
   For(i=0; i<=4; i=i+1) SetSurfaceGeoMode(flow, 4);     // Backup, can be removed if wanted
   rotation = 0;     // If it gets restarted

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

activated:
   If(GetSenderRef() == rotator) 
   {
      If(active) return;
      RotatePivot(rotator, 0, rotationSpeed);
      rotation = 1;
      active = 1;
      time = time + 1;      // Trust me on this, it may seem like it won't work, but it will 
      If(time < 6)
      {
         MoveToFrame(floodgate[time - 1], 1, speed);
         If(time == 5) allopen = 1;
      }
      Else
      {
         allopen = 0;
         Time = 0;
         For(i=0; i<=4; i=i+1) MoveToFrame(floodgate, 0, speed);
      }
   }
   If(GetSenderRef() == lever)
   {
      MoveToFrame(lever, 1, leverSpeed);
      SetTimer(reset);     // Timer that moves the lever to frame one after a defined time
      If(!allopen) PlaySoundLocal(jammed, 1, 0, 0x0);
      Else
      {
         For(i=0; i<=4; i=i+1)
         {
            SetSectorFlag(water, 0x2);
            SetSurfaceGeoMode(flow, 4);     // Makes surface appear, they aren't translucent
            SlideWall(flow, '0 1 0', flowSpeed);
            DestroyThing(destroy);
         }
      }
   }
   Return;

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

timer:
   MoveToFrame(lever, 0, leverSpeed);     // It's simpler this way
   Return;

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

arrived:
   If(rotation == 0) Return;
   RotatePivot(rotator, 0, rotationSpeed);
   rotation = rotation + 1;
   If(rotation == 3)
   {
      rotation = 0;
      active = 0;
   }
   Return;

end
One thing, rotator's has to have a frame 0, and the yaw has to be 360 for this to work.

Last thing, when I play APT 5, I'll know what to do then, if I don't forget. [http://forums.massassi.net/html/biggrin.gif]

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

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

Completed
Judgement Day (HLP), My level pack
2002-07-04, 3:15 AM #3
Here's a cleaned-up version of the cog
Code:
# Jedi Knight Cog Script
#
# FLOODGATE.COG
#
# This was writen for ZOOIKes for APT 5, one of the puzzles in it.
#
# [DP + SM]
#==============================================================#
symbols

thing     rotator
thing     floodgate
thing     floodgate1
thing     floodgate2
thing     floodgate3
thing     floodgate4
thing     lever
thing     destroy

int       i             local
int       done=0        local
int       active=0      local
int       time=0        local

flex      gateSpeed
flex      resetTime
flex      leverSpeed
flex      flowSpeed
flex      rotateTime

sector    water
sector    water1
sector    water2
sector    water3
sector    water4

surface   flow
surface   flow1
surface   flow2
surface   flow3
surface   flow4

vector    rotvel
vector    flowMoveVec

sound     jammed

message   activated
message   timer

end
#==============================================================#
code
#------------------------------------------------------
activated:
	if(GetSenderRef() == rotator)
	{
		if(active) Return;
		active = 1;
		SetThingRotVel(rotator, rotvel);	// start turning the rotator
		SetTimerEx(rotateTime, 2, 0, 0);	// set a timer to stop it later.
		Sleep(rotateTime / 2);	// Don't start the floodgates yet.
		if(time < 6) MoveToFrame(floodgate[time], 1, gateSpeed);
		else
		{
			time = 0;
			for(i = 0; i < 5; i = i + 1) MoveToFrame(floodgate, 0, gateSpeed);
		}
		time = time + 1;
	}
	else if(GetSenderRef() == lever)
	{
		if(time != 5)
		{
			PlaySoundLocal(jammed, 1, 0, 0x0);
			Return;
		}
		if(!done)
		{
			done = 1;
			MoveToFrame(lever, 1, leverSpeed);
			SetTimerEx(resetTime, 1, 0, 0);
			for(i = 0; i < 5; i = i + 1)
			{
				SetSectorFlags(water, 0x2);
				SetFaceGeoMode(flow, 4);
				SlideWall(flow, flowMoveVec, flowSpeed);
			}
			if(destroy > 0) DestroyThing(destroy);
		}
	}

Return;
#------------------------------------------------------
timer:
	if(GetSenderID() == 1) MoveToFrame(lever, 0, leverSpeed);
	else if(GetSenderID() == 2)
	{
		SetThingRotVel(rotator, '0 0 0');
		active = 0;
	}

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


Zooikes:

You didn't say which axis the rotator was to rotate on. The rotvel velocity is provided in the symbols so you can set the direction and speed of the rotation. The rotationTime is the time that the rotator should rotate.

The resetTime flex is how long to wait before sending the lever back to frame 0.

I think everything else is self-explanatory, but ask if you have any questions.

Can't guarantee it'll work first time, but try it and see how it does. [http://forums.massassi.net/html/wink.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-04, 3:20 AM #4
Clearly cleaner then mine. I think RotatePivot() system I did is much more acurate, but yours looks good too.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-04, 3:23 AM #5
Yes, I get to do it. I get to do it. *Does a crappy dance* 9000 posts here at the cog forum. [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif] [http://forums.massassi.net/html/biggrin.gif]

(Well... someone had to do it.)

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-04, 5:24 AM #6
Congrats Pilot [http://forums.massassi.net/html/tongue.gif]

Thanks, Pilot and Saber Master, it doesn't work 100% as I had intented yet, but that's mostely things I just hadn't thought about yet [http://forums.massassi.net/html/smile.gif] But I can probably fix those things myself.
Like sectorthrust in the underwater textures and the fact that after the lever is pulled you can close the floodgates and the water will float throught them [http://forums.massassi.net/html/smile.gif]
I'll have to make sure that either the player can't reach the valve anymore, or I'll just destroy it an replace it with a dummy.
Thanks alot!
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-07-04, 5:40 AM #7
Happy 9000th, Pilot. [http://forums.massassi.net/html/wink.gif]

Good luck with your level, Zooikes. Reply if you need something changed to accomodate your level. [http://forums.massassi.net/html/smile.gif]


About RotatePivot():
Quote:
<font face="Verdana, Arial" size="2">Rotates a thing 90 degrees around the x axis of one of its frames.</font>

So it's not the ideal thing to use in this case.

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-04, 7:36 AM #8
Yes, good luck on APT 5, I'll be waiting for it. Hey, SaberMaster, we should all be celebrating. Just a few hundred more posts and we'll be in the 10,000s. [http://forums.massassi.net/html/wink.gif]

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

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

Completed
Judgement Day (HLP), My level pack
2002-07-04, 10:26 AM #9
To celebrate (kinda) I will let you guys see the start of my first webpage.

------------------
The Sniper Missions. Current project, The Sniper Missions
Major projects working on:
SATNRT, JK Pistol Mod, Aliens TC, Firearms

Completed
Judgement Day (HLP), My level pack
2002-07-05, 3:50 AM #10
It still has some bugs...

When you press the valve the floodgates open as they should, but when they are all open and you press it again, the lever moves to frame1. Then when you press it another time, all floodgates will open.
Then when you press it again, floodgate01 will open then 2 etc, but 'floodgate' won't open again [http://forums.massassi.net/html/frown.gif]

Also what do I have to fill in exactly for the rotvel? I tried (0/200/0) but that didn't do anything. [http://forums.massassi.net/html/confused.gif]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-07-06, 11:03 AM #11
Zooikes, can you email me your level?

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-07, 5:15 AM #12
SaberMaster, I'll e-mail you the level tomorrow or the day after.
I must warn it's 9,5 megs...
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-07-07, 7:07 AM #13
Try squishing it a little... [http://forums.massassi.net/html/wink.gif]

------------------
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-07-07, 8:21 AM #14
Well, because of the size limit of my inbox, I couldn't receive an email that big. Strip all the unnecessary things from the level (such as new textures) and then compress the files. It'll have to be below 3.8 Megs. [http://forums.massassi.net/html/frown.gif]

------------------
Author of the JK DataMaster, Parsec, and the EditPlus Cog Files.
Visit Saber's Domain.
Author of the JK DataMaster, Parsec, Scribe, and the EditPlus Cog Files.
2002-07-07, 9:34 AM #15
It IS compressed [http://forums.massassi.net/html/smile.gif] (zipped)

I'll remove the textures and such and see if it works.
I'm affraid I don't have any space at my server at the moment, so putting it on my site is out of option... (Hmm, my site is down anyway because I exceeded the limit [http://forums.massassi.net/html/smile.gif])

EDIT: nifty program GBK, it detracted 2,2 megs of the origional !! [http://forums.massassi.net/html/eek.gif] (7,3 megs, still too much)

EDIT 2: Impressive!!!, winACE comes to only 8,7 megs.

[This message has been edited by ZOOIkes (edited July 07, 2002).]
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-07-07, 9:58 AM #16
K, I deleted some cogs, all new textures, bms, sfts, and alot of other stuff, and now the ZIP file is only 2,67 megs.
So this is going to be a nice walk in dflt.mat land for you [http://forums.massassi.net/html/smile.gif]

I'll send it tomorrow or the day after, depends on the ammount of time I have.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com
2002-07-08, 1:45 AM #17
Check your mail.
APT 1, 2, 3/4, 5/6
TDT
DMDMD

http://veddertheshredder.com

↑ Up to the top!