Visit the Ironworks Gaming Website Email the Webmaster Graphics Library Rules and Regulations Help Support Ironworks Forum with a Donation to Keep us Online - We rely totally on Donations from members Donation goal Meter

Ironworks Gaming Radio

Ironworks Gaming Forum

Go Back   Ironworks Gaming Forum > Ironworks Gaming Forums > Neverwinter Nights 1 & 2 Also SoU & HotU Forum
FAQ Calendar Arcade Today's Posts Search

Reply
 
Thread Tools Search this Thread
Old 11-25-2003, 02:54 PM   #1
dominions
Elminster
 

Join Date: March 20, 2001
Location: Hampshire, England
Age: 50
Posts: 428
Does anyone know why the "on heartbeat" and "on spawn" event scripts for creatures seem to work in different areas from the one the player is in? Is it due to NWN multi-player server behaviour?

The reason I ask is that I've just created the Aurak draconian for my Champion of Krynn module and I keep getting the test responses I put into that creature's scripts, even while outside the area it's in (An example is that I keep getting "Aurak uses Dimension Door (xx.x metres)").

Second question: How do you compile include files? So far I've had to save my standard Champion of Krynn scripts into a file called 'COK_ROUTINES' and compile it as a conditional script using the conversation editer.

The draw back of using this method is that you can't have a conditional script use it: it errors due two int StartConditonal() (or whatever) statements. It's the same if I save it as a main script file (two void main() statements). Another problem is that you can't have more than one homemade include file (multiple header statements, again).

Is there a downloadable INLCUDE FILE compiler that I can use or is there one built in to NWN that I've missed.

[ 11-25-2003, 02:57 PM: Message edited by: dominions ]
__________________
[img]\"http://www.shalewyn.com/Images/KrynnWhiteDragon1.gif\" alt=\" - \" /><br />\"Hah!\", thought the white dragon. \"A wand of Ice Storm will never harm me!\"<br />He never did figure out that he was in a CRPG...
dominions is offline   Reply With Quote
Old 11-25-2003, 03:10 PM   #2
SpiritWarrior
Jack Burton
 

Join Date: May 31, 2002
Location: Ireland
Posts: 5,854
Use OnPlayerPerception (?) since the Onheartbeat scripts fire every six seconds regardless of any PC's in given area.
__________________
Still I feel like a child when I look at the moon, maybe I grew up a little too soon...
SpiritWarrior is offline   Reply With Quote
Old 11-25-2003, 03:46 PM   #3
philip
Galvatron
 

Join Date: June 24, 2002
Location: aa
Posts: 2,101
Quote:
Originally posted by dominions:
Second question: How do you compile include files? So far I've had to save my standard Champion of Krynn scripts into a file called 'COK_ROUTINES' and compile it as a conditional script using the conversation editer.
What do you mean by how to compile them? I think writing the script and saving is enough. I seem to remember that it didn't work as normal scripts but you just could use the files when you saved them.

I've found it in the NWNLexicon:

Quote:
#include

This declaration is used to load any external code libraries that might be needed by a script (any other *.nss file). It needs to be placed above any code that uses the functions which will be loaded, but it is generally good practice to place #include directives at the top of a script before any code.

#include statements have only the file's name, surrounded by text qualifiers (double quote characters), without the file extension.

Since it is a compiler directive and not an actual code statement, a #include does not have a ending semicolon.

#include "NW_I0_GENERIC"

Previously compiled scripts that use the recompiled include will need to be recompiled as well before showing changes.

From the Toolset, Build > Build Module is a quick way to recompile multiple scripts in this situation.

Note: if you attempt to comment out a #include with a multiline comment ("/*" and "*/"), the compiler still attempts to include the specified file. Use the single line comment ("//") instead.
philip is offline   Reply With Quote
Old 11-25-2003, 04:26 PM   #4
dominions
Elminster
 

Join Date: March 20, 2001
Location: Hampshire, England
Age: 50
Posts: 428
Quote:
What do you mean by how to compile them? I think writing the script and saving is enough. I seem to remember that it didn't work as normal scripts but you just could use the files when you saved them.
The problem is that if I save the include file as a standard script, I can't use it in another standard script. This is because both files would have a void main() statement. This is also true if saved as a conditional script and then used in another conditional script (both would have int StartConditional()).

NWN include files do not have a void main() *or* void int StartConditional() command in them; they just end.

An example:

I create an include file called DOMINIONS and put the following in:

void DelayAttack(object oAttacker, object oAttacked, float fDelay=0.0)
{
DelayCommand(fDelay, AssignCommand(oAttacker, ActionAttack(oAttacked)));
}

void main()
{
return;
}

Then I include this file into the following file...

#include "DOMINIONS"

void main()
{
object oPC = GetFirstPC();
object oOrc = GetObjectByTag("ViciousOrc");
DelayAttack(oOrc, oPC, 2.0);
return;
}

this would result in an error as there would now be two void main() commands; one from the DOMINIONS include file and one from main program it was included into.

I have tried compiling without void main() and int StartConditional commands, but an error occurs.
I can do it with an include file that has void main() that goes into a file with int StartConditional() and vice-versa, but it means have have to have two copies of each include file (one for each header type) and it's also very sloppy.

[ 11-25-2003, 04:35 PM: Message edited by: dominions ]
__________________
[img]\"http://www.shalewyn.com/Images/KrynnWhiteDragon1.gif\" alt=\" - \" /><br />\"Hah!\", thought the white dragon. \"A wand of Ice Storm will never harm me!\"<br />He never did figure out that he was in a CRPG...
dominions is offline   Reply With Quote
Old 11-26-2003, 01:34 AM   #5
philip
Galvatron
 

Join Date: June 24, 2002
Location: aa
Posts: 2,101
the lexicon suggests to use build module to compile it
philip is offline   Reply With Quote
Old 11-27-2003, 10:24 AM   #6
dominions
Elminster
 

Join Date: March 20, 2001
Location: Hampshire, England
Age: 50
Posts: 428
I think I've figured this one out. It seems to be ok if I compile an INCLUDE file without void main() or int StartConditional(). This generates an error saying that it hasn't compiled due to no header, but in actuallity it has. this file can now be used as an include file.
__________________
[img]\"http://www.shalewyn.com/Images/KrynnWhiteDragon1.gif\" alt=\" - \" /><br />\"Hah!\", thought the white dragon. \"A wand of Ice Storm will never harm me!\"<br />He never did figure out that he was in a CRPG...
dominions is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New game what mods should i include? Julemanden Baldurs Gate II: Shadows of Amn & Throne of Bhaal 5 11-11-2004 10:07 AM
Does the expansion include... SecretMaster Neverwinter Nights 1 & 2 Also SoU & HotU Forum 2 07-03-2003 05:16 AM
Should I include a Druid in my party? Snowking Icewind Dale | Heart of Winter | Icewind Dale II Forum 16 07-02-2003 11:53 AM
Lich (might include spoilers) Voltrath Baldurs Gate II: Shadows of Amn & Throne of Bhaal 47 05-05-2003 07:43 PM
Screenshots - how do you include..??? Nutman Wizards & Warriors Forum 3 02-03-2003 03:57 PM


All times are GMT -4. The time now is 04:57 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
©2024 Ironworks Gaming & ©2024 The Great Escape Studios TM - All Rights Reserved