Boost / Throw?
Moderator: Core Staff
Boost / Throw?
Im looking for the best way to script to throw/launch a player when they enter a trigger. (or another way :>)
A really good working one is in the map mp_wireframe_r4, where if you step on something it will literally "throw" you or launch you up a slide. I think there is some serious potential for this, not only in aim maps for promod people, but to try and get some new maps for codjumper.
There are several possible ways, however I would like your guidance as I'm not sure which one would be the best way for doing this.
MoveGravity( <initial velocity>, <time> ) ? Seems the obvious choice, however don't see how to change direction?
MoveX( <xvalue>, <time>, <acceleration time>, <deceleration time> ) Perhaps move to a point just beyond the trigger at ridiculous speed? Its more complicated.
Or perhaps a completely different way?
I'm asking here because I have so many projects on the go such as aim maps, an invisiblemen map, a minigames map, and perhaps even some different styled jump maps, and so little time to do any of them due to real life. So if anybody has a working script or knows a sure way to do it, it would be greatly appreciated :>
A really good working one is in the map mp_wireframe_r4, where if you step on something it will literally "throw" you or launch you up a slide. I think there is some serious potential for this, not only in aim maps for promod people, but to try and get some new maps for codjumper.
There are several possible ways, however I would like your guidance as I'm not sure which one would be the best way for doing this.
MoveGravity( <initial velocity>, <time> ) ? Seems the obvious choice, however don't see how to change direction?
MoveX( <xvalue>, <time>, <acceleration time>, <deceleration time> ) Perhaps move to a point just beyond the trigger at ridiculous speed? Its more complicated.
Or perhaps a completely different way?
I'm asking here because I have so many projects on the go such as aim maps, an invisiblemen map, a minigames map, and perhaps even some different styled jump maps, and so little time to do any of them due to real life. So if anybody has a working script or knows a sure way to do it, it would be greatly appreciated :>
Re: Boost / Throw?
my new map is almost done, and it has 2 scripts like this ^^ but i didn't make them, i got them from a friend
Re: Boost / Throw?
use the damage thingy.
It gives a big amount of damage with a positive aimed vector, so the player gets propelled upwards.
It gives a big amount of damage with a positive aimed vector, so the player gets propelled upwards.
-
- Core Staff
- Posts: 2155
- Joined: December 7th, 2004, 2:07 am
- Location: Netherlands
- Contact:
Re: Boost / Throw?
waywaaaard made jump pads in CoD2 I think it works pretty much the same in CoD4.
Ask him.
Ask him.
Re: Boost / Throw?
'initial velocity' is to be a vector, so you can change direction.MoveGravity( <initial velocity>, <time> ) ? Seems the obvious choice, however don't see how to change direction
Re: Boost / Throw?
Ye, but you cannot change direction+you have to link a player+it doesnt stop when you hit anything.megazor wrote:'initial velocity' is to be a vector, so you can change direction.MoveGravity( <initial velocity>, <time> ) ? Seems the obvious choice, however don't see how to change direction
Re: Boost / Throw?
why cant i change direction? u mean after having been launched? you are right then. well, damage is much better, i personally use it. but sometimes its so funny when you are going through walls, i do that to players on my server
Re: Boost / Throw?
I'm making a map with ramps and boosters, I use FinishPlayerDamage().
Re: Boost / Throw?
Aah, thats helpful. So you would use a trigger, when trigger is activated, you would do thisRich wrote:I'm making a map with ramps and boosters, I use FinishPlayerDamage().
self FinishPlayerDamage
But how do you inflict damage without hurting them, and I dont understand what form the vector should be in. Could you give me an example ?
-
- Core Staff
- Posts: 2214
- Joined: February 6th, 2006, 3:18 pm
- Location: Germany/Bayern
Re: Boost / Throw?
should do the trick
or if you want to use a target height (script_origin connected to the trigger)
Code: Select all
Â
self waittill("trigger", player);
        player playsound("jump_pad");
        for(i = 0; i < 9; i++){
            power = 150;
            player.health = player.health + power;
            eInflictor = player;
            eAttacker = player;
            iDamage = power;
            iDFlags = 0;
            sMeansOfDeath = "MOD_PROJECTILE";
            sWeapon = "panzershreck_mp";
            vPoint = ( player.origin + (0,0,-1) );
            vDir = vectornormalize( player.origin - vPoint );
            sHitLoc = "none";
            psOffsetTime = 0;
Â
            player finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
        }
        wait(0.5);
Â
Code: Select all
bounce_jump(){
while(1){
self waittill("trigger", player);
tar = self.target;
target = getEnt(tar, "targetname");
height = 0;
count = 0;
while((player.origin[2] < target.origin[2])){
power = 75;
player.health = player.health + power;
eInflictor = player;
eAttacker = player;
iDamage = power;
iDFlags = 0;
sMeansOfDeath = "MOD_PROJECTILE";
sWeapon = "panzershreck_mp";
vPoint = ( player.origin + (0,0,-1) );
vDir = vectornormalize( player.origin - vPoint );
sHitLoc = "none";
psOffsetTime = 0;
player finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
height = player.origin[2];
count++;
wait(0.01);
if(player.origin[2] >= target.origin[2]){
break;
}
}
wait(0.5);
}
}
THAT HANDS WERE NOT TRACED!
visit my blog: Link
visit my blog: Link
Soviet wrote:Yeah, watch out, Peds will hit you with his +5 D-Battleaxe of homosexuality
Re: Boost / Throw?
Hey i tried to take that code for my map, but it won't work...i'm not that familiar in scripting so perhaps i made a mistake...i made a trigger_multiple: targetname = trigger1
and my gsc file looks like that:
or without this line: trigger = getent ("trigger1", "targetname");
both won't work.
best regards
and my gsc file looks like that:
Code: Select all
main()
{
maps\mp\_load::main();
thread trigger1();
ambientPlay("ambient_crossfire");
game["allies"] = "marines";
game["axis"] = "opfor";
game["attackers"] = "axis";
game["defenders"] = "allies";
game["allies_soldiertype"] = "desert";
game["axis_soldiertype"] = "desert";
setdvar( "r_specularcolorscale", "2" );
setdvar("compassmaxrange","1800");
}
trigger1() {
trigger = getent ("trigger1", "targetname");
self waittill("trigger", player);
player playsound("jump_pad");
for(i = 0; i < 9; i++){
power = 150;
player.health = player.health + power;
eInflictor = player;
eAttacker = player;
iDamage = power;
iDFlags = 0;
sMeansOfDeath = "MOD_PROJECTILE";
sWeapon = "panzershreck_mp";
vPoint = ( player.origin + (0,0,-1) );
vDir = vectornormalize( player.origin - vPoint );
sHitLoc = "none";
psOffsetTime = 0;
player finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
}
wait(0.5);
}
both won't work.
best regards
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Boost / Throw?
Code: Select all
self waittill(
Code: Select all
trigger waittill
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Re: Boost / Throw?
Thank you very much drofder it's working now but only for 1 time do you know why? What have I to change that a player can more than just 1 time use that boost?
-
- Core Staff
- Posts: 13313
- Joined: April 13th, 2005, 8:22 pm
- Location: UK, London
Re: Boost / Throw?
Code: Select all
trigger1() {
trigger = getent ("trigger1", "targetname");
while(1)
{
self waittill("trigger", player);
player playsound("jump_pad");
for(i = 0; i < 9; i++)
{
power = 150;
player.health = player.health + power;
eInflictor = player;
eAttacker = player;
iDamage = power;
iDFlags = 0;
sMeansOfDeath = "MOD_PROJECTILE";
sWeapon = "panzershreck_mp";
vPoint = ( player.origin + (0,0,-1) );
vDir = vectornormalize( player.origin - vPoint );
sHitLoc = "none";
psOffsetTime = 0;
player finishPlayerDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, sWeapon, vPoint, vDir, sHitLoc, psOffsetTime );
}
wait(0.5);
}
}
Virgin Media 20Mb Broadband:
"Perfect for families going online at the same time, downloading movies, online gaming and more."
Borked internet since: 22-07-2010
Who is online
Users browsing this forum: No registered users and 12 guests