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

Members Online

»
0 Active | 73 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: World at War
Category: CoDWW Scripting
Scripting and coding with Call of Duty: World at War.
Moderators: foyleman, Foxhound, Mystic, StrYdeR, batistablr, Welshy, DrBiggzz, supersword, playername, novemberdobby
Latest Posts
Subscribed Posts
Search
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
Author Topic: Script Compile Error When Trying To Move Ships
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoDWW Scripting
Posted: Friday, Aug. 7, 2009 03:00 pm
moveTo moves the ship from A to Z. I don't know what you want?! Possible options are: let the ships move to some where else out of player's site, let the ships move back or just dissapear.

Explanation:
moveTo - Moves the ship from A to Z.
self.origin - Is the location where the ship is, meaning he will go to it's spawn possition again since the start origin is used.
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoDWW Scripting
Posted: Friday, Aug. 7, 2009 04:22 pm
When the ship sets sale it dosn't reach the script_origin it only gets half way then disappears and spawns again in it's original postition, then sets sail again.
Share |
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoDWW Scripting
Posted: Friday, Aug. 7, 2009 05:30 pm
self moveTo( self.dest, 60, 0.1, 0.1 );

wait 360; // You'll need to increase this time, because the ship has to less time to make it before it will be set to it's original position

self.origin = self.start;
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoDWW Scripting
Posted: Friday, Aug. 7, 2009 05:46 pm
The problem is your wait times. Since there are multiple scripts in this post, I have no idea which one you are using at the moment. But it sounds to me that, the object never gets to finish moving before you tell the script to loop again and move the object all over again. Sounds like a simple fix.

In the original script, you have a Speed which represents, how long the object takes, to get to its destination.

So in this case:

level.shipSpeed = 60; //Time it takes Ship to move full move

Here is an example of a Plane Flyover, the same Idea but with some comments so you know what does what. Use it as an example.

Code:
main() 
{ 
	level thread planes();
} 

planes() 
{ 
	level.PlaneSpeed = 10.5;  //Time it takes Plane to move full move 

	ac130 = getent ("ac130_flyby","targetname"); 

	temp = getent (ac130.target,"targetname"); 
	ac130.dest = temp.origin; 
	ac130.start = ac130.origin; 
	ac130 hide(); 

	wait (360);	//Time Before FIRST Flyover 

	while (1) 
	{ 
		ac130 thread plane_flyby("ac130_flyover");	//Sound alias

		wait (1000);	//Time before script loops again at playing sound 
	} 
} 

plane_flyby(sound) 
{ 
 
	if (isdefined (sound)) 
	self playsound (sound); 

	wait (6);	//Time after sound plays to move plane

	self show(); 

	self moveto(self.dest, level.PlaneSpeed, 0.1, 0.1); 

	wait level.PlaneSpeed; 

	self hide(); 
	self.origin = self.start; 
}
Share |
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoDWW Scripting
Posted: Friday, Aug. 7, 2009 07:10 pm
DeekCiti thank you, you reminded me on something else wish will properly work beter in this script.

self waittill( "movedone" );

In the place of entering a time, you can let the script wait for the ship to arive at his destination. (Well it's beter when using mutiply ships with different distances.) When arived you can let them wait a couple of seconds before setting them on their spawn location.

edited on Aug. 7, 2009 03:11 pm by scillman
Share |
DeekCiti
General Member
Since: Mar 13, 2008
Posts: 1293
Last: Jul 9, 2016
[view latest posts]
Level 8
Category: CoDWW Scripting
Posted: Friday, Aug. 7, 2009 10:01 pm
Yeah, the waitill movedone can work but this script works fine just the way it is, it has its own function to wait until it stops.

wait level.PlaneSpeed;

Basically same thing as waittill movedone.
It waits until the speed has finished and then continues.
In this case, it waits until the plane/boat gets to is origin by checking the speed function, when that time has met, the script loops and it starts again.

I've actually used this script to move boats in a harbor in a map I'm working on right now and it works great.
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoDWW Scripting
Posted: Saturday, Aug. 8, 2009 08:34 am
How would I add the self waittil("movedone"); to this script?

This is what I have at the moment:

Code:
main()
{
  level thread ships();
}

ships()
{
  ships = getEntArray( "ship", "targetname" ); // Will get all the ships with ship as targetname

  for(i = 0; i < ships.size; i++) // Run the following on all the entities with ship as targetname
  {
    ships[i] thread ship();
  }
}

ship()
{
  self endon( "disconnect" );

  // I've done it this way so it will be correct in the game!
  self.dest = (getEnt( self.target, "targetname" )).origin; // The ship's target origin
  self.start = self.origin; // The ship's original origin
  
  //wait 20; // Gave an error for some reason?!
  
  while(1)
  {
    //self playLoopSound( "m_engines" );
  
    self moveTo( self.dest, 60, 0.1, 0.1 );
    
    wait 30;
    
    self.origin = self.start;
    
    wait 20;
  }
}


Would it be possible for you to post the script your using to move the ships in your harbor?
Share |
scillman
General Member
Since: Nov 23, 2006
Posts: 360
Last: Sep 1, 2012
[view latest posts]
Level 5
Category: CoDWW Scripting
Posted: Saturday, Aug. 8, 2009 10:57 am
First remove the the rule that contains: "self endon( "disconnect" );" because that's my fault I used to use the script a different way[crazy]

Code:
while(1)
  {
    //self playLoopSound( "m_engines" );
  
    self moveTo( self.dest, 60, 0.1, 0.1 );
    
    self waittill( "movedone" );
    
    self.origin = self.start;
    
    wait 20;
  }


After the self waittill( "movedone"); you could always at some seconds to wait, so that it doesn't get to infinity [wink]
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoDWW Scripting
Posted: Saturday, Aug. 8, 2009 11:13 am
Thanks scillman [wink] I'll try it.
I'm also using the same script to add a moving shark [casanova]



Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoDWW Scripting
Posted: Saturday, Aug. 8, 2009 01:08 pm
This is the script now, works great [wink] the ships now go all the way to the script_orign.
I tried to remove the part you said, but got an error, what should it be with the part you said remove?

Code:
main()
{
  level thread ships();
}

ships()
{
  ships = getEntArray( "ship", "targetname" ); // Will get all the ships with ship as targetname

  for(i = 0; i < ships.size; i++) // Run the following on all the entities with ship as targetname
  {
    ships[i] thread ship();
  }
}

ship()
{
  self endon( "disconnect" );

  // I've done it this way so it will be correct in the game!
  self.dest = (getEnt( self.target, "targetname" )).origin; // The ship's target origin
  self.start = self.origin; // The ship's original origin
  
  //wait 20; // Gave an error for some reason?!
  
  while(1)
  {
    //self playLoopSound( "m_engines" );
  
    self moveTo( self.dest, 60, 0.1, 0.1 );
    
    self waittill( "movedone" );
    
    self.origin = self.start;
    
    wait 20;

  }
}
Share |
Restricted Access Topic is Locked
Page
Previous Page Next Page
subscribe
MODSonline.com Forums : Call of Duty: World at War : CoDWW 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

»