NPC woes

om3n
om3n
edited November 2010 in DotNet
I'd like to start off thanking the devs for putting out a product like this. I realize it wasn't passed out there for free and if i continue ill have to look into a license. Thank you nonetheless.

I'm not a very strong programmer. I hope i can avoid the comments like learn more C# first. I'm a hands on kind of learner. I learn best from hands on experience.

I'm using unity 3 and ive bee playing with trying to get a npc into the game(island mmo demo) aside from the wingrid client. I can get the files into the project somewhat successfully, but i cant seem to find any examples of the variables used in calling a npc, such as coordinate info etc. There doesn't seem to be any info out there on it that can assist me in any way and google has exhausted itself after 100 irrelevant searches lol...

So being a weak programmer the best I've been able to come up with has been getting the npc files into the project (complains if i have npcmmoworld as well as mmoworld works if i remove mmoworld) which still gives me errors (i realize this being due to the files are more of a template then any actual representation) about overloaded methods.

I would eventually like to use my data through a sql engine to load items, npcs etc such as you see in (i dont like using this example cause its a legal gray area but the code and how the system works is very insightful) mangos mmorpg engine(cheap wow server ripoff) where all the data is serverside.

Any bit of information you can help provide about the npc system would be extremely appreciated.

Comments

  • It seems that we forgot to maintain the Npc files, sorry about that.
    Please add/replace the files from the attached zip to the mmo demo project.
    Excluding the MmoWorld.cs is correct.
    Thanks!

    EDIT: added missing file to zip
  • Thank you Boris for such a quick reply. I started a new folder cause i had been mucking with the code a bit and things got ugly... lol anyways i get a couple errors dropping it in like that. I also had 4 other errors when using mmoworld.cs in the setup, im assuming this is to be removed for npcmmoworld?(edit: re-read your post seen you confirming this, have the error below still)

    Error 1 The type or namespace name 'IMmoItem' could not be found (are you missing a using directive or an assembly reference?) server\src\Photon.MmoDemo.Server\NpcItem.cs 23 34 Photon.MmoDemo.Server
  • you have to include IMmoItem.cs
  • Ah, right... i feel kinda stupid after that one... Doing so unfortunately brings up 11 more errors. A lot of them seem to be related to rotation.

    Error 3 'Photon.MmoDemo.Server.MmoItem' does not implement interface member 'Photon.MmoDemo.Server.IMmoItem.Rotation' \src\Photon.MmoDemo.Server\MmoItem.cs 26 18 Photon.MmoDemo.Server

    Error 11 'Photon.MmoDemo.Server.Events.ItemSubscribed' does not contain a definition for 'Rotation' \src\Photon.MmoDemo.Server\MmoClientInterestArea.cs 71 21 Photon.MmoDemo.Server

    Error 6 'Photon.MmoDemo.Server.MmoItem' does not contain a definition for 'Rotation' and no extension method 'Rotation' accepting a first argument of type 'Photon.MmoDemo.Server.MmoItem' could be found (are you missing a using directive or an assembly reference?) \src\Photon.MmoDemo.Server\MmoActor.cs 1237 22 Photon.MmoDemo.Server
  • ah.. so sorry.. missed the updated MmoItem.cs
    updated zip is attached
  • Hey, no worries. Stuff happens. Would you be willing to give out that whole folder? most the other errors are gone but there are several more now.. lol Again ty for being good with this!

    Error 1 'Photon.MmoDemo.Server.Events.ItemSubscribed' does not contain a definition for 'Rotation' \src\Photon.MmoDemo.Server\MmoClientInterestArea.cs 71 21 Photon.MmoDemo.Server

    Error 2 'Photon.MmoDemo.Server.MmoItem' does not contain a constructor that takes '6' arguments \src\Photon.MmoDemo.Server\MmoPeer.cs 245 26 Photon.MmoDemo.Server

    Error 6 'Photon.MmoDemo.Server.Operations.Move' does not contain a definition for 'Rotation' and no extension method 'Rotation' accepting a first argument of type 'Photon.MmoDemo.Server.Operations.Move' could be found (are you missing a using directive or an assembly reference?) \src\Photon.MmoDemo.Server\MmoActor.cs 1246 46 Photon.MmoDemo.Server

    Error 7 'Photon.MmoDemo.Server.Events.ItemMoved' does not contain a definition for 'OldRotation' \src\Photon.MmoDemo.Server\MmoActor.cs 1247 25 Photon.MmoDemo.Server
  • You are not using the latest 2.2.2 SDK?
  • I am. Tried a fresh one as well. Dropped those files in the latest rar into it and thats the end result. (after adding the files to project and removing the one ofc) Only version i ave on my comp is 2.2.2 ExitGames-Photon-Server-SDK_v2-2-2.zip


    Edit: i tried again with another fresh version. all the errors are gone and everything seems ok now! tyvm

    I guess one last quick question if you could readily provide an answer. the npc code as it with would it be possible(with elaboration to the code obviously) to use the same code to build on and have spawns generated via sql database rather then having spawns and their definitions on a local flat file?
  • I have no idea what you are doing wrong..
    The errors you post indicate that you have a version without rotation, but the 2.2.2 mmo demo has it (check for example your error 7: no property 'OldRotation' exists?)
    I tried this several times and it works fine:

    1) download the sdk: http://exitgames.com/Download/Photon/St ... v2-2-2.zip
    2) unzip the sdk
    3) download the patch zip: download/file.php?id=30
    4) unzip the patch zip into src-server\Mmo\Photon.MmoDemo.Server (overwrite existing files)
    5) open solution
    6) include IMmoItem.cs in Photon.MmoDemo.Server project
    7) compile --> no error
    8) exclude MmoWorld.cs
    9) include Npc files
    10) compile --> no error
  • om3n wrote:
    Edit: i tried again with another fresh version. all the errors are gone and everything seems ok now! tyvm
    oh :) good
  • om3n wrote:
    I guess one last quick question if you could readily provide an answer. the npc code as it with would it be possible(with elaboration to the code obviously) to use the same code to build on and have spawns generated via sql database rather then having spawns and their definitions on a local flat file?
    sure.. i guess it would look like this:
    1) load npc items from db
    2) init npc items (similar to code in npcmmoworld.cs)
    3) to raise spawn events call npcItem.Spawn()
    etc