Page 1 of 1

question on NPC

Posted: 01 Jun 2010, 10:14
by rut1630
As far as I'm pretty new in NPC subject, I have some quesions:

1) I realized that for making NPC mechanism, I need to extends java code.
As far as I have a little experience with java (I write C++ and AS3),
could you give me a few guide lines on how to make such extention- something basic and simple will do.

2) which developing tool do you suggest, to develop the java code on ?


Thanks alot

Re: question on NPC

Posted: 02 Jun 2010, 08:02
by Bax
1) I realized that for making NPC mechanism, I need to extends java code.
As far as I have a little experience with java (I write C++ and AS3),
could you give me a few guide lines on how to make such extention- something basic and simple will do.
http://openspace-engine.com/support/manuals/extension
Please also read the SmartFoxServer documentation about extensions and NPCs.
2) which developing tool do you suggest, to develop the java code on ?
We use Eclipse.

thanks

Posted: 02 Jun 2010, 08:06
by rut1630
thanks, that exactly what i was looking for, don't know how I've missed it

NPC custom action

Posted: 19 Jul 2010, 07:17
by Nepaleno
How do I make NPC perform custom action?

Posted: 19 Jul 2010, 15:21
by Bax
You should send your own response from the server to the client, containing your custom parameters and the id of the npc user. The retrieve a reference to the avatar by means of the OpenSpace.getAvatarById method and pass your custom parameters to it, using a custom method.

Re:

Posted: 20 Jul 2010, 09:11
by Nepaleno
There's function called setMyAvatarAction() in clientside API, which triggers PC avatar's onCustomAction event. How do I do it serverside for NPC?

Posted: 20 Jul 2010, 09:26
by Bax
You can't. That method uses the sendObject method of the SmartFoxServer API, which in SFS v1 is not available on the server side.