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

Members Online

»
0 Active | 83 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

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 4
Category: CoD4 Scripting
Scripting and coding with Call of Duty 4.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Lerp the player?
Avengus
General Member
Since: Feb 3, 2011
Posts: 48
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Feb. 8, 2011 12:45 am
I found the lerpposition() function in the script docs, but it seems it's for an actor only because when I activate my script, I get in the console:

not an actor and it points to player lerpposition(endpoint, endAngles);

I'm basically just modifying the teleport tutorial:

Code:
transporter()
{
	while(true)
	{
		self waittill( "trigger", player );
		entTarget = getEnt( self.target, "targetname" );
		wait 0.1;
		
		endPoint = entTarget.origin;
		endAngles = player.angles;
		
                player freezecontrols(true);
		player lerpposition(endPoint, endAngles);

		wait 0.1;
	}
}


Is there any way to do this without writing a lerp function myself for this?
Share |
SparkyMcSparks
General Member
Since: Feb 28, 2004
Posts: 1713
Last: Dec 29, 2016
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Feb. 8, 2011 12:50 am
Yeah, only for actors.
Player is a Player.
AI is an Actor.

You can probably use SetOrigin( ) and a fake lerp transition between point A and point B in small increments.

Probably better just to spawn a script_origin and have it do a MoveTo( ) / RotateTo( ) and link the player to it.
Share |
Avengus
General Member
Since: Feb 3, 2011
Posts: 48
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Feb. 8, 2011 02:23 am
Hmmm....I like your MoveTo() suggestion.

I created a script_origin with targetname="dummyNode"

and added to the script:

Code:
dummyEnt= getEnt( "dummyNode", "targetname" );
player playerlinkto(dummyEnt);


and after building BSP, fast file, etc. and running, it says that dummyEnt is not an Entity. Is there something else I need to do to it? Thanks.

edited on Feb. 7, 2011 09:23 pm by Avengus
Share |
Avengus
General Member
Since: Feb 3, 2011
Posts: 48
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Feb. 8, 2011 02:42 am
Wooops nevermind!

I must not have saved before I built the level because it worked fine. Thanks!
Share |
tomalla
General Member
Since: Jan 16, 2007
Posts: 393
Last: Jun 10, 2012
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD4 Scripting
Posted: Tuesday, Feb. 8, 2011 04:58 pm
There is no sense making a script_origin in Radiant and moving it by script. You can make it faster and cleaner way by spawning the script_origin via script:

Code:

dummy = spawn("script_origin", player getorigin());
player playerlinkto(dummy);


[thumbs_up]
Share |
Avengus
General Member
Since: Feb 3, 2011
Posts: 48
Last: May 29, 2013
[view latest posts]
Level 2
Category: CoD4 Scripting
Posted: Tuesday, Feb. 8, 2011 07:54 pm
Nice! I was hoping there was a way to spawn stuff like this in script. I will change it accordingly. Thanks! [rocking]
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 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

»