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 → 3do question
3do question
2004-01-22, 4:52 PM #1
When I step on a 3do, like an elevator, I need it to go from frame 1 to frame 2 and when I walk off it, it goes back to frame 1. Is it possible to do this by JUST walking on the 3do?

------------------
Pumpkins are the only living organisms with triangle eyes.
Pumpkins are the only living organisms with triangle eyes.
2004-01-22, 5:24 PM #2
I think either the touched message or even the entered/exited messages would work for that. Maybe something like:

Code:
# [ST] - 1/22/04
# The start frame is frame 0,
# the frame where you want the
# elevator to move to when you
# step on it is frame 1.
symbols
message entered
message exited
thing elevator
flex speed=2
end

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

code
entered:
MoveToFrame(elevator, 1, speed);
return;

exited:
MoveToFrame(elevator, 0, speed);
return;
# ..............................

end


[EDIT]
NOTE: UNTESTED!
Forgot to mention that.
[/EDIT]

------------------
*Takes out his blaster and fires shots at the wall, the blastmarks leave the words "S-TROOPER WUZ 'ERE!!!"

[This message has been edited by Stormtrooper (edited January 22, 2004).]
2004-01-23, 1:29 AM #3
Here's a thought...
Code:
# Walk on, go up
# Walk off, go down
#
# By Edward
symbols

message    startup
message    entered
message    exited

thing      elev
sector     shaft

flex       speed

end
#
code
startup:
        MoveToFrame(elev,0,100);
return;
entered:
        If(GetSenderRef()!=shaft) return;
        MoveToFrame(elev,1,speed);
return;
exited:
        If(GetSenderRef()!=shaft) return;
        MoveToFrame(elev,1,speed);
return;
end

Now this requires that the elevator's path will stay in one sector. You enter the shaft sector, it goes up. Leaving the shaft, it'll go down.
But now I wonder... Why do you want this kind of stuff. If you jump down again, using Stormtroopers COG, and touche the elevator, it would go up and you wouldn't get beack down... Unless you have another one on another side.

Oh, and untested, but very sure it'll work. Too simple to go wrong. If I have missed something, I'm open for compaints!

/Edward
Edward's Cognative Hazards
2004-01-23, 1:57 AM #4
exited and entered works for 3dos and surfaces alredy. You shouldnt use that sector.

------------------
The miners of Kiith Somtaaw sacificed much, and risked all. For their efforts they were brought into the inner most circle of Hiigaren power. Naabal, S'jet, and Sobanii bowed before them. And from that day to this, Somtaaw's children have been known to one and all as Beastslayers..
2004-01-23, 10:26 AM #5
Why won't it let me delete this one?!? (I accidentally double-posted [http://forums.massassi.net/html/redface.gif])

[This message has been edited by Darth Slaw (edited January 23, 2004).]
May the mass times acceleration be with you.
2004-01-23, 10:28 AM #6
In the exited message in Edward's cog, it makes more sense for the "MoveToFrame(elev,1,speed);" command to be:
MoveToFrame(elev, 0, speed);
because, otherwise, the elevator will never return to frame 0. Just doing some complaining for ya [http://forums.massassi.net/html/wink.gif]

------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team

[This message has been edited by Darth Slaw (edited January 23, 2004).]
May the mass times acceleration be with you.
2004-01-23, 12:09 PM #7
I was just using the elevator as an example. I'm actually focusing on 'switches' like in the N64 zelda game. Step on a switch and a door opens. =] Walk off and the door closes.

------------------
Pumpkins are the only living organisms with triangle eyes.
Pumpkins are the only living organisms with triangle eyes.
2004-01-23, 12:33 PM #8
Ok, sorry, my bad with frame 0.

And for the switch as in Zelda (also used in JO's force training session) you'll need... I know! You have two things. The switch that sinks, and the door that opens. you can use entered and exited on either thing, surface, or sector. Touched is used if you walk into something, entered/exited is when you walk onto soemthing.

/Edward
Edward's Cognative Hazards
2004-01-23, 1:15 PM #9
Yes. Edward is right about the touched message. As I learned the hard way, touched doesn't work with anything that is stepped on (essentially any floor items/surfaces/etc). [yoda]Thank GBK for the info I do[/yoda] [http://forums.massassi.net/html/smile.gif].

------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team

[This message has been edited by Darth Slaw (edited January 23, 2004).]
May the mass times acceleration be with you.
2004-01-24, 10:14 AM #10
Thanks guys. I need your cogging skills once again. [http://forums.massassi.net/html/wink.gif]

I have two switches that need the 'walk on: switch goes to frame 1 / walk off: switch goes back to frame 0' feature. However, the switches won't activate a door opening unless one player stands on one switch and the other player stands on the other switch. A good example of this being used was shown in Zelda: Wind Waker in the Earth Temple and the Wind Temple. I appreciate you taking time to help me. =]

------------------
Pumpkins are the only living organisms with triangle eyes.
Pumpkins are the only living organisms with triangle eyes.
2004-01-25, 10:06 AM #11
Try this (Edward, I borrowed your code [http://forums.massassi.net/html/smile.gif] ).
Code:
# Walk on both, open
# Get off, close
#
# Original code by Edward
# Modified by Darth Slaw
#---------------------------
symbols

message    startup
message    entered
message    exited

thing      switch1
thing      switch2

thing      door

int        status=0        local

flex       speed=2.0

end
#---------------------------
code
#---------------------------
startup:
        MoveToFrame(door, 0, 100);
return;
#---------------------------
entered:
	if((GetSenderRef() == switch1) && (status == 0 || status == 2)) 
		status = status + 1;
	else if((GetSenderRef() == switch2) && (status == 0 || status == 1))
		status = status + 2;
	else return;

	if(status == 3) 
		MoveToFrame(door,1,speed);
return;
#---------------------------
exited:
	if((GetSenderRef() == switch1) && (status == 1 || status == 3)) 
		status = status - 1;
	else if((GetSenderRef() == switch2) && (status == 2 || status == 3))
		status = status - 2;
	else return;

        MoveToFrame(door,0,speed);
return;
#---------------------------
end


------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team
May the mass times acceleration be with you.
2004-01-27, 9:40 AM #12
That's exactly what I needed. Thanks bro. There's only one bug in this though: If a player is on a pedestal and stays there while another player walks on that pedestal and then walks off and goes to the other one, the door doesn't activate. It doesn't matter, but I'm just curious if there's even a way to prevent that from happening?

------------------
Pumpkins are the only living organisms with triangle eyes.
Pumpkins are the only living organisms with triangle eyes.
2004-01-27, 11:43 AM #13
I'm not sure if I can get around that. Maybe I can. I'll add it to my to-do list. [http://forums.massassi.net/html/wink.gif]

[edit] Okey Doke. This is what I came up with. It uses a different format than the last one. In this one, you enter the sector the player should be standing in to be considered "on" the switch. Then, when the sector is entered, it checks to see if both sectors have at least one player in them. If they do, the door opens. When one of the sectors is exited, the cog checks if there are still at least one player in both sectors. If there is not, then it closes the door.

Code:
# Walk on both, open
# Get off, close
# No more bugs with players getting on and off (hopefully)
#
# Original code by Edward
# Modified by Darth Slaw
# 1/27/03
#---------------------------
symbols

message    startup
message    entered
message    exited

thing      door

sector     sector1
sector     sector2

flex       speed=2.0
int        temp             local

end
#---------------------------
code
#---------------------------
startup:
        MoveToFrame(door, 0, 100);					//make sure door is shut
return;
#---------------------------
entered:
	if(GetSectorPlayerCount(sector1) > 0 && GetSectorPlayerCount(sector2) > 0)
		MoveToFrame(door,1,speed); 				//open door
	else
		MoveToFrame(door,0,speed); 				//make sure door is shut

return;
#---------------------------
exited:
	if(GetSectorPlayerCount(sector1) <= 0 || GetSectorPlayerCount(sector2) <= 0)
	        MoveToFrame(door,0,speed); 				//close door
	else
		MoveToFrame(door,1,speed); 				//make sure door is open

return;
#---------------------------
end

Hope this works for you. [http://forums.massassi.net/html/smile.gif]

Oh, and this has not been tested.

------------------
I am Darth Slaw.
The Dark Lord of the Sith,
And part of the Nightfire mod team

[This message has been edited by Darth Slaw (edited January 27, 2004).]
May the mass times acceleration be with you.

↑ Up to the top!