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 → Movement Cog
Movement Cog
2002-06-26, 6:18 AM #1
I have a feeling that this would be fairly simplistic to do but I, being one who knows nothing about cogging, must turn to you, the experienced coggers, for help once again. I need a cog for multiplayer that will take a 3do, (designated by me), and make it move when the player steps on it. It will move out to a set destination and once it gets there, it will turn around (stop its forward movement and rotate smoothly 180 degrees) and head back to its starting point. Don't forget that when it gets to its beginning point, it probably has to rotate again to adjust for the angle that it started at. If there is anyone out there that could compile a cog for me that does all that, please let me know! Thanks guys. -Xak
"He called me a murderer and I grabbed his hair and smashed his face into his dinner."
2002-06-26, 8:12 AM #2
Code:
#06/2002 GBK
Symbols
Message Entered
Thing Object
Flex Speed_move=4
Flex Speed_turn=1
Int A=0   Local
End
Code
Entered:
If(A) Stop; A=1;
Movetoframe(Object, 1, Speed_move); Waitforstop(Object);
Movetoframe(Object, 2, Speed_turn); Waitforstop(Object);
Movetoframe(Object, 3, Speed_move); Waitforstop(Object);
Movetoframe(Object, 0, Speed_turn); Waitforstop(Object);
A=0; Stop;
End


In order for this to work correctly;

Frame0 must be its original position.

Frame1 must be the end of the first stretch, just before the turn.

Frame2 will be Frame1, with the turn.

Frame3 is the end of the second trip home.

------------------
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-06-26, 11:28 AM #3
Thanks GBK. That should do it. Hopefully the object's speed isn't too high. -Xak
"He called me a murderer and I grabbed his hair and smashed his face into his dinner."
2002-06-26, 3:57 PM #4
GBK, the problem with that is MoveToFrame() will send the object through every frame on its way to frame 0. And SkipToFrame() won't make the object turn to match the lvec of the frame it sends an object to. My solution would be to add another frame (for a total of five) and use this frame coding:
Code:
MoveToFrame(Object, 1, Speed_move);
WaitForStop(Object);
MoveToFrame(Object, 2, Speed_turn);
WaitForStop(Object);
MoveToFrame(Object, 3, Speed_move);
WaitForStop(Object);
MoveToFrame(Object, 4, Speed_turn);
WaitForStop(Object);
SkipToFrame(Object, 0, Speed_move);
WaitForStop(Object);


And the frames are:

frame 0: original position.
frame 1: reached destination.
frame 2: same pos as frame 1, but turned around.
frame 3: reached original pos.
frame 4: turned around again.

frames 0, 3, and 4 should be at the starting position and frames 1 and 2 should be at the destination.

--------------

Sorry to cut in on your thread, GBK, but I was working on this a few hours ago before I had to go somewhere. [http://forums.massassi.net/html/redface.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-06-26, 5:14 PM #5
Dont worry about cutting in . . . but you misunderstood the code.

Ive known for a long time about the proper usage of 'Movetoframe'. Hell, Ive argued with n00bs countless times over it... The first frame, frame0, is identical to frame3, cept is has an opposite Y axis. . . . perhaps a pictoral referance?

[http://gbk.clanpages.com/misc/frames.gif]

I dont understand why you are throwing in the extra frame, when it isnt needed. [http://forums.massassi.net/html/confused.gif]

Ive used this method before, without problems.

------------------
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-06-27, 8:16 AM #6
When the object is on frame 3, and a MoveToFrame() command is used to move it to frame 0, the object will travel to frame 2 and then to frame 1 on it's way to zero.

I put in frame 4 to turn the object around before skipping directly to frame 0. I actually made a small test level to make sure of this.

------------------
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-06-27, 9:10 AM #7
Hey guys, uh, sorry to cut in here, but... it doesn't work. I input the correct fields, programmed in all the frames, and the skiff (which is the 3do I am using to move) just... well it doesn't move. Please look over the coding again for it just doesn't seem to function... at all. Thanks. -Xak
PS: Ok. If you without a doubt KNOW that this cog will work, send me the fully compiled cog via email. If it still doesn't work... well then I'll see what I can do from there. My email is Xak@balask.com

[This message has been edited by Xak (edited June 27, 2002).]
"He called me a murderer and I grabbed his hair and smashed his face into his dinner."
2002-06-27, 9:49 AM #8
Whoops spoke to soon. Yup I just got it to work. Turns out I had the wrong option clicked on in Jed that prevented me from entering in the correct frames. Its all fixed now so thanks a lot guys. I don't know what I'd do without ya! -Xak
"He called me a murderer and I grabbed his hair and smashed his face into his dinner."
2002-06-27, 9:55 AM #9
You're welcome. [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-06-27, 10:29 AM #10
Oh my. Why didnt I think of that? [http://forums.massassi.net/html/frown.gif]


*bangs head on keyboard*

------------------
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-06-27, 2:44 PM #11
Think Wolfy. Think about how I felt. Or go to Dash_Rendar's most recent topic. That will make you feel much better.

------------------
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

↑ Up to the top!