Author Topic: two old classics  (Read 355 times)

Legacy_kuronue bloodlust

  • Full Member
  • ***
  • Posts: 217
  • Karma: +0/-0
two old classics
« on: May 23, 2014, 10:37:10 pm »


               

I am not sure if players chose to remember this wonderful world but I happen to remember it well for one thing it did that I have yet to see repeated and frankly I want to be that person. it used mostly generic NWN scripts allowing the server to run with little to no lag what so ever.


 


First off they used two scripts (I know this because there are two bare min ways to do this and that's resting the items and NPCs)


 


anyhow I tried doing it with the generator but the darn thing has a bit of a small problem.... and it revels why most modern scripts are big and bulky.


 


What I need is just the flowing.


 


object re-sets itself after a time delay the object being a peaceable, way-point (like a player store), or actual area. I am aware this means I need to have a blueprint reference in some cases and I am ok with that.


 


there already is a generic NPC spawn script in the NWN database I can alter to get my non players re spawning in areas where I do not have encounters but for treasures and stores A RESET script would be great I can't seem to track down any in vault that meet my requirements. I looked thought the database but I can't seem to find one there eater.


 


Yes I looked into the popular clean script font let me started on what a mess it is trying to find what you need, again due to lack of appropriate script notes. not to mention the noted complexity of said script is way  to much I'm looking for something that will run low and fast so I have more room for the players.



               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
two old classics
« Reply #1 on: May 23, 2014, 11:50:49 pm »


               I've got no idea about where to suggest looking, other than to recommend you download the BioSearcher utility to help look though the Base scripts.


I think delay timers are fairly simple, or a least time stamping the spawning object and the re-checking on player enter to see if it should fire again.


Also, Have a look at the NESS system for ideas about how to do the spawning.  It's anything but lean and mean, plus it does a lot more than what you're looking for, but the idea behind the flags and waypoints is something you may want to consider.


Lastly, don't worry about lag. Today, you can host loads of people with mediocre systems and tons of resources.  I would recommend building the systems 'you' want for your players, rather than feel limited to what the base campaign offers.  Don't constrain your thinking to efficiency. Implement your idea and then make 'that' as efficient as possible.
               
               

               
            

Legacy_kuronue bloodlust

  • Full Member
  • ***
  • Posts: 217
  • Karma: +0/-0
two old classics
« Reply #2 on: May 24, 2014, 12:12:07 am »


               


I've got no idea about where to suggest looking, other than to recommend you download the BioSearcher utility to help look though the Base scripts.


I think delay timers are fairly simple, or a least time stamping the spawning object and the re-checking on player enter to see if it should fire again.


Also, Have a look at the NESS system for ideas about how to do the spawning. It's anything but lean and mean, plus it does a lot more than what you're looking for, but the idea behind the flags and waypoints is something you may want to consider.


Lastly, don't worry about lag. Today, you can host loads of people with mediocre systems and tons of resources. I would recommend building the systems 'you' want for your players, rather than feel limited to what the base campaign offers. Don't constrain your thinking to efficiency. Implement your idea and then make 'that' as efficient as possible.




 


Yes the delay timer is a easy to figure out thing however my problem is I am trying to get the shops to reset themselves after a period of time has passed since their last use.


 


NESS I think I saw it somewhere when goggling it but the link was broken. sadly I'm running on a dinosaur of a laptop and when I do my comic stuff and monitor the server I don't want to be lagging the players.


 


as I said my problem is I can't get the stores to reset themselves and I know there is a way to do it without bothering a player. I prefer bare min scripting anyhow somehow it just makes more since.


               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
two old classics
« Reply #3 on: May 25, 2014, 12:09:29 am »


               

Have you looked this over?


 


FP!



               
               

               
            

Legacy_kuronue bloodlust

  • Full Member
  • ***
  • Posts: 217
  • Karma: +0/-0
two old classics
« Reply #4 on: May 25, 2014, 04:00:40 am »


               


Have you looked this over?


 


FP!




How did you find that? I was looking through any tag that could possibly bring that up; UGH see the new vault is a mess that never came up with me and I did literally search everything I could think of including some weird ones (how i found the door re-spawn and container re-spawn which I though was odd because they have nothing to do with renewing shops )


 


the original idea thou was to have the store itself clear player input items Gems,crafting components, traps, exc since I do plain to have a semi drop heavy server where crafting components are concerned I still have to get some of the other  working. This is prefect now to import it and adjust the time accordingly. something I need to fix with the area reset script and possibly the re spawn scripts for the doors.


 


Added note: I tried using a script generator but most of the script generators are PLAYER or oPC target script writers assuming a player script based server is the only one needed. they often forget NPC and Placeables, other than forges thins players can also interact with on a high basis and things most important for dungeon puzzles.


 


for example what if I need container placeables that when destroyed will drop high medium or small lootbags and possibly a crafting component while at the same time re spawning after a time delay? running with just player scripts will not help me because it has the wrong target type and is a different command type. just thought i would point that out next time someone says -USE THIS SCRIPT GENERATOR-


               
               

               
            

Legacy_Fester Pot

  • Hero Member
  • *****
  • Posts: 1698
  • Karma: +0/-0
two old classics
« Reply #5 on: May 28, 2014, 02:22:39 pm »


               

I found it via the advanced search on the Vault for scripts, by typing in the word store. 211 matches of scripts came up in the scripting category for store, then I read each description until I found what matched something similar to your criteria.


 


The New Vault doesn't have everything the Old Vault does. It is still in migration, although everything from the Old Vault has been captured and stored elsewhere, as far as I know. Getting the New Vault up to the content the Old Vault has will take time.


 


A simple door respawn script.


 


The script generator is a quick way for anyone to make a module with simplistic designs behind it, and make it easier to ease someone who is intimidated by creating their own scripts. I started using it myself when I fiddled with making a module, and it's a great way to learn how scripts work, since you're generating it by your own choices. Then you can visually examine the script and try and pin-point your choices the script wrote.


 


As for your example regarding loot drops, there are a few systems on the Old Vault already.


 


Here is one I came across.


 


This one might work for you as well?


 


FP!


               
               

               
            

Legacy_BelowTheBelt

  • Hero Member
  • *****
  • Posts: 699
  • Karma: +0/-0
two old classics
« Reply #6 on: May 28, 2014, 03:05:33 pm »


               

By 'store reset', do you mean that you want the store to revert to its default inventory after use, so it does not retain any items sold by the players?


 


Here's what I do:


 


In the OnAcquire module event, add this line:


SetLocalInt(oItem, "PCOwned");


 


Then, the way I approach clearing the store is that OnAreaExit, I loop through objects in the area as part of my area cleaner script.  If a store is found, it loops through all the items in the store, looking for the "PCOwned" integer.  If found, I destroyed the object.  This destroys all player-sold items in the store's inventory.


 


Note that this doesn't run on the closing of the store immediately after the transaction, but rather when the PC exits the area.  So, there's a window of time between the sale and the exit of the area, when the item is in the inventory, potentially available for sale to another player.  That's not an issue or concern in my server for various reasons, but something for you to consider as to whether or not it is an issue for your idea.


 


If you are looking to add a delay timer to the clearing of stores, you're probably getting into the need for some kind of timestamp on the module heartbeat event with a simple script that evaluates the timestamp against some predetermined time that if triggered, searches for stores in your module and clears all of their inventories.



               
               

               
            

Baaleos

  • Administrator
  • Hero Member
  • *****
  • Posts: 1916
  • Karma: +0/-0
two old classics
« Reply #7 on: April 14, 2015, 04:37:03 pm »


               

I do the same thing to clear out stores


I also go a step further for loot bags.


 


object oBag = GetObjectByTag("bodybag") ;// not sure if its capitals or not
// **
//  Handle them here
// **

 


What I do is basically loop through all bags in the module - and check to see if they have been 'processed' yet.


If not : set the processed variable to 1


if processed : skip


 


If a player is in the area with that bodybag : repeat this check every 30 seconds, or until the bodybag is gone


if a player is not in the area and the bodybag still exists: delete inventory, destroy bag


 


 


Assigning the commands to the module or area would likely be equal in performance value : since only one script can run at any one time anyway.


I would probably avoid assigning the check to the bodybag itself 


as this could end up with quite alot of pending commands in the queue : not sure what ramifications that might have - if any.


 


Result is basically that areas will clean themselves of bodybags when the area is empty.


The times can be customized to give the players a chance to come back for the loot.


 


Just put this in the onModHeartbeat event : note - this is just pseudocode - you will need to build the logic


               
               

               
            

Legacy_Lightfoot8

  • Hero Member
  • *****
  • Posts: 4797
  • Karma: +0/-0
two old classics
« Reply #8 on: April 14, 2015, 09:37:20 pm »


               

If you want to reset a store to the original content,  why not just destroy the store and create a new one in its place?   Assuming that you have a blueprint of the original store.