Skip to content

Campaign Database and updating module in toolset

2»

Comments

  • ForgeForge Member Posts: 32
    edited February 2021
    My starting area has a portal where players teleport away after speaking to an NPC, which tells them what has happened in the story so far. I was just beginning to experiment upon implementing this SetCampaignLocation.

    My module is not a PW though

    Maybe I could try it by

    AssignCommand(oPC, ActionJumpToLocation(GetCampaignLocation(oPC)));
  • ForgeForge Member Posts: 32
    I figure that if that works, campaignlocation should have been saved correctly into database?
  • ForgeForge Member Posts: 32
    Lol it worked, you're a genius, ForSerious B)


    It didnt even cross my mind that I could have placed that into OnUsed -script on a portal.

    Made a script like this from the include file you cleaned up for me:
    #include "dbmodule_test"
    
    
    void main()
    {
    
    
    
    
    object oPC = GetLastUsedBy();
    
    location lLocation = GetCampaignLocation(PW_DB_NAME, (DB_PC_L_LEAVE_PREFIX + GetTag(oPC)));
    
    AssignCommand(oPC, ActionJumpToLocation(lLocation));
    
    
    }
    


    Now it works, transporting the player into the location where they quit the server.

    Thank you!
  • ForSeriousForSerious Member Posts: 446
    My petty mind is trying to fathom how this would work or ever be needed in a non persistent world. Multiplayer, players joining late? Teleport to party leader or last checkpoint seem to fit that case better.

    Well, to see if it's working try adding #include "x0_i0_position" and call LocationToString(location) right after getting it from the database:
    #include "dbmodule_test"
    #include "x0_i0_position"
    //…code defining oPC
    location lLoc = GetPCStartLocation(oPC);
    SendMessageToPC(oPC, LocationToString(lLoc));
    

    AssignCommand(oPC, ActionJumpToLocation(GetCampaignLocation(oPC))); won't work. You'd need to call AssignCommand(oPC, ActionJumpToLocation(GetPCStartLocation(oPC))); instead.
  • ForgeForge Member Posts: 32
    I understand that you are trying to fathom it, but this is learning, I have an ambition to build a PW in the future. All this is just plus for me to learn about NWN.
    I am not a progammer by profession, and I have lot of free time because I have been on sick leave for two years from a workplace accident, and I have been able to resume making neverwinter for my friends like a month ago.


    Well I was able to start a module from DM -client, move my character into another area, quit, restart the server and use the portal to teleport into that location where I quit.



    I will add that and try it.


  • ForSeriousForSerious Member Posts: 446
    edited February 2021
    I'm glad it works.
    Cool cool. I enjoy helping out.
  • ForgeForge Member Posts: 32
    ForSerious,

    what data you collect from a PC when they Log into your PW or when player rests etc?

    I mean Character statistics, HP, Num of times killed, PC status etc?

    How do you handle these things.


    Im curious just because the subject interests me.

    I know PW:s must keep track of player status but what does it include usually?


    Do you keep a "Player character" -Database where you save these, or how do you handle this?
  • ForSeriousForSerious Member Posts: 446
    I'm pretty unorganized. I wrote most all of that stuff when I was a teenager over ten years ago when I was new to programming.
    So mainly, I store:
    • If a player is not new, meaning they have a tag. That used to be in a database, but now it's just a tag on the player bic file.
    • Current HP when a player logs off, so it can be restored. (No idea why the game doesn't do that. That's the easiest exploit for players. They're almost dead, relog and suddenly they're full HP.)
    • If a player is dead, and should be in the dead realm.
    • Kill count per challenge rating.
    • Kill score per challenge rating. I use it for my looting system.
    • Mining/crafting progress.
    I don't track times died, but that would be a cool one to add. Quest progress would be another, but for now all my quests give items, so I just check for those. But actually, there is one quest and player settings that I store on the PC Properties item. Honestly lots of these could probably be stored on that item. Things stored on that item though, only get saved when they player logs out. If the server crashes, all that is lost. With the database, it saves it right away.
    As mentioned before, each of those data points, I store in their own database, and just use the tag of the player to get and set data.

    You've got me thinking about things I could do to make it better in many ways. Since I have no player base, I could do it without hurting anyone.
Sign In or Register to comment.