View previous topic :: View next topic |
Author |
Message |
9svn6
Joined: 30 Jun 2007 Posts: 12 Location: Brockport, NY
|
Posted: Fri Jul 06, 2007 5:31 am Post subject: Speed Pickup |
|
|
So i'd like to add a speed pickup to my package I ran across one before but I don't remember where it was. Does anyone know how to code one? |
|
Back to top |
|
|
Hyper
Joined: 24 Jan 2004 Posts: 1227 Location: Middelburg, The Netherlands
|
Posted: Fri Jul 06, 2007 9:28 am Post subject: |
|
|
There are many speed / running items already. At my server I use the JTool.JSpeed (From Joss' JTool3)
Aura also has some items that increase speed and Smiley's pack also has one. _________________ Alter your reality...forever.
Hyper.nl Unreal Services
unreal://hypercoop.tk |
|
Back to top |
|
|
mental-HunteR
Joined: 05 May 2006 Posts: 363 Location: The Netherlands
|
Posted: Fri Jul 06, 2007 11:33 am Post subject: |
|
|
I dont think that is what he was asking for, anyways. I never made a speed pickup. However, i do made a alots of boots with airspeed, groundspeed, WaterSpeed and Aircontrol. If you send that to me also, i might firgur out how to make a speed pickup. _________________
|
|
Back to top |
|
|
Cheese
Joined: 30 Mar 2006 Posts: 79 Location: ...YES
|
Posted: Sat Jul 07, 2007 5:38 am Post subject: |
|
|
:)
Code: |
Class SpeedUp expands Pickup;
|
First, The Class Declaration.
Code: |
var() float speedfactor;
|
...Then you need a variable for the speed, if you want it to be adjustable.
Code: |
State Activated
{
Begin:
PlayerPawn(Owner).GroundSpeed *= SpeedFactor; //Make you run fast.
PlayerPawn(Owner).ClientMessage("You can run "$SpeedFactor$" Times as fast as usual"); //Tells you how fast you can run.
}
|
...Now, it's gotta set how fast you run, and tell you how fast you are running.
Code: |
State DeActivated
{
Begin:
PlayerPawn(Owner).GroundSpeed=Playerpawn(Owner).Default.GroundSpeed; // Sets your ground speed back to what it was.
}
|
...And it's gotta turn off the speed boost that when it's deactivated.
Code: |
Exec Simulated Function SetMySpeed(Float SpeedAmount)
{
if(SpeedAmount > 10) SpeedAmount = 10; //Makes sure you can't run more than 10 times faster than usual.
SpeedFactor=SpeedAmount; //Sets the Speed Factor.
PlayerPawn(Owner).GroundSpeed=PlayerPawn(Owner).Default.GroundSpeed * SpeedAmount;//Makes you run fast.
PlayerPawn(Owner).ClientMessage("You can run "$SpeedFactor$" Times as fast as usual"); // Tells you how fast you can run.
}
}
|
...And now, the executable function to change your speed, ingame.
Code: |
DefaultProperties
{
SpeedFactor=2
bDisplayableInv=True
Charge=1
bActivatable=True
DrawType=DT_Sprite
Style=Sty_Masked
PickupMessage="You picked up a Speed Up item."
}
|
...Finally the default properties, then you're done.
Have fun. _________________
|
|
Back to top |
|
|
|