Aller au contenu

Photo

Need Two Persistence Functions


  • Veuillez vous connecter pour répondre
35 réponses à ce sujet

#26
Shadooow

Shadooow
  • Members
  • 4 468 messages

Pstemarie wrote...

Yeah, I spoke to soon - not bad stuff, but I've come to the conclusion that the horse system is much more complex - and buggy - than it needs to be. One more thing to rewrite from the ground up for my module...

P.S. I purged horses completely for the time being and wouldn't yanno it - everything (admittedly not much at this point) works so far as it should ^_^

I mean, The Krit's work on this is not bad, there is no reason why not use it if the module has horses inside. It cant make things worse than they already are B). I've considered to add this into my pet project but since this is total rewrite I shouldnt take it without permission (its not something like 1line fix that anyone can do based on the knowledge) which I haven't got - The Krit and me aren't big friends.

I was using skin long time without issues, but then since Ive toggled ILR on, I switched to MySQL - also because of safety reasons. Lets say, that player loses the skin, either due to the exploit or bug - now all the info like craft skill rank, monster kills will be gone completely...

However, I created a slighly more efficient solution using new table (player, name, value) and more reliable player identifier - player's tag which holds ID on my server.

Modifié par ShaDoOoW, 09 août 2012 - 09:34 .


#27
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages

eeriegeek wrote...

 ...Stackables have known issues with losing information if they get re-stacked....


Just to expand the explaination on why stacked items can lose locals. 

A Stack of items is a single instance in the game.  Reguardless of wether it is a stack of one item or a stack of 100 items it is a single instance.   When a stack of items is split, A new instance is created and all locals are intact.   The porblem ocures when the items get added to a stack.   When a item gets added to a stack it simply gets destroyed with it stack count getting added to the other instance of the item.   


Say we have a stack of arrows and split them in half.   Stack 1 and stack 2.   If we added a local to stack 2 and then added the stack back to stack 1. stack one would not have the local because it got destroyed along with stack 2.  if however, stack 1 was added to stack 2, the local would still exsist.   basicly adding the local to every item in the stack.  ( Really there is just one instance of the item with a stack count for how many items there are. ) 

 

#28
ffbj

ffbj
  • Members
  • 593 messages
Yeah I think the item database is the way to go, as I have been using that for years with no problems.  Keeps track of location, curses, contracts, things of that nature.
For horses I devised my own method which is essentially a short cut.  You can buy items that call particular types of horses, normal horse, war horse, or special horses, like a nightmare.  In this way you can have different mounts if you qualify to use them based on the restrictions on the item. Level, class, alighnment, etc...
I made a rather poor demo of the method and someone posted it up on You Tube.
  

I've made some improvements to the horse method since then.  For instance you don't have to dismiss your horse if it died, you you have an Inn or another designated area, where the variable on your horse item is reset and you can call another horse.  I could delineating the method, which is mainly a convenience to the player, and fewer headaches for DM's, but there's not much point unless people want to use it.  The feedback I have gotten though has been all positive.  I know what is meant the horse scripts being a bit convoluted.  I probably spent a month or so trying to get it all working, with various condtional sitiuations, that must be addressed. 
 

#29
henesua

henesua
  • Members
  • 3 863 messages
I'm going to have to look into the difference between the PCSkin and any other item in the inventory. There shouldn't be any difference. They are both items. The advantage of the skin is that it doesn't show up in the inventory. I dislike seeing widgets and data objects in inventory - even "invisible" ones. Life has enough clutter.

I am using Krits improvements to PC Skin. Perhaps that is why I have practically no issues. I'll look into it further when I get time, and post a bug free solution.

Anyway, good luck to you in this, Pstemarie. Solving the data side of things can be tricky. Especially when you are doing session based play like I believe you are. Its actually fairly complex when compared to a PW. My solution was to carve up the data into pieces.

I use the DB for somethings related to the story arc. Another DB for character specific things that transcend story arc. And variables set on the skin in case the same character is going to be played on a similar module but different computer - which may not have the DB moved along with it. Tricky stuff. I still don't believe my system really works. But its better for me than NWNX would have been. I wouldn't want to train any other person who would host my module on how to set up NWNX etc....

#30
ShadowM

ShadowM
  • Members
  • 768 messages
Just some info. with inventory items for saving information to the item, it must be inside a bag. This is if you going to export the local vault character like for a single player game over multiple modules. Skin are better for server vault games IMO. Just make sure that the scripts/setting are not destroying the skin and creating a new one. I have also found that some data(if you referring to it in a conversation will not update until the skin is un-equipped and re-equipped) My HR base is set for both if you need something to look over Pstemarie

#31
Carcerian

Carcerian
  • Members
  • 1 108 messages
(slightly off-topic)

if it's any help, here's my PW "combo-tag" script for horse summons: __hi_ho_silver__.nss

(tag based scripting required, first 16 letters = script name, 17+ = resref data)

//__hi_ho_silver__.nss

#include "x2_inc_switches"
#include "x3_inc_horse"

void main()
{

if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
object oUser = GetItemActivator();
if (HorseGetIsMounted(oUser)) return;
object oItem = GetItemActivated();
string sTag = GetTag(oItem);
string sResRef = GetSubString(sTag,16,GetStringLength(sTag)-16);
object oHorse = HorseGetHorse(oUser);
if (oHorse == OBJECT_INVALID) oHorse = GetLocalObject(oUser,"STEED");
DestroyObject(oHorse);
oHorse = HorseCreateHorse(sResRef,GetLocation(GetItemActivator()),oUser);
SetLocalObject(oUser,"STEED", oHorse);

}


example tag: __hi_ho_silver__cep_black_horse

Modifié par Carcerian, 10 août 2012 - 04:18 .


#32
Lightfoot8

Lightfoot8
  • Members
  • 2 535 messages
[quote]Carcerian wrote...

(slightly off-topic)

[quote]


Hek, the entire thread is off topic from the original post.  
An Edit of the title would not hurt for others finding this info with a fourn search.
Posted Image

#33
Carcerian

Carcerian
  • Members
  • 1 108 messages
Any thread that spawns new ideas or examples is epic in my book...

(Personal Goal: learn something new everyday!)

:wizard:

Modifié par Carcerian, 10 août 2012 - 04:21 .


#34
Carcerian

Carcerian
  • Members
  • 1 108 messages
To get back on topic, a read/write to pc_hide/inventory set of DB function scripts would be a great post for sure :)

#35
henesua

henesua
  • Members
  • 3 863 messages
 I looked again at the krit's version of x3_pc_skin and see no problem with it. On the vault it is called Remove PC Properties

#36
Pstemarie

Pstemarie
  • Members
  • 2 745 messages

henesua wrote...

 I looked again at the krit's version of x3_pc_skin and see no problem with it. On the vault it is called Remove PC Properties


I've gone back to this system, now that I understand what I did wrong when merging my module events with the Krits. Working much smoother now.