Scripting Help
Moderator: Core Staff
-
- CJ Donator
- Posts: 52
- Joined: August 10th, 2009, 5:20 pm
Scripting Help
I am trying to recreate a map like this:
Basically the user is being pushed forward along a level area and all they can do is strafe left and right and jump. They cannot go back and they are constantly moving forward no matter what. I don't know how to script something like this without moving the floor itself.
All help is appreciated
Basically the user is being pushed forward along a level area and all they can do is strafe left and right and jump. They cannot go back and they are constantly moving forward no matter what. I don't know how to script something like this without moving the floor itself.
All help is appreciated
Re: Scripting Help
only way to push someone forward in mp i think is to damage him.
Also have slippery floors, then it should be like in mp_sonic.
Also have slippery floors, then it should be like in mp_sonic.
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Scripting Help
Couldn't you just do an infinite loop giving each player an X or Y velocity of 100 every 0.01secs whilst they are on the trigger. (The `slide floor` would have to be in exactly the X or Y direction). Don't see why it wouldn't work and pretty easy to script.
-
Re: Scripting Help
the only way to give them velocity is by damaging them.
But KS way is probably the lest glitchy one, since it's impossible to move backwards then.
But KS way is probably the lest glitchy one, since it's impossible to move backwards then.
-
- CJ Donator
- Posts: 52
- Joined: August 10th, 2009, 5:20 pm
Re: Scripting Help
Is there a way to do it similar to mp_sonic where you hit the trigger and go?
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Scripting Help
setVelocity() gives them velocity. If you work out the velocity lost every 0.01 secs or so, just do setVelocity(getVelocity() + (X,Y,Z)).Nekoneko wrote:the only way to give them velocity is by damaging them.
But KS way is probably the lest glitchy one, since it's impossible to move backwards then.
-
Re: Scripting Help
SetVelocity is singleplayer only function i believe in cod4.
Re: Scripting Help
Oh, sure if that is a single player map.
Thought it should be mp somehow xD
Thought it should be mp somehow xD
-
- CJ G0D!
- Posts: 1575
- Joined: June 3rd, 2009, 9:02 pm
- Location: Cardiff University, UK
Re: Scripting Help
I would've thought its a mp function, seen some cod4 mods with stuff I could only think would be done with setVelocity(). I know it's defeinitely mp function in BO.
-
-
- CJ Donator
- Posts: 52
- Joined: August 10th, 2009, 5:20 pm
Re: Scripting Help
Can someone give me an example of how I would use this setvelocity script just to see if it does indeed work in MP
EDIT:: setvelocity doens't work on MP, i tested it. can someone help me duplicate the sonic script?
EDIT:: setvelocity doens't work on MP, i tested it. can someone help me duplicate the sonic script?
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Scripting Help
KillerSam's method would probably be best if you want the player to go around turns and such, but here is the (slightly edited) Sonic script: Pastebin link
Every time you want to boost a player, you would thread the function speed( [player entity here] );
Keep in mind you'll want to edit the [DAMAGE ORIGIN] and [DAMAGE DIRECTION], which are both (x, y, z) vectors.
You may or may not need the admin portion of the script, but when Sonic was made, admin players could not be boosted from damage.
For the slippery part of the slide, you need to find a pre-existing material that lets a player slide on it, or make your own with these settings.
Every time you want to boost a player, you would thread the function speed( [player entity here] );
Keep in mind you'll want to edit the [DAMAGE ORIGIN] and [DAMAGE DIRECTION], which are both (x, y, z) vectors.
You may or may not need the admin portion of the script, but when Sonic was made, admin players could not be boosted from damage.
For the slippery part of the slide, you need to find a pre-existing material that lets a player slide on it, or make your own with these settings.
-
- CJ Donator
- Posts: 52
- Joined: August 10th, 2009, 5:20 pm
Re: Scripting Help
If I want the player to move in the Y direction what would the origin and direction? (0,1,0)?
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Scripting Help
The origin would be (0, 0, 0), and yes, the direction (0, 1, 0) should make the player go forward on the Y axis.
-
- CJ Donator
- Posts: 52
- Joined: August 10th, 2009, 5:20 pm
Re: Scripting Help
I get this error:
Attempted to overrun string in call to va()
Attempted to overrun string in call to va()
-
- PC Team
- Posts: 294
- Joined: September 6th, 2008, 2:14 am
Re: Scripting Help
For some reason, I have always gotten that error whenever I use the CJ mod offline, so I don't know how to fix it. You could use a different mod, or maybe someone else knows how to fix it.
Who is online
Users browsing this forum: No registered users and 37 guests