question on NPC

Post here your questions about the OpenSpace 2.x or notify bugs and suggestions.

Moderators: Lapo, Bax

Post Reply
rut1630
Posts: 80
Joined: 29 Jun 2009, 10:27
Location: Israel

question on NPC

Post 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
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: question on NPC

Post 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.
Paolo Bax
The SmartFoxServer Team
rut1630
Posts: 80
Joined: 29 Jun 2009, 10:27
Location: Israel

thanks

Post by rut1630 »

thanks, that exactly what i was looking for, don't know how I've missed it
Nepaleno
Posts: 22
Joined: 06 May 2010, 06:28

NPC custom action

Post by Nepaleno »

How do I make NPC perform custom action?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post 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.
Paolo Bax
The SmartFoxServer Team
Nepaleno
Posts: 22
Joined: 06 May 2010, 06:28

Re:

Post 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?
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Post 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.
Paolo Bax
The SmartFoxServer Team
Post Reply