Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 7 Guests
Online:

LATEST FORUM THREADS

»
warfare
CoD4 Map + Mod Releases
Voting menu on maps
CoD+UO General
Hauling 911
CoDBO3 General

Forums

»

Welcome to the MODSonline.com forums. Looking for Frequently Asked Questions? Check out our FAQs section or search it out using the SEARCH link below. If you are new here, you may want to check out our rules and this great user's guide to the forums and the website.
For more mapping and modding information, see our Wiki: MODSonWiki.com

Jump To:
Forum: All Forums : Call of Duty 2
Category: CoD2 Scripting
Scripting and coding with Call of Duty 2.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Moving the player
earth
General Member
Since: Oct 22, 2005
Posts: 127
Last: Oct 19, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Tuesday, Jan. 31, 2006 12:15 am
I know it is possible to change the player's origin but how can I move the player applying the game's velocity engine? Like when you get knockback or gravity applied. Any idea if this is possible?
Share |
earth
General Member
Since: Oct 22, 2005
Posts: 127
Last: Oct 19, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Feb. 3, 2006 01:56 am
Impossible? Oh well.
Share |
StrYdeR
General Member
Since: May 11, 2004
Posts: 11671
Last: Oct 7, 2021
[view latest posts]
Level 10
Admin
Forum Moderator
Im a HOST of MODSonair
Category: CoD2 Scripting
Posted: Friday, Feb. 3, 2006 02:33 am
get the players origin and spawn a blank script_model at that location

then link the player to that script_model

use the movegravity command to move the script_model

wait unitl movedone

then unlink the player from the script_model

[angryalien]
Share |
BR3NTB
General Member
Since: Jun 20, 2004
Posts: 893
Last: Mar 3, 2006
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Friday, Feb. 3, 2006 02:34 am
Impossible???


I put a trigger Multiple in my map, named it move_trigger
This will be the trigger that initiates moving the player

I put a Pathnode on the ground, named it playerfallpos
This will be Position the player is moved to so put it far away from the trigger

Then I wrote a Script Like This:
Code:

move_player()
{
level.player freezeControls(true); // optional
startnode = spawn("script_origin",level.player.origin);
startnode.angles = level.player.angles;
level.player linkto (startnode);
tempnode = getnode("playerfallpos", "targetname");
landnode = tempnode.origin;
startnode moveTo(landnode, .25, 0, 0);
startnode waittill ("movedone");
level.player unlink();
level.player freezeControls(false);  // optional
wait 1; 
startnode delete();
}



This should work I havent Tested It Fully.
But Im Confident that it should do the job or at least get You started.

I LOVE MAPPING/SCRIPTING
[smokin]
Share |
earth
General Member
Since: Oct 22, 2005
Posts: 127
Last: Oct 19, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Friday, Feb. 3, 2006 10:43 pm
Brent:
I mean't with collision and gravity, falloff etc..

Stryder:
Glad you understood what I mean't but there are two things wrong with this.. the player has no control over walking around as they are pushed and if you've tried this before you'd notice when you use movegravity on a spawned script_model it goes right through the ground.

..couldn't get quotes to work properly...

edited on Feb. 3, 2006 05:49 pm by earth
Share |
BR3NTB
General Member
Since: Jun 20, 2004
Posts: 893
Last: Mar 3, 2006
[view latest posts]
Level 7
Category: CoD2 Scripting
Posted: Saturday, Feb. 4, 2006 01:35 am
What I showed You Earth is SP stuff. You see I cant Get SP Crap Out Of My Head.[banghead]
But If You Looked Closer To Even The SP Script You would See Its Pretty Much there. If NOt. Its Close.

Hmmmmmm. Move Player MP....Off The top Of My Head....


Code:
move_player()
{
trig = getent ("move_trigger","targetname");
trig waittill ("trigger");
players = getentarray("player", "classname");
for(i = 0; i < players.size; i++)
{
startnode = spawn("script_origin",players[i].origin);
startnode.angles = players[i].angles;
players[i] linkto (startnode);
tempnode = getent("move_here", "targetname");
landnode = tempnode.origin;
startnode moveTo(landnode, .25, 0, 0);
startnode waittill ("movedone");
players[i] unlink();
}
thread move_player();
}  



Maybe.........Test It Let Me Know ... OK.
Should still have control while moving.
This Has got to get you going in the right direction.
And I'm Toooooooo Busy To dig into this any further.
Enjoy.

[smokin]
Share |
earth
General Member
Since: Oct 22, 2005
Posts: 127
Last: Oct 19, 2006
[view latest posts]
Level 4
Category: CoD2 Scripting
Posted: Saturday, Feb. 4, 2006 03:09 pm
Moveto moves you in a straight line with no gravity or collision. I'm wanting the sort of way you go went you get knockback. If you turn up the knockback and throw a grenade it is a lot more noticable.
Share |
Ice_Blade
General Member
Since: May 7, 2006
Posts: 31
Last: Jan 29, 2007
[view latest posts]
Level 2
Category: CoD2 Scripting
Posted: Saturday, May. 20, 2006 02:51 pm
you could try to script an explosion with an invisible effect and no damage, that explodes and blows you back...
that would give the knockback effect :)
Just trigger the explosion with a trigger somewhere...

(Don't ask me exactly how to do it, I don't know :))
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 Scripting

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»