Neverwinter Vault

Expand AllContract All -Site -My Profile -Features

Neverwinter Nights 2

-NWN2 Files -NWN2 Game Info -NWN2 Resources -NWN2 Community

Neverwinter Nights

-NWN Files -NWN Game Info -NWN Resources -NWN Community

Vault Network
RPG Vault
VN Boards
IGN Vault
Vault Wiki
· Age of Conan
· Anarchy Online
· Asheron's Call
· Dark Age of Camelot
· City of Heroes
· D&D
· EVE Online
· EverQuest
· EverQuest 2
· Final Fantasy
· Guild Wars
· Lineage 2
· Lord of the Rings Online
· Middle Earth
· Neverwinter Nights
· Pirates of the Burning Sea
· Rise of the Argonauts
· Star Wars Galaxies
· Tabula Rasa
· The Matrix Online
· The Witcher
· Titan Quest
· Two Worlds
· Vanguard
· Warhammer
· World of Warcraft

Planet Network
Planet Hub

IGN
Games
Cheats
Entertainment

The Web   The Site  



NWN SCRIPTS

- Jump to comments -
Title  Farchilde's Heartbeat Interval System V 2.0
Author  Farchilde
Submitted / Updated  07-06-2008 / 07-10-2008
Category  Scripting routines
Expansions  Works on all versions
View Code  

Select All Text | View Code in separate window
Format  Code Only
Type  Type - Other
Includes  None
Description
Ever wanted a heartbeat to run once per minute, or hour, or day, or perhaps multiple effects applied at different time intervals?

Now you can, with this updated version of my heartbeat system.

****Updated to show how it is possible to have multiple intervals in the same heartbeat, see updated code submission for details. -DO NOT- simply overwrite the old code provided, you must -still- download and import the update erf into your module, even if you downloaded this system before the update, and be sure to select all resources and overwrite them when importing.

(First time downloaders only need to download and import the update as it contains the modified extra scripts and the unmodified item blueprint and additional script).

It works by retrieving a Local Int from and item in any character's inventory (which they receive on log in), and based on that Int, firing an alternate command for the character, then resetting the "timer", as before, just with multiple "timers".

To install this system, you must set your module event scripts as follows.

*Or include them to your already existing module event scripts.

On Client Enter = far_modenter.

On Client Leave = far_modleave.

On Enter of the module's starting area (the first area the player enters on log in) = far_oocenter.

And then use the heartbeat script far_heartbeat where desired in the "On heartbeat" slot, (module, area, placable, etc).

The heartbeat script is posted below and commented, see for instructions on use.

***Note this system uses Local Ints set via an item, do to this being significantly faster then a database call. You -must- import the item into your module for this to work, and it will remain in the character's inventory. That being said, as with all heartbeats, be careful, even though you can change the time between intervals of the desired effect(S), resource intensive effects will still cause server drain.***

****DO NOT SIMPLY COPY AND PASTE THE POSTED SCRIPT OVER YOUR OWN HEARTBEAT ONE, IT IS POSTED AS A DESCRIPTION OF HOW TO ALTER THE SCRIPT, AND THAT ALONE.****

You need the download the erf and import it into your module. Alter the heartbeat script from -the script editor- from there. Without the other scripts, this system will not work.****

I know that many who do download systems from the vault are not script savvy, so any questions you may have about setting this all up, please post below. Thank you.

Once again, Enjoy. :)

*Thank you to FunkySwerve for your help on this one. ;)



Files

NameTypeSizeDownloads
Far_HB_Version2.erfFar_HB_Version2.erf
Submitted: 07-06-2008 / Last Updated: 07-10-2008
erf9.4Kb90
Farchilde's Heartbeat Interval System Version 2.0 (you must import this erf if you downloaded the old system to use the extended options, be sure to select and overwrite all resources when asked while importing).
SCORE OUT OF 10
10
2 votes
View Stats
Cast Your Vote!

PORTFOLIO
Add this entry to your portfolio so you can track it
Manage your existing portfolios or create a new one.
SCREENS

Multiple interval effect hits recorded.





You Must Be Logged In to Participate.
Comments (5):

Posted by Farchilde at 2008-07-10 07:32:24    
Oops it should read "SetLocalInt(oItem, "hb_count4",nInt); in that last bit of code.

Posted by Farchilde at 2008-07-10 01:41:16    
Also, with this system it is possible to add as many intervals as one wishes, to do so is not that difficult.

First make a new const int with a unique name such as "rInt" in the line directly under the other ones. And with a new numeric interval.

So this...

const int iInt = 10;//the first interval fires 1/minute----//
const int oInt = 600;//the second 1/hour-------------------//
const int aInt = 14400;//the third 1/day (24 hours)--------//

Becomes this...

const int iInt = 10;//the first interval fires 1/minute----//
const int oInt = 600;//the second 1/hour-------------------//
const int aInt = 14400;//the third 1/day (24 hours)--------//
const int rInt = 28800;//the third 1/2 days (48 hours)--------//

Then in the line directly above "oPC = GetNextPC():"

Add this code...

if (GetLocalInt(oItem, "hb_count4")== rInt)
{
//--------------------"1/2 days effect"--------------------//
SetLocalInt(oItem, "hb_count4", 0);
}
else if (GetLocalInt(oItem, "hb_count4")!= rInt)
{
int nInt;
nInt = GetLocalInt(oItem, "hb_count4");
nInt += 1;
SetLocalInt(oItem, "hb_count3", nInt);
}

And so forth, just to give you an idea of how flexible and versatile this system may be.

Enjoy. :)

Posted by Graymaster at 2008-07-08 07:16:59    Voted 10.00 on 07/08/08
Excellent piece of work and extremely well explained and documented. Thanks much for sharing.

Posted by Farchilde at 2008-07-07 17:25:39    
Thank you, and thank you for the vote. :)

Posted by rawn_phoenix at 2008-07-07 05:15:16    Voted 10.00 on 07/07/08
This is a great addition, thanks for giving this to the Community.

You must be Logged In to post comments in this section.

 
Most recent posts on the MMO General Boards
Analyst: Star Wars: The Old Republic Could...Analyst: Star Wars: The Old Republic Could Sell 3M: more numbers
- last reply by Acao on Aug 15, 2011 06:15 PM
which class will your first character be
- last reply by Blisteringballs on Aug 15, 2011 05:50 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 05:00 PM
New Community Content!
- posted by Vault_News on Aug 15, 2011 04:00 PM
NWN Idea Database Update
- posted by Vault_News on Aug 15, 2011 03:46 PM
Missing Votes for NWN2 Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:40 PM
Missing Votes for NWN Hall of Fame
- posted by Vault_News on Aug 15, 2011 03:39 PM
Random Questions and game altering suggest...Random Questions and game altering suggestions!!!
- last reply by ArkadyTepes on Aug 15, 2011 03:22 PM
State of the game?
- last reply by LyricOpera on Aug 15, 2011 01:37 PM
Yesterday streaming, now demanding downloa...Yesterday streaming, now demanding download :(
- last reply by Sinane-tk on Aug 15, 2011 10:23 AM
 

   


IGN Entertainment
By continuing past this page, and by your continued use of this site, you agree to be bound by and abide by the User Agreement.
Copyright 1996-2011, IGN Entertainment, Inc. | Support | Privacy Policy | User Agreement | RSS Feeds
IGN’s enterprise databases running Oracle, SQL and MySQL are professionally monitored and managed by Pythian Remote DBA.


NWN2 Hall of Fame

HOF NWN2 Plug-Ins


View all Hall of Fame entries


Neverwinter Nights 2

TOP NWN2 Modules

NEW Modules

NEW Reviews

NEW INTL. Modules

TOP Hakpaks

TOP Gameworlds

TOP Tutorials

TOP Prefab:Areas

TOP Blueprints

TOP Plugins

TOP UI

TOP Other

TOP Visual Effects

TOP Scripts

TOP Tools

TOP Movies

TOP Models

TOP Characters





Hall of Fame

HOF NWN Modules


View all Hall of Fame entries


TOP NWN Modules

NEW NWN Modules

NEW Reviews

TOP Intl. Modules

TOP NWN Hakpaks

TOP NWN Gameworlds

TOP NWN Models

TOP NWN Portraits

TOP NWN Scripts

TOP NWN Prefabs

TOP NWN Other

TOP NWN Movies

TOP Sounds

TOP NWN Textures

TOP NWN Creatures

TOP NWN Characters