Showing posts with label Winter. Show all posts
Showing posts with label Winter. Show all posts

Sunday, October 12, 2008

Reference - row_inc_functions - Rowell's PW Functions

Reference to functions called in Rowell's PW Toolkit.

row_inc_functions

GLOBAL FUNCTIONS

GetCDKeyID(object oPC)
Returns the Database Record ID of the CDKey for the Playerint

GetPlayerID(object oPC)
Returns the Database Record ID of the Playerint

GetCharacterID(object oPC)
Returns the Database Record ID of the Characterint

GetItemID(object oItem)
Returns the Database Record ID of the Itemint

GetItemOwner(object oItem)
Passes the Database Character ID of the Owner of the Itemint

GetIsPlayerDM(object oPC)
Returns from the Database whether or not this Player Account belongs to a Server DMint

FormatID(int iID)
Returns a (gIDsize) character string based on the integer passed, with leading zeros// Example: 159 is converted to "00000159"

GetRace(object oPC)
Returns the String Value of the Race of the Objectstring

GetRaceSub(object oPC)
Returns the String Value of the Sub Race of the Objectstring

Get PCGender(object oPC)
Returns the String Value of the Gender of the Objectstring

GetAlignment(object oPC)
Returns the String Value of the Alignment of the Objectstring

GetClass(int iPos, object oPC)
Returns the String Value of the Class of the Object, given the position (1-3)

GetLevel(object oPC)
Returns the true level of the object, combining the levels of up to all 3 classes

GetGameDate()
Returns the Current Game Date in the string form of "YYYYMMDD"

GetGameDate()
Returns the Current Game Date and Time in the string form of "YYYYMMDDHHMM"

StringZero(int iNum, int iSize)
Given a number (iNum), converts it to a String and adds leading zeros to make the string iSize long
Example: StringZero(10,5) would return "00010"

GetItemTag(object oItem)
Given an Item Object, returns the Tag of the Item. If the Database Item Tracking Setting is turned on, the function will return the True Tag (not the modified DB Tag).

GetTrackedItemPossessedBy(object oPC, string sTag);
This function returns the object in the Character's (oPC) inventory, given a particular Tag (sTag). This function should be used when Item Tracking is Enabled (gEnableItemTracking = TRUE) in the place of the GetItemPossessedBy() function. Otherwise, this Function acts exactly like the built-in GetItemPossessedBy(object oPC, string sTag)

Row_ModuleStart()
Use in the Module's OnModuleStart Event

Row_ModuleEnter(object oPC=OBJECT_INVALID)
Use in the Modules's OnClientEnter Event

Function Comments

  • GATHER THE EVENT TRIGGERING OBJECT IF IT IS NOT PASSED
  • ABORT IF THE OBJECT IS NOT A PLAYER OR DM
  • DEBUG CODE
  • ABORT IF THERE IS NO DATABASE ACCESS
  • STORE THE PLAYER'S DATABASE VALUES ONTO THE PLAYER OBJECT
  • iPID = GetPlayerID(oPC);
  • iCID = GetCharacterID(oPC);
  • iIsDM = GetIsPlayerDM(oPC);
  • UPDATE THE PLAYER'S TIME STATISTICS
  • UPDATE THE CHARACTER'S TIME STATISTICS
  • UPDATE THE IP ADDRESS TABLE
  • INITALIZE THE PLAYER'S CHARACTER ONLINE STATUS
  • SISPLAY LOGIN TO DM'S AND TO LOG FILECHECK IF THE USER IS BANNED
  • CHECK IF THE USER IS SIGNED ON AS A DM, BUT THEIR PLAYER ACCOUNT IS NOT DMACTIVE (EXTRA SECURITY AGAINST FAKE DM'S / HACKERS)
  • SET THE PLAYER FLAG THAT THEY ARE ONLINE TO TRUE

Row_ModulePlayerLoaded(object oPC=OBJECT_INVALID)
Use in the Module's OnPlayerLoaded Event

Function Comments

  • DEBUG CODE
  • GATHER THE EVENT TRIGGERING OBJECT IF IT IS NOT PASSED
  • ABORT IF THE OBJECT IS NOT A PLAYER OR DM
  • ABORT IF THE PLAYER IS NOT READY TO BE TELEPORTED YET
  • STORE THE PLAYER'S DATABASE VALUES ONTO THE PLAYER OBJECT
  • ABORT IF THE PLAYER IS LOGGING BACK ON (BEFORE THE SERVER WAS RESET)
  • CHECK / SET THE CHARACTER'S HIT POINTS
  • IF THE CHARACTER IS DEAD IN THE DATABASE, MAKE THE CHARACTER DEAD
  • SET FEATS / SPELLS TO NO USES LEFT
  • JUMP THE CHARACTER TO THE LAST SAVED LOCATION


Row_ModuleExit(object oPC=OBJECT_INVALID)
Use in the Module's OnClientExit Event Function Comments

Function Comments

  • GATHER THE EVENT TRIGGERING OBJECT IF IT IS NOT PASSED
  • ABORT IF THE OBJECT IS NOT A PLAYER OR DM
  • DEBUG CODE
  • SET THE PLAYER FLAG THAT THEY ARE ONLINE TO TRUE
  • SET THE CHARACTER'S CURRENT HIT POINTS
  • SET THE CHARACTER'S DEATH STATUS
  • UPDATE TIME SPENT ONLINE
  • UPDATE THE CHARACTER TIME STATISTICS
  • SET THE PLAYER/CHARACTER AS OFFLINE

Row_AreaEnter(object oPC=OBJECT_INVALID)
Use in all Areas' OnEnter Event

Row_AreaExit(object oPC=OBJECT_INVALID)
Use in all Areas' OnExit Event

Row_PlayerUpdate(object oPC=OBJECT_INVALID)
Use to store the Character information from the object (oPC) into the Database

Row_PlayerRest(object oPC=OBJECT_INVALID)
Use in the Module's OnPlayerRest

Row_PlayerDead(object oPC=OBJECT_INVALID, object oNPC=OBJECT_INVALID)
Use in the Module's OnPlayerDeath Script

Row_PlayerRaise(int bPortToBind, object oPC=OBJECT_INVALID)
Use in the Module's OnPlayerRespawn Script with bPortToBind set to TRUE
Use in Raise Dead and Ressurrect Spells Scripts, with bPortToBind set to FALSE

Row_AddToLootTable(object oItem)
Use to add an item to the Database, to catalog the items drop, and how many times each item has dropped in the game.

Row_ItemCreate(string strResRef, sting strTag="", object oOwner=OBJECT_INVALID)
Used internally and should not be used.

Row_ItemGain(object oItem=OBJECT_INVALID)
Use in the Module's OnAcquire

Row_ItemLose(object oItem=OBJECT_INVALID)
Use in the Module's OnUnacquire Script

GetNPCID(object oNPC);
Returns the NPC ID for the given NPC (oNPC)

IncreaseNPCkills(object oNPC);
Increases the Total Number of Kills that an NPC type has inflicted upon Player

IncreaseNPCdeaths(object oNPC);
Increases the Total Number of Deaths that the NPC type has suffered.

Row_ResetCharacter(object oPC);
Used to set the character's (oPC) Feats and Spells to all used. This stops people from logging off and back on to get all their spells back.

Row_DiscoverLocation(object oPC, object oPlace=OBJECT_SELF);
Used to reward the character (oPC) when they step into a trigger (oPlace) and discover a new location.

RemoveEffects(object oPC)
Use to remove all negative affects from a character. This function is a direct copy from the NWN script in nw_i0_plot

Saturday, October 11, 2008

Prefabia Restarted - #8

The night is late but I feel a sense of renewed excitement when working within the NWN toolset. The loss of my previous work, left ashes in my mouth and a sense of futility at ever producing a module in NWN2. With time I have found the loss has turned into a win, much like the regrowth of plants through the ashes of a proceeding fire.

My module slate is clean and so this time I have focussed on getting the core systems and haks installed and working. MYSQL and NWNX4 1.08 is installed and persistance is working as it should, and after some poking around under the hood I actually understand it a lot better than before.

I took them time to install BTH's Module Testing Toolkit, an excellent piece of work if you want to debug a module using nothing more than a slick UI. I seriously recommend this to anyone who is building or is considering building. Highly configuraable and easy to use, just ensure you read the documentation.

DMFI has crept into the module as well and seems to compile without issue. I am still working out the DMFI component as I am unsure if it comes with languages like NWN1 DMFI or not. Still to be discovered I suppose, ahh the joy of building.


Some excellent content I added as well seeing as I really like it and have been discussing these packs with BTH for a while now. It is fantastic to see him release some awesome content and if you are curious you can always have a look at his blog to get a feel for what he is working on.

So that wraps up my little update and looking at the clock, I reckon it is time I hit the sack. Before I shoot off I noted Relexx, one of the orginal Aeon NWN1 PW leadership team, has started to host a NWN1 PW called Cocoon. You can find it under Multiplayer - Role Play. As soon as I get a chance, I will have to head on over and have a run around, though it is currently alpha and prone to changes on a daily basis.

Friday, August 22, 2008

Prefabia Restarted - #5

One thing that is often forgotten by builders and players alike is acknowledging and voting on the sources they use in their world. Without input from the users, the modders and scriptors eventually loose heart and move on things that they perceive has more rewards or community thanks.

Taking the above statement as a truth, I think I should begin to thank the people for the contributions that I am directly or indirectly using as part of Prefabia.

Acknowledgements

Prefabs

Plugins

Updating Plugins .... Tani and Grinning Fool


On another subject but one that comes about due to a scriptor moving on is updating plugins to the latest NWN2 release. Pplugins make life much easier for builders and has made Prefabia a lot more fun to build, shame NWN2 Atari did not include some of these essential tools.

Tani Provided some instructions on how to recompile the plugins to the latest version of NWN2, main thing you need is the source code.

  1. Grab visual c# express from m$ (it's free, the 2005 version is enough, don't know if 2008 is different). http://www.microsoft.com/express/2005/
  2. Grab the source code and unzip it to a folder of your liking.
  3. Open the project file in visual c#.
  4. Look for the broken references to nwn2toolset.dll and oeishared.dll, maybe others too (they are marked with an exclamation mark in a yello triangle). remove the references and add new ones to the latest version of these files.
  5. Compile the project, and move the new dll (found in subfolder bin/release or just bin) to your plugins folder - you should be fine.in case that was to quick take a look at the video at Link . This shows how to fix the references and compile nwn2packer and especially stripease.

Sunday, August 17, 2008

Prefabia Restarted - #3

No real screen shots today, more of a small note detailing my progress on Prefabia. One of the things that has been annoying me on the Starting Area of Prefabia "Stone Port" is that the docks were not walkable. I have spent a fair bit of time, trying to make them walkable through various methods and having no joy. I tried, lining up the placeable, putting a walkmesh helper placeable on top and finally lifting terrain under then but they still didn't allow a pc to stroll along them.

Then I read a small note on the Bioware forums, where a person suggested setting the dock placeables to environment, draping the walkmesh helper placeable over the top and baking the area. I tried this and bam! My docks are now walkable and you can stroll out past the ships and look out onto the Sea and dream about where you may go or come from.

Now that docks are walkable, I now need to make the ship decks walkable, so that players can interact with the crew and such. The docks will only have two ships in at a time, one inbound and another outwards bound. Players will start on the dock of the inbound ship, the outbound will not take on players and mainly be there for ore/trade collection.

Some images of the process will be posted up later on today, to give people a feel for how to do
this.

Wednesday, August 13, 2008

Prefabia Restarted - #2

A small update but one highlighting an excellent tool by Tani called TerraCoppa. Sadly it is no longer maintained but Tani has kindly provided the source code so that it can be compiled to work in later releases of NWN2.

http://nwvault.ign.com/View.php?view=Nwn2plugins.Detail&id=25&comment_page=3


TerraCoppa allows a builder to rapidly replicate an area and the contents. It can rotate, raise/lower the height of the terrain and migrate all the bits and pieces you would find in area, over to your duplicate.



TerraCoppa will be a major part of my workflow, allowing me to grab and move parts of areas from other prefabs across into my own world. Using the tool you can map up areas outside the walkmesh and make them a new area that you can walk in.


Work Flow.


1. Rotate the map by 90 degrees due to the map orientated in the wrong direction.


2. Shift the map backwards by one grid row, so that the docks that were out of the walkable area now fall into it.


Original Map


Shifted Map, note the green textured sothern part of the map. You get that when TerrCoppa moves things around, texture is default to the map.



3. Shift map one grid to left, so more of the hill is in the walkmesh.




4. Replicated the terrain on the eastern edge and dropped it over the green texture, same with southern. All that remains is to clean up and remove bits that you don't want. You can see the joins in the image below, but a little brush work and gone.



After some quick work and tweaking the water, it is done. This area will form the starting ton for Prefabia. The area will nee some fine touch ups and wameshitig,but is prety well ready to go.


Monday, January 21, 2008

Building a Persistent World in NWN (1&2) - The Prefabia Project. Part 1

I find myself at a point in my knowledge of building a NeverWinter Nights (1&2) Persistent World that I can now begin to document my thoughts with confidence that some of them are correct. To set the scene, I have played on several good PW's (Mystara, Chronicles of Torn, Melnibone and Aeon), built a PW with friends, and now currently help maintain and improve two more. A reasonable amount of experience and a lot of it hard earned or discussed with others who have suffered the pain of building.

So without getting caught in pointless verbiage, I thought I might as well list the top best practices that are IMHO the are a must for building a PW, or improving one if it is already running. Notes these are my opinion, not much else really but if they save someone else some grief, then they are worth pontificating about.

1. Have a plan.
This seems rather basic, but most people forget to work out the stages and understand what needs to be done first for a world to begin. A plan lays out the steps needed, highlights holes and gives you a good checklist to work to as you achieve milestones. Not hard, but few do it.
A plan to be really effective needs to have critical milestones, resourcing and due dates. Milesstones are stages in your project, where ytou have achived a solid chunk of work. This could easily be core systems decided on, base module built, beta release. The dates tie into these, without dates your project will slip further and further behindand the energy you may have built up with the community is lost. REsources can be hardware and people, get these organised early on, keep your team small.

2. Have an understanding of what your world is going to be and more importantly what it is not.
What your world is, will ultimately determine what systems you add, disable or modify. Hardcore RP worlds have different requirements to Hardcore PVP.

Additionally you need to have a world story of some sort, this is covered later.

3. Identify Base systems and haks for your world
Best to identify these early and select or build what is needed. My preference is source from another builder than craft myself. If you source off the vault, remember to vote as well. Authors respond to requests and queries much more readily if you vote.

Core systems to consider, prior to creating custom classes etc are;

  • Death

  • XP

  • Crafting

  • Anti-hacking clientonenter scritps

  • Persistant database or not

  • Debug scripts

  • Playtesting widgets -

  • DMFI

  • Spawning creatures and placeables

  • HCR systems

4. Create a base module

Nice and straight forward, you have your base systems identified, add them to your base module and get it up and running. You can spend some time optimising the systems and ensuring that the base is very stable and error free. This step is rather critical, as this base module becomes the reference module for all your builders to base their work on.

5. World Setting

Take your time and explore what you want your world setting to be and locate your references. You have a choice of writing your own from scrath, using one of the existing settings or using the setting that the nwn engine uses, which is Forgotten Realms. Writing your own is rather exhausting but rewarding at the same time, however you need to consider everthing. Using a a pre-existing setting works a treat, and you can pick and choose what you want your world to be from the parts. Finially the easiest is to use the FR setting for simplicity sake. NWN already has all the items built with FR descriptions, creatures and placeable fit the FR setting, so a large chunk of your work is done.

6. Naming Standards
To ensure consistency in your world, from scripts to areas, I would suggest that naming standards are a must. Listed below are various standards from official to what was used on the Aeon project. Use these as a basis for your own, or as is.

Script Naming Standards
Modified CODI


Placable
* T - Trigger
* D - Door
* R - Trap
* C - Conversation
* E - Encounter
* I - Item - This script is not placed on an item per se, but called by module level scripts.
* X - No Object - Use this for a script that is called by other scripts. Executable scripts.

This character is followed by a two character short for the event it goes in, by category:

* N, M
o CO - onConversation
o DI - onDisturbed
o PA - onPhysicalAttacked
o SP - onSpawn
o UD - onUserDefined
o SC - OnSpellCastAt
o BL - onBlocked
o DM - onDamaged
o HB - onHeartbeat
o DE - onDeath
o CR - onCombatRoundEnd
o PE - onPerception
o RE - onRest

* A
o EN - onEnter
o EX - onExit
o HB - onHeartbeat
o UD - onUserDefined

* O
o CE - onClientEnter
o CL - onClientLeave
o PR - onPlayerRest
o RS - onRespawn
o DY - onPlayerDying
o DE - onPlayerDeath
o LE - onPlayerLevelUp
o IA - onItemActivated
o IQ - onItemAquired
o UI - onUnaquireItem
o ML - onModuleLoad
o HB - onHeartBeat
o UD - onUserDefined
o EI - onEquipItem

* P
o US - onUsed
o HB - onHeartBeat
o DE - onDeath
o AT - onAttacked
o SC - onSpellCastAt
o DM - onDamaged
o OP - onOpen
o OC - onClosed
o DI - onDisturbed
o LO - onLocked
o UL - onUnlocked
o UD - onUserDefined

* T
o CL - onClick
o EN - onEnter
o EX - onExit
o HB - onHeartBeat
o UD - onUserDefined

* D
o AT - onAreaTransitionClick
o OC - onClosed
o DM - onDamaged
o DE - onDeath
o FO - onFailedToOpen
o HB - onHeartBeat
o LO - onLocked
o OP - onOpened
o AT - onAttacked
o SC - onSpellCastAt
o UL - onUnlocked
o UD - onUserDefined

* R
o DI - onDisarmed
o TT - onTrapTriggered

* E
o EN - onEnter
o EX - onExit
o OE - onExhausted
o HB - onHeartBeat
o UD - onUserDefined

* C
o AT - Actions Taken
o AP - Appears When (StartingConditional Script)
o AB - onConversation Aborted
o EN - onConversation end

* I
o US - Called when the item is used.
o AQ - Called when the item is Aquired.
o UA - Called when the item is UnAquired.

Prefix examples

Module OnClientEnter script prefix: OCE_
Area OnEnter script prefix: AEN_
Placeable OnUsed prefix: PUS_



Consider this post a living document, which I will add to over time.

Acknowledgements to BarryTheHatchet and Relexx