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

Members Online

»
0 Active | 90 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 2
Category: CoD2 MP Mapping
CoD 2 mapping and level design.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked subscribe
Author Topic: Spinning Models
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Thursday, Aug. 11, 2011 03:29 am
I know its possible to make models spin on a map. But how?
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Thursday, Aug. 11, 2011 05:46 am
sure, why not:
Quote:
model spinaround( 100 , 1.3 , self , god );


this makes your model spin around god in 1.3 years to 100 degrees to the northyaw.

no tbh...

either use one of them to define you model(s):
Code:
model = getent( "model" , "targetname" );

models = getentarray( "model" , "targetname" );

model = spawn( "script_origin" , ( 0 , 0 , 0 ) );


now you have your model

and to spin it use
Code:
model rotateYaw( 100 , 1 , 0.5 , 0.5 );
model rotateRoll( 100 , 1 , 0.5 , 0.5 );
model rotatPitch( 100 , 1 , 0.5 , 0.5 );
model rotateTo( ( 100 , 100 , 100 ) , 1 , 0.5 , 0.5 );


it is : rotate( angle(s) , time , accel , deccel )
and: accel + deccel <= time

Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Thursday, Aug. 11, 2011 06:10 am
I took a model in my map. a script_model and put

Quote:
targetname
mp44


and it gave me an error. I dont have the error with me but it said it was not an entity. and you have

Quote:
model = getent( "model" , "targetname" );


So i dont think it will work.
Share |
cskiller86
General Member
Since: Nov 23, 2009
Posts: 528
Last: Oct 25, 2011
[view latest posts]
Level 6
Category: CoD2 MP Mapping
Posted: Thursday, Aug. 11, 2011 04:13 pm
Well, you have to turn your model into a script_model first, then give it a name (let's say you call it "ploxxys_model"). That is all done in Radiant.
Moving on to scripting, you should have something like:
Code:
model = getent( "ploxxys_model" , "targetname" );
while(1)
{
model rotateyaw (360, 5, 0.1, 0.1);
wait 0.1;
}

This rotates your model once (360 degrees) in 5 seconds and then starts all over.
Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Thursday, Aug. 11, 2011 11:25 pm
Well see no i made a script_model as i said before. I gave it the targetname of

targetname
ploxxys_model

and i put in the script

main()
{
thread mp44();
}

mp44()
{
model = getent( "ploxxys_model" , "targetname" );
while(1)
{
model rotateyaw (360, 5, 0.1, 0.1);
wait 0.1;
}
}

and it gave me an error.
Share |
serthy
General Member
Since: Sep 8, 2010
Posts: 482
Last: Jun 28, 2013
[view latest posts]
Level 5
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Thursday, Aug. 11, 2011 11:31 pm
i looked into my mind

*aaaaaaaaaaaaaaaaaaaaaaaargh* it hurts, but sorry, didnt had luck at all

i cant see your problem.. :(

maybe you try /developer 1 and post the error, makes it much easier and my head wont hurt so much next time
Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Friday, Aug. 12, 2011 01:18 am
Okay, thank you serthy. Do you have xfire?
Share |
Ploxxy
General Member
Since: May 1, 2009
Posts: 170
Last: Aug 31, 2011
[view latest posts]
Level 4
Im a fan of MODSonair
Category: CoD2 MP Mapping
Posted: Friday, Aug. 12, 2011 01:29 am
my error is

Quote:
******* script runtime error ******* undefined is not an entity: (file 'maps/mp/mp_buying2.gsc', line 13) mp44 rotatevelocity ( (0, 360, 0), 250); * called from: (file 'maps/mp/mp_buying2.gsc', line 5) thread spinMp44(); * started from: (file 'maps/mp/mp_buying2.gsc', line 1) main() *
Share |
Tally
General Member
Since: Apr 21, 2005
Posts: 819
Last: Oct 26, 2012
[view latest posts]
Level 7
Category: CoD2 MP Mapping
Posted: Friday, Aug. 12, 2011 09:56 am
Ploxxy writes...
Quote:
my error is

Quote:
******* script runtime error ******* undefined is not an entity: (file 'maps/mp/mp_buying2.gsc', line 13) mp44 rotatevelocity ( (0, 360, 0), 250); * called from: (file 'maps/mp/mp_buying2.gsc', line 5) thread spinMp44(); * started from: (file 'maps/mp/mp_buying2.gsc', line 1) main() *


The error is caused by trying to find an entity before everything has finished loading. It usually requires at least 2 server frames.

This works (it is straight from Demon mod for COD2):

Code:
main()
{
	thread pickups();
}

pickups()
{
	// give time for everything to spawn
	wait( .5 );

	pickups = getentarray( "ploxxys_model", "targetname" );
	
	for( i = 0; i < pickups.size; i++ )
	{
		thread trackPickup( pickups[i] );
		wait( 0.02 );
	}
}

trackPickup( pickup )
{	
	level endon( "intermission" );
	
	while( true )
	{	
		pickup thread spinPickup();
			
		player = undefined;
		classname = pickup.classname;
		origin = pickup.origin;
		angles = pickup.angles;
		spawnflags = pickup.spawnflags;
		
		isWeapon = false;
		weapname = undefined;
		respawnTime = undefined;

		if( issubstr( classname, "weapon_" ) )
		{
			isWeapon = true;
			weapname = pickup getItemWeaponName();
			respawnTime = 10;
		}
		
		if( isWeapon )
		{
			while( true )
			{
				pickup waittill( "trigger", player, dropped );
				
				if( !isdefined( pickup ) )
					break;
				
				assert( !isdefined( dropped ) );
			}
			
			if( isdefined( dropped ) )
			{	
				dropped thread monitorDropped();
			}
		}
		
		wait( respawnTime );
		
		pickup = spawn( classname, origin, spawnflags );
		pickup.angles = angles;
		
	}
}

delayedDeletion( delay )
{
	self thread delayedDeletionOnSwappedWeapons( delay );
	
	wait delay;
	
	if( isDefined( self ) )
	{
		self notify( "death" );
		self delete();
	}
}

delayedDeletionOnSwappedWeapons( delay )
{
	self endon( "death" );
	
	while( true )
	{
		self waittill( "trigger", player, dropped );
		
		if( isdefined( dropped ) )
			break;
	}
	
	dropped thread delayedDeletion( delay );
}

getItemWeaponName()
{
	classname = self.classname;
	assert( getsubstr( classname, 0, 7 ) == "weapon_" );
	weapname = getsubstr( classname, 7 );
	return weapname;
}

spinPickup()
{
	if( self.spawnflags & 2 || self.classname == "script_model" )
	{
		self endon( "death" );
		
		org = spawn( "script_origin", self.origin );
		org endon("death");
		
		self linkto( org );
		self thread deleteOnDeath( org );
		
		while( true )
		{
			org rotateyaw( 360, 3, 0, 0 );
			wait( 2.9 );
		}
	}
}

monitorDropped()
{
	name = self getItemWeaponName();
	clone = spawn( self.classname, self.origin );
	clone setModel( getweaponmodel( name ) );
	clone.angles = self.angles;
	self delete(); 
	
	dropDeleteTime = 5;
	
	if( dropDeleteTime > level.weappool_respawnTime )
		dropDeleteTime = level.weappool_respawnTime;
		
	clone thread delayedDeletion( dropDeleteTime );
	
	clone endon( "death" );

	clone waittill( "trigger", player, dropped );

	if( isdefined( dropped ) )
	{
		if( dropDeleteTime > level.weappool_respawnTime )
			dropDeleteTime = level.weappool_respawnTime;
			
		dropped thread delayedDeletion( dropDeleteTime );
	}
}

deleteOnDeath( ent )
{
	ent endon( "death" );
	self waittill( "death" );
	ent delete();
}


One thing you can do is, when setting your KVs in Radiant for your weapons, make the spawnflags = 3. This will make the weapon spawn "standing up" - that is, not laying on its side.

edited on Aug. 12, 2011 05:58 am by Tally
Share |
Restricted Access Topic is Locked subscribe
MODSonline.com Forums : Call of Duty 2 : CoD2 MP 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

»