onCreate isn't working for me

Need help with your JScripts? Got questions concerning the DFNs? Come forward, step inside :)
Post Reply
mogulwraith
UOX3 Newbie
Posts: 13
Joined: Sat Mar 12, 2011 5:44 am
Has thanked: 0
Been thanked: 0

onCreate isn't working for me

Post by mogulwraith »

I read a post already about this but it didn't help.

When I 'add item my_item the item is created but onCreate is not called?
I can get onCollide to fire the same code, so I know the myFunction is set up correctly and the file associations are correct but this doesn't work:

function onCreate( objMade, objType )
{
myFunction();
}

I cannot get onCreate to fire any code. Situation is, I created a new DFN file with an item in it. DFN is in dfndata\items\misc
The item itself is using a pre-existing item as a template (0x1869) and
is created just fine. The script I wrote for it does work in onCollide etc

[invasion_quest]
{
get=base_item
name=Invasion Quest Gem
id=0x1869
weight=0
decay=0
script=5200
}

I'm stumped.


P.S.: asking a lot of questions :) I don't mean to be a pain but I have big plans and just started this project and I'm hoping I don't have to exhaustively search whenever I want to do something "simple". Thanks in advance.
giwo
Developer
Posts: 1780
Joined: Fri Jun 18, 2004 4:17 pm
Location: California
Has thanked: 0
Been thanked: 0

Post by giwo »

Off the top of my head I think you need to use onCreateDFN()
mogulwraith
UOX3 Newbie
Posts: 13
Joined: Sat Mar 12, 2011 5:44 am
Has thanked: 0
Been thanked: 0

Post by mogulwraith »

giwo wrote:Off the top of my head I think you need to use onCreateDFN()
erm... I feel stupid now. I actually did try that once, but was seeing no results due to misunderstanding something else... so I didn't try it again. But the guide does use onCreate not onCreateDFN in the example, even though the title of the section is onCreateDFN...

Perchance is there an undocumented change to onSpeech? (I posted about that not working for me either) I see other scripts just using onSpeech but I can't get it to trigger.
Post Reply