Server Totals
Visimontium - (1)
Mikona - (1)
Ferrell - (0)
Le'Or - (0)
Elysia - (0)
M'Chek - (0)
Deglos - (0)
Wilderness - (0)
Underdark - (0)
Total players: 2
Gallery
  • Elysia updates
    Album name: DM Events
    Uploaded by: Ronan
    Uploaded: Fri Jun 05, 2015 3:13 am

Links Menu

Automatic refilling of containers.

Moderators: Nighthawk4, Dungeon Masters

Automatic refilling of containers.

PostAuthor: jarkari » Wed Jul 14, 2004 6:09 pm

I'm wondering if someone could give me an idea of how to make chests/flowers/trees etc, automatically refill, just like Avlis does, with their wheat/appletrees etc. Any help would be great.

Thank you.

jarkari
Newbie
 
Posts: 3
Joined: Sat Jul 03, 2004 4:29 am

PostAuthor: dougnoel » Wed Jul 14, 2004 6:28 pm

Are you trying to just refill the placeable immediately after something is "picked", or are you trying to implement a time-delay?

dougnoel
Team Member; Retired with Honors
 
Posts: 6265
Joined: Fri May 14, 2004 4:59 pm
Location: VA (GMT -4)

PostAuthor: jarkari » Wed Jul 14, 2004 8:19 pm

I'd like to do a time delay. I was thinking I could make a table mysql database side, if someone removed something from the container, I could put a row into said table, with a timestamp. Then everytime someone opens the container I could check that timestamp to see if enough time had gone buy and I should restock the item. Kind of complicated and I was hoping there was an easier way.

Thanks.

jarkari
Newbie
 
Posts: 3
Joined: Sat Jul 03, 2004 4:29 am

PostAuthor: Alustriel » Thu Jul 15, 2004 6:30 am

A simple solution without using the database and interfering current database generating scripts is the use of local integers, setting and delay deleting them.

For standard containers, like bioware barrels, chests etc, just add this line before the ShoutDisturbed line in the onopen script (e.g. nw_o2_classlow), for other treasure generating object probably something silmilar will do the trick:

DelayCommand(500.0, DeleteLocalInt(OBJECT_SELF, "NW_DO_ONCE"));

This will remove the local integer on the chest after 500 seconds and the chest will generate loot again once it is opened again.

Alustriel
Apprentice Scholar
 
Posts: 854
Joined: Mon Apr 07, 2003 12:08 pm
Location: GMT+1/+2 dst


Return to NWN Scripting

Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]