Author |
Topic: Script error |
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Sep. 2, 2012 03:49 pm |
|
guedoe writes...Quote: Here is the script code, its the _hardpoints.gsc. We are trying to add the Havock helicopter. I have it as an attachment since the code it too long.
Where did you get that script from? |
|
|
|
|
Category: CoD4 Scripting Posted: Sunday, Sep. 2, 2012 06:22 pm |
|
I have this script in maps/mp/gametypes, but I narrowed the error to these line here.
else if ( hardpointType == "havock_mp" )
{
if( isDefined( level.chopper ) || level.havock_ingame )
{
self iprintlnBold( level.hardpointHints["helicopter_mp_not_available"] );
return false;
}
if ( level.teambased )
{
maps\mp\gametypes\_globallogic::leaderDialog( "helicopter_inbound", team );
maps\mp\gametypes\_globallogic::leaderDialog( "enemy_helicopter_inbound", otherTeam );
for ( i = 0; i < level.players.size; i++ )
{
player = level.players;
playerteam = player.pers["team"];
if ( isdefined( playerteam ) )
{
if ( playerteam == team )
player iprintln( &"HARDPOINTS_HELICOPTER_DEPLOYED", self );
}
}
}
else
{
self maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "helicopter_inbound" );
selfarray = [];
selfarray[0] = self;
maps\mp\gametypes\_globallogic::leaderDialog( "enemy_helicopter_inbound", undefined, undefined, selfarray );
}
random_path = randomint( level.heli_paths[0].size );
startnode = level.heli_paths[0][random_path];
self thread maps\mp\_havock::spawnhavock( self, startnode, self.pers["team"] );
} |
|
|
|
DPGmaximus |
General Member Since: Aug 22, 2011 Posts: 2 Last: Sep 2, 2012 [view latest posts] |
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Sep. 2, 2012 06:57 pm |
|
DPGmaximus writes...Quote: Hey Tally! Guedoe is a member of my clan who has done modding in BF2. He is new to modding in CoD4. We are simply trying a few things out such as adding a Havoc Mi28 helicopter to re-reference the cobra/hind. We found some info on how to do it. Its just a little project were doing with our current mod.
Hello Max
Obviously, I recognised the code as my own, so at first I thought he might have decompiled my mod and got it that way. I would still have helped him, just that he should credit me for the stuff I did.
So, no problem if he is working with you. |
|
|
|
|
|
DPGmaximus |
General Member Since: Aug 22, 2011 Posts: 2 Last: Sep 2, 2012 [view latest posts] |
|
|
|
Tally |
General Member Since: Apr 21, 2005 Posts: 819 Last: Oct 26, 2012 [view latest posts] |
|
|
Category: CoD4 Scripting Posted: Sunday, Sep. 2, 2012 07:03 pm |
|
guedoe writes...Quote: I have this script in maps/mp/gametypes, but I narrowed the error to these line here.
else if ( hardpointType == "havock_mp" )
{
if( isDefined( level.chopper ) || level.havock_ingame )
{
self iprintlnBold( level.hardpointHints["helicopter_mp_not_available"] );
return false;
}
if ( level.teambased )
{
maps\mp\gametypes\_globallogic::leaderDialog( "helicopter_inbound", team );
maps\mp\gametypes\_globallogic::leaderDialog( "enemy_helicopter_inbound", otherTeam );
for ( i = 0; i < level.players.size; i++ )
{
player = level.players;
playerteam = player.pers["team"];
if ( isdefined( playerteam ) )
{
if ( playerteam == team )
player iprintln( &"HARDPOINTS_HELICOPTER_DEPLOYED", self );
}
}
}
else
{
self maps\mp\gametypes\_globallogic::leaderDialogOnPlayer( "helicopter_inbound" );
selfarray = [];
selfarray[0] = self;
maps\mp\gametypes\_globallogic::leaderDialog( "enemy_helicopter_inbound", undefined, undefined, selfarray );
}
random_path = randomint( level.heli_paths[0].size );
startnode = level.heli_paths[0][random_path];
self thread maps\mp\_havock::spawnhavock( self, startnode, self.pers["team"] );
}
The only thing I can see in there that might possibly be an unrecognised function is spawnHavock(). Make sure you have that function in your _havock.gsc file.
If it isn't that function, you are going to have to get the full readout of the error. To do that, enable logfile:
set logfile 1
Then, in your mod folder there will be a file called console_mp.log. Run your test server again, let the game produce the error again, then go get console_mp.log, open it with a text editor and then scroll down until you see "script compile error .." and read what file and function the error is pointing at. |
|
|
|