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

Members Online

»
0 Active | 71 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 SP Mapping
CoD 4 mapping and level design for single player.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: link player to origins - why is it not working?
9837265498
General Member
Since: Nov 6, 2009
Posts: 193
Last: Jan 23, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Monday, Aug. 2, 2010 03:05 am
i am trying to have my level start with the player linked to specific positions, before giving back the controls.

i am using script_origins, with specific target names and a gerry-rigged script from the Jump pad Tut.

I have the player_start in a trigger_multiple that starts the whole scene and should link the player to the first origin

it all looks good on paper but in play test the player does not link, and no errors are reported.

I am wondering if there is a better way to go about this?

also if I use the moveto(); command do all of the origins need to be connected?

ty all, for reading and (hopefully) advice
Share |
irishstorm
General Member
Since: Jan 19, 2009
Posts: 128
Last: Feb 25, 2011
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Monday, Aug. 2, 2010 05:39 am
would help to see your code.
Share |
tHMatt
General Member
Since: Sep 11, 2007
Posts: 473
Last: Mar 20, 2013
[view latest posts]
Level 5
Category: CoD4 SP Mapping
Posted: Monday, Aug. 2, 2010 06:46 am
I cannot believe you would explain all that, then not post your code.
Share |
techno2sl
General Member
Since: Aug 5, 2004
Posts: 2977
Last: Oct 14, 2010
[view latest posts]
Level 9
Category: CoD4 SP Mapping
Posted: Monday, Aug. 2, 2010 03:49 pm

Code:
startpos = getent("start1", "targetname"); //script_model tag origin

level.player playerlinktodelta(startpos, "tag_origin");



As script origins don't seem to work for you (post your code!) then try adding a script model with the model being "tag_origin" and use the above code.
Share |
9837265498
General Member
Since: Nov 6, 2009
Posts: 193
Last: Jan 23, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Tuesday, Aug. 3, 2010 01:33 pm
sorry guys i was a little preocupied at the time i posted it and i forgot to post my code.

Code:
player_wake()
{
	start_trig = getent("start_trig", "targetname");

	sleep_origin = getent("player_sleep", "targetname");
	awake_origin = getent("player_awake", "targetname");
	drag_start = getent("player_drag_start", "targetname");
	drag_1 = getent("player_drag_1", "targetname");
	drag_2 = getent("player_drag_2", "targetname");
	drag_3 = getent("player_drag_3", "targetname");
	hit_player = getnode("Hit_player","targetname");
	slider_node = getnode("slider_node","targetname");

	level.door_guy = getent("door_guy", "targetname");
	level.doorguy.animname = "Jailor";
	level.door_guy setgoalnode(slider_node);



	overlay = newHudElem();
	overlay.x = 0;
	overlay.y = 0;
	overlay setshader( "black", 640, 480 );
	overlay.alignX = "left";
	overlay.alignY = "top";
	overlay.horzAlign = "fullscreen";
	overlay.vertAlign = "fullscreen";
	overlay.alpha = 0;
	overlay.sort = 1;

	start_trig waittill("trigger");

	drag = spawn ("script_model",(0,0,0));

	drag.origin = level.player.origin;
	drag.angles = level.player.angles;
	level.player linkto (drag);

	drag playerlinkto(sleep_origin);


	level.door_guy waittill("goal");
	flag_set("slide");

	wait 5;
	flag_set("open_cell");

	level.door_guy setgoalnode(hit_player);

	drag moveto (awake_origin, 1);

	hit_player anim_reach_solo( level.door_guy, "hit_player" );
	wait 1;
 	hit_player anim_single_solo( level.door_guy, "hit_player" );

	level.player shellshock( "coup_blackout1", 8 );// fade out over 1 sec, wait 2, fade in over 5
	overlay blackOut( 1, 6 );
	
	drag moveto (drag_start, 1);
	wait 1;
        drag moveto (drag_1, 1);
	wait .5;
       	drag moveto (drag_2, 1);
	wait .5;
        drag moveto (drag_3, 1);

	wait 3;

	overlay restoreVision( 3, 6 );

	level.player unlink();
	
	flag_set("drag_done");
}


If you need more codes i'll post but i believe this is all of it
Share |
DemonSeed
General Member
Since: Apr 30, 2009
Posts: 1362
Last: Feb 19, 2018
[view latest posts]
Level 8
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Tuesday, Aug. 3, 2010 02:06 pm
I suspect this is your problem:

Code:
	drag = spawn ("script_model",(0,0,0));

	drag.origin = level.player.origin;
	drag.angles = level.player.angles;
	level.player linkto (drag);

	drag playerlinkto(sleep_origin);


drag is a script_model - not a player, so you cant use playerlinkto() on it. Use Linkto() instead.
Share |
9837265498
General Member
Since: Nov 6, 2009
Posts: 193
Last: Jan 23, 2012
[view latest posts]
Level 4
Category: CoD4 SP Mapping
Posted: Wednesday, Aug. 4, 2010 10:01 pm
tyvm for the replies, but i fixed the linkto(); and it still does not work.

I was wondering if there is a way to spawn the player via script at the origin, rather than using a player_start node and trigger.

I had done this awhile ago with spawning the player in a vehicle, but i was wondering how i should do it for this application.

Also i am still wondering if all of the origins have to be connected with target / targetname values or if the engine is able to discern a path from origin to origin?
Share |
sam_fisher3000
General Member
Since: Apr 18, 2007
Posts: 816
Last: Jul 16, 2016
[view latest posts]
Level 7
Im a fan of MODSonair
Category: CoD4 SP Mapping
Posted: Thursday, Aug. 26, 2010 05:42 am
You can keep it simple. Example:

Code:
watch = getent("watch","targetname"); level.player PlayerLinkToDelta(watch); 


And work from there. No tag_origins.

Hope it helps.

Share |
voidsource
General Member
Since: May 5, 2007
Posts: 1513
Last: Sep 1, 2013
[view latest posts]
Level 8
Category: CoD4 SP Mapping
Posted: Thursday, Aug. 26, 2010 11:37 am
you know ur idea sounds a lot like the mission "hunted". The player starts off being linked to the heli.

Code:

flight_helicopter()
{
	blackhawk = maps\_vehicle::spawn_vehicle_from_targetname_and_drive( "crash_blackhawk" );
//	blackhawk thread maps\_vehicle::lights_on( "interior" );

	blackhawk setturningability( 0.2 );
	blackhawk thread flight_crash();
	blackhawk maps\_vehicle::godon();

	price = undefined;

	for( i = 0 ; i < blackhawk.riders.size ; i ++ )
	{
		if ( issubstr( blackhawk.riders[i].classname, "vip" ) )
			blackhawk.riders[i].has_ir = undefined;
		if ( !issubstr( blackhawk.riders[i].classname, "price" ) )
			continue;
		price = blackhawk.riders[i];
	}

	blackhawk thread flight_dialogue( price );
	blackhawk thread flight_helicopter_dlight();

	blackhawk.tag_ent = blackhawk fake_tag( "tag_origin", (-10,32,-132), (0,140,0) );

	level.player playerlinktodelta( blackhawk.tag_ent, "tag_origin", 0.5, 80, 80, 30, 20);
	level.player setplayerangles( (0,35,0) );

	flag_wait( "blackhawk_down" );
	level.player unlink();

}





the specific part your looking for is this one:

Code:


	blackhawk.tag_ent = blackhawk fake_tag( "tag_origin", (-10,32,-132), (0,140,0) );// they created a tag here on the heli

	level.player playerlinktodelta( blackhawk.tag_ent, "tag_origin", 0.5, 80, 80, 30, 20);// linked the player
	level.player setplayerangles( (0,35,0) );//set player angles on it so player cant look pass this



hope that has helped.

edited on Aug. 26, 2010 07:40 am by voidsource


p.s. i forgot to put the part for the "fake_tag" func. which is this:

Code:

fake_tag( tag, origin_offset, angles_offset )
{
	ent = spawn( "script_model", self.origin);
	ent setmodel( "tag_origin" );
	ent hide();
	ent linkto( self, tag, origin_offset, angles_offset );
	self thread fake_tag_destroy( ent );
	return ent;
}


fake_tag_destroy( fake_tag )
{
	self waittill( "death" );
	fake_tag delete();
}
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 4 : CoD4 SP Mapping

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

»