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 → Jump Pads
Jump Pads
2004-04-25, 8:13 AM #1
I want to put jump pads in my multiplayer level like the ones in Quake 3 Arena and in Unreal Tournament. Does anyone know of any cogs that would allow this, since I have no clue on how to create one that will?
2004-04-25, 8:56 AM #2
Check a level called morpheus...or I'm sure anyone will write you a short cog. It's not too difficult.

[Edit]
Ok, here is my quick try:
Code:
symbols

thing pad

vector direction
flex speed

message touched

end

code

touched:
 if(GetSenderRef() != pad) Return;
 ApplyForce(GetSourceRef(), VectorScale(direction, speed));
 Return;

end


------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)

[This message has been edited by zagibu (edited April 25, 2004).]
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-04-25, 9:00 AM #3
Well, first off, you need
"Waffers! Lots, of Waffers!"
Sorry... Been watching The Matrix XP

Anyway... there are Jump Pad COGs out there. But, how about me explaining to you how to make one... Step one! Symbols... Have an Entered message, a vector, and a sector or surface. In the code, add your entered: message, followed by if(GetSenderRef()!=surface or sector) and return; This checks to see if you have entered the specified sector/surface above. If not, don't continue.
Next, DetachThing(GetSourceRef()); GetSourceRef() is who has entered, and DetachThing makes him leave the floor. Like a small jump.
Next is simple. SetThingVel(GetSourceRef(),vector); The vector is direction the person flies in. As it's a jump pad, always make Z a positive number.
Now, it should look something like this:
Code:
symbols

message    entered

surface    stepon

vector     direction

end
#
code
entered:
        if(GetSenderRef()!=stepon) return;
        DetachThing(GetSourceRef());
        SetThingVel(GetSourceRef(),direction);
return;
end

That simple... For added effects, read on:

If you want a sound, add a sound in the symbols, and then between DT and STV add PlaySoundPos(sound,GetThingPos(GetSourceRef()),1,-1,10,0x0);

If you want the surface to play an animation when you take off, make sure your material has multi cels, add that to your surface, and then add in the code between DT and STV, SurfaceAnim(surface,fps,0x0); the fps is Frames per Second.

Now, with all added effects, you should have (with surface):
Code:
# Jump Pad
#
# By Edward
symbols

message    startup
message    entered
message    timer

surface    stepon

vector     direction

sound      bounce

end
#
code
startup:
        SetWallCel(stepon,0);
return;
entered:
        if(GetSenderRef()!=stepon) return;
        DetachThing(GetSourceRef());
        PlaySoundPos(bounce,GetSurfaceCenter(stepon),1,0,10,0x0);
        SurfaceAnim(stepon,16,0x0);
        SetThingVel(GetSourceRef(),direction);
        SetTimer(1);
return;
timer:
        SetWallCel(stepon,0);
return;
end

Now, I added some other stuff here. At startup, I set the material on the surface to frame 0 (start), just in case of problems. The surface anim goes at 16 fps, because I use a custom material that has 16 frames. After one second, the material will be reset. If you use a material that has 2 frames, I'd suggest use 4 frames a second, and change the timer to 0.5. Alot of maths is put into this... "That's Mathematics!" (Tom Lehrer)

Hope that's enough?

/Edward
------------------
I am Edward!
He who clutters up the forums with meaningless explainations...
Edward's Cognative Hazards
2004-04-25, 9:03 AM #4
Oooook, Edward beats me to it. But mine works with things.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-04-25, 9:49 AM #5
Thanks for the help guys!!!

You both get a 100 cookies! [http://forums.massassi.net/html/tongue.gif]

------------------
Fear, It Controls The Fearful. The Strong. The Weak. The Innocent. Fear Is My Ally!

The Arcane Sith
2004-04-25, 11:26 AM #6
I'd rather see the level get released.

------------------
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
"Häb Pfrässe, süsch chlepfts!" - The coolest language in the world (besides Cherokee)
2004-04-25, 11:31 AM #7
100 cookies? Ooooo greate... Oh, yes... I forgott to say that things will also do. Where it says surface in my code, you can replace it with sector or thing... The entered message tests to see if you have entered a sector, or stepped onto a floor-flagged-surface or thing. If the surface isn't floor-flagged or is a wall that you can't step onto, then use the touched message.

/Edward
Edward's Cognative Hazards
2004-04-25, 1:13 PM #8
Quote:
<font face="Verdana, Arial" size="2">Originally posted by zagibu:
I'd rather see the level get released.

</font>


Well I've finished just about everything except a few small details. Im going to showcase it in 7 days just to let you know.

------------------
Fear, It Controls The Fearful. The Strong. The Weak. The Innocent. Fear Is My Ally!

The Arcane Sith

↑ Up to the top!