[FIXED] OnCreateDFN and onCreateTile broken

Here we stuff all the bugs we've managed to squash/squish/squelch.
Post Reply
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

OnCreateDFN and onCreateTile broken

Post 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.
Last edited by Xuri on Sun Jan 18, 2009 8:34 pm, edited 2 times in total.
-= Ho Eyo He Hum =-
Maarc
Developer
Posts: 576
Joined: Sat Mar 27, 2004 6:22 am
Location: Fleet, UK
Has thanked: 0
Been thanked: 0
Contact:

Post 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.
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post by Xuri »

Doh. Of course, you are right. Sigh. Not even close to a bug :)
-= Ho Eyo He Hum =-
User avatar
Xuri
Site Admin
Posts: 3704
Joined: Mon Jun 02, 2003 9:11 am
Location: Norway
Has thanked: 48 times
Been thanked: 8 times
Contact:

Post 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 )
//{
//}
-= Ho Eyo He Hum =-
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

I'm having a look at it.
Grimson
Developer
Posts: 802
Joined: Sat Jun 04, 2005 1:52 am
Location: Germany
Has thanked: 0
Been thanked: 0

Post by Grimson »

Found it, both functions used the same event id. I will commit a fix soon.
Post Reply