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

Members Online

»
0 Active | 89 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
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: Saturday, Aug. 8, 2009 01:27 pm
The following line should/could be removed from the script:
Code:
self endon( "disconnect" );


I added it because I'm used to write script like this for on the players and then it will be used but the ships don't disconnect from the map however players can [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: Monday, Aug. 10, 2009 01:20 pm
I'm trying to do the same thing with rats, but I'm getting an error.

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

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

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

rat()
{

  // I've done it this way so it will be correct in the game!
  self.dest = (getEnt( self.target, "targetname" )).origin; // The rats target origin
  self.start = self.origin; // The rats 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;

  }
}




The error:

Code:
uninitialised variable 'rat'
  for(i = 0; i < rat.size; i++) // Run the following on all the entities with rat as targetname
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: CoDWW Scripting
Posted: Monday, Aug. 10, 2009 01:25 pm
Check carefully you entity assignments (i.e. rats = getEntArray("blah", "blah" ) is an entity assignment, where "rats" is assigned (=) to the entarray()).

In this case, change rat.size to rats.size.
Share |
{GITS}Cleaner
General Member
Since: May 23, 2006
Posts: 778
Last: Apr 23, 2011
[view latest posts]
Level 7
Category: CoDWW Scripting
Posted: Monday, Aug. 10, 2009 02:48 pm
Thanks Demon, that fixed it [wink]
Share |
Restricted Access Topic is Locked
Page
Previous 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

»