Just wondering...

This forum is for those interested in discussing NWN scripting.

Moderators: DM_eaze, Luceran, DM_Jaydaan, ST_DM_Myle, dm_xeen1, DM Nexus, DM_TrainWrek, Carpe_DM1, DM_Unicorn, DM_Griphon, DM_Shadowlands, dm_zane, DM_Centaur, DM_Mystic, DM Rendyll, DM_Avalon

Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Just wondering...

Post by Mer`Zikain »

I've been working on my own mod irregularly for a few weeks and was curious about some of the things you have in BSK.

First, did you make your own treasure drop script? I think it's pretty slick and didn't know if it was custom or if you found something and modified it.

Same with the mystic forge. Seen several "forges" on nwvault but I'm wondering if yours is on there.

I saw (and am using) your town portal script, nice stuff. Do you plan to release any other scripts like that? I haven't been scripting much of my own stuff yet so I'm hesitant to mess with the portal scripts to make a portal book or marker stone in BSK.

I'm sure there are plenty of others out there who want you to give up your code for everything. I'm not asking for code but I would like to know what methods you used for those things so I can try to do it too. And no, I'm not trying to make a ripoff version of BSK, those things are just really nice and would make wonderful additions to my own mod.

I've been pondering making a "mage school" in mine that mage characters of lower levels can go and "learn" from books. Basically for every so many books they read they get a certain amount of xp. Additionally I'm thinking of storing "read" tokens that can be used to "learn" new spells. Higher level spells would be in rare books that would come from quests and such.

Of course all of this sounds great in theory but is beyond me right now so I figured I'd start on something less ambitious and work toward it.

Aaaaaanyway, I've been wondering about your scripts (treasure, transport, and forge) for a while now and figured I'd ask about 'em. I've got some questions about other things non-script related I'll ask elsewhere.

Thanks for your time :D (in reading this and in making BSK)
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Well so far I've already answered one of my own questions through experimentation. The only problem I have now is the nifty sound effect when the item is dropped. I can't find a list of sound effects to save my life T_T
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Re: Just wondering...

Post by driller »

Yes I made my own drop scripts. My forge is not on the vault. No plans to release any scripts.

-driller
Mer`Zikain wrote:I've been working on my own mod irregularly for a few weeks and was curious about some of the things you have in BSK.

First, did you make your own treasure drop script? I think it's pretty slick and didn't know if it was custom or if you found something and modified it.

Same with the mystic forge. Seen several "forges" on nwvault but I'm wondering if yours is on there.

I saw (and am using) your town portal script, nice stuff. Do you plan to release any other scripts like that? I haven't been scripting much of my own stuff yet so I'm hesitant to mess with the portal scripts to make a portal book or marker stone in BSK.

I'm sure there are plenty of others out there who want you to give up your code for everything. I'm not asking for code but I would like to know what methods you used for those things so I can try to do it too. And no, I'm not trying to make a ripoff version of BSK, those things are just really nice and would make wonderful additions to my own mod.

I've been pondering making a "mage school" in mine that mage characters of lower levels can go and "learn" from books. Basically for every so many books they read they get a certain amount of xp. Additionally I'm thinking of storing "read" tokens that can be used to "learn" new spells. Higher level spells would be in rare books that would come from quests and such.

Of course all of this sounds great in theory but is beyond me right now so I figured I'd start on something less ambitious and work toward it.

Aaaaaanyway, I've been wondering about your scripts (treasure, transport, and forge) for a while now and figured I'd ask about 'em. I've got some questions about other things non-script related I'll ask elsewhere.

Thanks for your time :D (in reading this and in making BSK)
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Yeah I kinda figured as much, never hurts to ask ^_^

nwnlexicon.com has helped a lot but it needs a user comments section and more detail. More often than not it's not really necessary but there are a few cases where a description they have could use a little more detail to help understand exactly what to use them for.

I've been trying to find a trigger for when an object is examined. So far all I've found is a function that makes a player examine an item. Don't really need that, just need to do something when they examine it.

I'm probably going to have to just setup a unique power on the spell books instead.

And it seems I spoke too soon in my other post, finally found a list of sound effects. It didn't save my life but it made it easier ;)

Now the only problem I have is info storage for what books a character has read. My first thought is to store tokens, though I'm not sure whether I should use custom or plot tokens. I'm thinking custom but everything I read talks about conversation use instead of further script use.

The idea is when the player uses a book, the book id is stored and a check is made to see if any of the stored books meet the required "reading" needed to produce a scroll of the spell associated with those books (or just add the spell to their list if that's possible).

Any thoughts?
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

There isn't an on examine event. You could either use Bioware's persistent campaign functions or store local variables on a no drop item.

-driller
Mer`Zikain wrote:Yeah I kinda figured as much, never hurts to ask ^_^

nwnlexicon.com has helped a lot but it needs a user comments section and more detail. More often than not it's not really necessary but there are a few cases where a description they have could use a little more detail to help understand exactly what to use them for.

I've been trying to find a trigger for when an object is examined. So far all I've found is a function that makes a player examine an item. Don't really need that, just need to do something when they examine it.

I'm probably going to have to just setup a unique power on the spell books instead.

And it seems I spoke too soon in my other post, finally found a list of sound effects. It didn't save my life but it made it easier ;)

Now the only problem I have is info storage for what books a character has read. My first thought is to store tokens, though I'm not sure whether I should use custom or plot tokens. I'm thinking custom but everything I read talks about conversation use instead of further script use.

The idea is when the player uses a book, the book id is stored and a check is made to see if any of the stored books meet the required "reading" needed to produce a scroll of the spell associated with those books (or just add the spell to their list if that's possible).

Any thoughts?
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

UGH!!! >_<

I can't seem to get any information out of any of my 2da files. Made sure the columns weren't separated by tabs so that's not the problem. I have no clue what is going wrong, any suggestions? T_T

Oh and there are no spaces (using underscores). It's beyond me. If I change the file and column names to a different 2da it works fine. >_<

Frustrating T_T
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Ok, wow, talk about unintuitive. I didn't know it had to be in the servervault folder. All of the others are in source so I assumed it needed to be there too. Looked at the description of the Get2DAString function and it said something about getting a string from a 2da file from the server and I figured I'd put it in the servervault just to see what happens.

Again, what the crap? -_-;

Is there some kind of resource that explains things like this so I don't get stuck for hours on something stupid like that again?
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Which would be better, a collection of 2da files or nwnx and mysql?

The problem I have with the latter is the seeming complete lack of documentation (or at least detailed docs) for using it.

My concern with the 2da files is the size and functionality. Right now I have a 2da that keeps a count of the rows in my other 2da files for generating a random number to grab a random row from one of my other 2da files. My others are listed as file_X.2da and contain specific item info.

Basically what I'm thinking is when a random treasure needs to be generated, I'll pick which 2da file (each having a different set of items to choose from; from basic to magical variants) to grab an item from, get the max number of rows from the row count 2da for the selected item 2da and then randomly grab an item from the file to create.

I could then add more items to the 2da's or more 2da's as needed to extend my treasure system.

But I'm very familiar with the workings of mysql (I use it for web dev and my online games) so hearing about nwnx and it's mysql support I find myself wanting to use it instead. But I can't find any good information on HOW to utilize them.

Also I've been toying with this idea for deciding when to drop treasure.

I'm thinking of making it so that higher level characters get more treasure than low levels. To do this I'm thinking of having a base chance of like 9% and then adding the character level; They'd end up with a 50% chance max. And taking a page from your book I'm limiting it to a range of CR based on character level.

Any thoughts/suggestions on any of that?
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Take a good look at this script: x0_i0_treasure.

-driller
Mer`Zikain wrote:Which would be better, a collection of 2da files or nwnx and mysql?

The problem I have with the latter is the seeming complete lack of documentation (or at least detailed docs) for using it.

My concern with the 2da files is the size and functionality. Right now I have a 2da that keeps a count of the rows in my other 2da files for generating a random number to grab a random row from one of my other 2da files. My others are listed as file_X.2da and contain specific item info.

Basically what I'm thinking is when a random treasure needs to be generated, I'll pick which 2da file (each having a different set of items to choose from; from basic to magical variants) to grab an item from, get the max number of rows from the row count 2da for the selected item 2da and then randomly grab an item from the file to create.

I could then add more items to the 2da's or more 2da's as needed to extend my treasure system.

But I'm very familiar with the workings of mysql (I use it for web dev and my online games) so hearing about nwnx and it's mysql support I find myself wanting to use it instead. But I can't find any good information on HOW to utilize them.

Also I've been toying with this idea for deciding when to drop treasure.

I'm thinking of making it so that higher level characters get more treasure than low levels. To do this I'm thinking of having a base chance of like 9% and then adding the character level; They'd end up with a 50% chance max. And taking a page from your book I'm limiting it to a range of CR based on character level.

Any thoughts/suggestions on any of that?
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

The one problem I'm having most is creatures leaving behind remains.

How do you get them to stop that entirely? I'd rather if they dropped something that it appear instantly instead of having to wait around for the corpse to decay and the remains to appear. Plus sometimes the remains don't disappear after you've taken what was inside the container.

Just seems that it would add up to a bunch of junk on the server possibly causing a crash that I'd rather avoid.

How did you handle this on BSK?

Also, are you using a modified version of the script you told me to look over or something completely custom? I love the seamless treasure drops that the majority of your monsters have. It seems rather efficient to me which is why I'm desperately trying to figure out how you did it ^^;
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Another couple of questions for ya. ^^;

How are you getting the text triggers to work, like the password for the thieves guild? I've been looking through the function list and I must keep overlooking whatever it is that takes what the player says and checks it against acceptable text. I'm assuming that it's a trigger with an onHeartBeat script that does the checking but the actual mechanics of how it's checking the text is escaping me.

Also, what are you using for the creature spawns? I thought maybe it was just a server based function that spawns creatures seemingly randomly and respawns them after a few minutes. But after testing my mod I find that's not the case (at least for me) and I can't find any options in the serverlet to change that.

So now I'm looking at the zombie respawn point and modifying it to spawn different creatures. Not sure if I'm wasting my time or on the right track though ^^;
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

If you do not want the mobs to run the default treasure scripts.

Set this on module load:
SetModuleSwitch(MODULE_SWITCH_NO_RANDOM_MONSTER_LOOT,TRUE);

You will also need to put in this include file: #include "x2_inc_switches"

There are several different ways to cleanup remains.

Heartbeat: Get each item in the area and increment a variable on it until you reach a predetermined number, then destroy it.

On area exit: Check to see if there are any players in the area, if not get all items in the area and destroy them.

On item drop: When an item drops, start a countdown to destroy it, after x amount of seconds, if the item is still in the same location as it was when it was dropped, destroy it.

The one that uses the less CPU would be on area exit.

-driller

Mer`Zikain wrote:The one problem I'm having most is creatures leaving behind remains.

How do you get them to stop that entirely? I'd rather if they dropped something that it appear instantly instead of having to wait around for the corpse to decay and the remains to appear. Plus sometimes the remains don't disappear after you've taken what was inside the container.

Just seems that it would add up to a bunch of junk on the server possibly causing a crash that I'd rather avoid.

How did you handle this on BSK?

Also, are you using a modified version of the script you told me to look over or something completely custom? I love the seamless treasure drops that the majority of your monsters have. It seems rather efficient to me which is why I'm desperately trying to figure out how you did it ^^;
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

Download this module: http://nwvault.ign.com/View.php?view=Mo ... ail&id=293 , it is a good place to look and see how to do listen capture. You have to actually type in words to talk to the NPCs just like the old Ultima games.

BSK used to be like this to, but most players didn't have a clue on how to use it. That's why one of the sayings is never speak the demon's name.

If you typed in Shalnath, random bad stuff would happen to your character.


I used to use this for mob spawns until I wrote my own.
http://www.subnatural.de/nabo/mmorpg_spawner_1.1.zip

-driller
Mer`Zikain wrote:Another couple of questions for ya. ^^;

How are you getting the text triggers to work, like the password for the thieves guild? I've been looking through the function list and I must keep overlooking whatever it is that takes what the player says and checks it against acceptable text. I'm assuming that it's a trigger with an onHeartBeat script that does the checking but the actual mechanics of how it's checking the text is escaping me.

Also, what are you using for the creature spawns? I thought maybe it was just a server based function that spawns creatures seemingly randomly and respawns them after a few minutes. But after testing my mod I find that's not the case (at least for me) and I can't find any options in the serverlet to change that.

So now I'm looking at the zombie respawn point and modifying it to spawn different creatures. Not sure if I'm wasting my time or on the right track though ^^;
Mer`Zikain
Count
Count
Posts: 105
Joined: Thu May 31, 2007 2:09 pm

Post by Mer`Zikain »

Awesome, all of that helps me out a bunch. Thanks a million :D

Only one problem though.
driller wrote:I used to use this for mob spawns until I wrote my own.
http://www.subnatural.de/nabo/mmorpg_spawner_1.1.zip
That link comes up with a german 404. I did a search on just the file name and found a discussion about mob spawning. It had a link to the same file but did give me some ideas. Haven't used them yet as I've been working on the other things, but I did do a search for mob spawning on the nwvault and found several scripts, but I'm not sure if any of them are going to be what I want.

*shakes fist at sites that disappear* heh

I don't suppose there is any way I could get you to give me a copy of what you use for your mobs? ^^;

I'm just full of requests and questions, heh. Thanks again for all of your patience and help!
User avatar
driller
Site Admin
Site Admin
Posts: 4792
Joined: Tue Jul 04, 2006 8:52 am
Contact:

Post by driller »

http://www.blackstonekeep.com/mmorpg_spawner_1.1.zip

-driller
Mer`Zikain wrote:Awesome, all of that helps me out a bunch. Thanks a million :D

Only one problem though.
driller wrote:I used to use this for mob spawns until I wrote my own.
http://www.subnatural.de/nabo/mmorpg_spawner_1.1.zip
That link comes up with a german 404. I did a search on just the file name and found a discussion about mob spawning. It had a link to the same file but did give me some ideas. Haven't used them yet as I've been working on the other things, but I did do a search for mob spawning on the nwvault and found several scripts, but I'm not sure if any of them are going to be what I want.

*shakes fist at sites that disappear* heh

I don't suppose there is any way I could get you to give me a copy of what you use for your mobs? ^^;

I'm just full of requests and questions, heh. Thanks again for all of your patience and help!
Locked