Page 1 of 2

Scripting Help

Posted: July 28th, 2011, 5:03 pm
by paintlax21
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 :D

Re: Scripting Help

Posted: July 28th, 2011, 5:51 pm
by Nekoneko
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.

Re: Scripting Help

Posted: July 28th, 2011, 6:28 pm
by F |Madness| U
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

Posted: July 28th, 2011, 7:01 pm
by Nekoneko
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

Posted: July 28th, 2011, 7:27 pm
by paintlax21
Is there a way to do it similar to mp_sonic where you hit the trigger and go?

Re: Scripting Help

Posted: July 28th, 2011, 8:47 pm
by F |Madness| U
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.
setVelocity() gives them velocity. If you work out the velocity lost every 0.01 secs or so, just do setVelocity(getVelocity() + (X,Y,Z)).

Re: Scripting Help

Posted: July 28th, 2011, 9:27 pm
by Opel
SetVelocity is singleplayer only function i believe in cod4.

Re: Scripting Help

Posted: July 28th, 2011, 9:48 pm
by Nekoneko
Oh, sure if that is a single player map.
Thought it should be mp somehow xD

Re: Scripting Help

Posted: July 28th, 2011, 10:06 pm
by F |Madness| U
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.

Re: Scripting Help

Posted: July 29th, 2011, 12:14 am
by paintlax21
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?

Re: Scripting Help

Posted: July 29th, 2011, 1:23 am
by _DanTheMan_
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.

Re: Scripting Help

Posted: July 29th, 2011, 1:37 am
by paintlax21
If I want the player to move in the Y direction what would the origin and direction? (0,1,0)?

Re: Scripting Help

Posted: July 29th, 2011, 1:48 am
by _DanTheMan_
The origin would be (0, 0, 0), and yes, the direction (0, 1, 0) should make the player go forward on the Y axis.

Re: Scripting Help

Posted: July 29th, 2011, 2:00 am
by paintlax21
I get this error:

Attempted to overrun string in call to va()

Re: Scripting Help

Posted: July 29th, 2011, 2:11 am
by _DanTheMan_
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.