Page 1 of 1

OnCreateDFN and onCreateTile broken

Posted: Sat Mar 24, 2007 5:26 pm
by Xuri
Neither onCreateDFN nor onCreateTile seem to be working. I tested both in a script with global ID 0 to see if I could teleport a character to a given location (with both Teleport and SetLocation just to be sure). The code I tested with:

Code: Select all

function OnCreateDFN( objMade, objType )
{
	objMade.TextMessage( "WIOOOOO" );
	objMade.Teleport( 3651, 2649, 0, 0 );
	objMade.SetLocation( 3651, 2649, 0, 0 );
}

function OnCreateTile( objMade, objType )
{
	objMade.TextMessage( "WIOOOOO" );
	objMade.Teleport( 3651, 2649, 0, 0 );
	objMade.SetLocation( 3651, 2649, 0, 0 );
}
Nothing happened, not even the textmessage.

Summarily this breaks a lot of scripts, including those for picking starting towns and/or custom races on login right after character creation.

Posted: Sat Mar 24, 2007 5:47 pm
by Maarc
I don't know how case sensitive JS is (I can't remember atm). But that's not the functions, if it is. Lowercase on in both cases.

Posted: Sat Mar 24, 2007 6:45 pm
by Xuri
Doh. Of course, you are right. Sigh. Not even close to a bug :)

Posted: Sat Mar 24, 2007 7:08 pm
by Xuri
I have, however, found a bug. :)

function onCreateDFN() will not be run for player characters unless function onCreateTile() is also present in the same script! I'm almost certain on this one =P

Works:

Code: Select all

function onCreateDFN( objMade, objType )
{
	objMade.Teleport( 3651, 2649, 0, 0 );
}

function onCreateTile( objMade, objType )
{
}

Doesn't work:

Code: Select all

function onCreateDFN( objMade, objType )
{
	objMade.Teleport( 3651, 2649, 0, 0 );
}

//function onCreateTile( objMade, objType )
//{
//}

Posted: Sat Mar 24, 2007 7:10 pm
by Grimson
I'm having a look at it.

Posted: Sat Mar 24, 2007 7:19 pm
by Grimson
Found it, both functions used the same event id. I will commit a fix soon.