davidb
Senior Member
Posts: 300
|
Post by davidb on Oct 13, 2008 8:12:36 GMT -5
Thanks guys, having all your help here makes the whole thing easier.
|
|
|
Post by loudent2 on Oct 13, 2008 13:11:47 GMT -5
Heartbeats got a bad name back in 2002 when NWN first came out, the CPUs of that time along with people trying to use heartbeats to do all kinds of crazy stuff gave it a bad reputation. Yeah, I don't think it was ever the "hb" function per-se, just the way people were using them. My advice has always been: "if you can't explain why they're dangerous, don't use them". I've been moving away from HB scripts (specifically area HBs) not because they're inherently problematic, but more because I want finer control over the timer, I don't care to be locked into 6 seconds. e.g. in an area where the mobs are on a 5 minute respawn timer, do we really need to check every 6 seconds? You also can't turn off HBs (as light as they may be). Of course, the pseudo-HBs I've switched to have their own problems and their own overhead. In the end I use whichever method is best suited for the task.
|
|
davidb
Senior Member
Posts: 300
|
Post by davidb on Oct 13, 2008 19:57:39 GMT -5
Friends, I have one more question, and I am sure the mistake I am making now is pretty silly, but can't find it by myself.
I want to run my initialization script from zone Enter. The code works fine while it is in the Enter script itself, but I placed it in a separate script and I am trying to execute it like this:
void Main() { ExecuteScript("myscriptname",OBJECT_SELF); }
Yet nothing happens, and name is correct. What am I doing wrong?
I have another question. Can I put generic functions I write in another script, and then call them from another script (like with INCLUDE in C).
|
|
|
Post by loudent2 on Oct 13, 2008 20:26:38 GMT -5
Friends, I have one more question, and I am sure the mistake I am making now is pretty silly, but can't find it by myself. I want to run my initialization script from zone Enter. The code works fine while it is in the Enter script itself, but I placed it in a separate script and I am trying to execute it like this: void Main() { ExecuteScript("myscriptname",OBJECT_SELF); } Yet nothing happens, and name is correct. What am I doing wrong? Hard to say without seing the script you're calling. I don't see anything wrong here. Yes, exactly like include in 'C' (i.e. #include "scriptname" and then call functions.) Incidentally, the scripting forum on the NWN2 boards is an excellent forum for asking these sorts of questions.
|
|
davidb
Senior Member
Posts: 300
|
Post by davidb on Oct 13, 2008 20:46:23 GMT -5
Heh, you're going to laugh at this. I included my script and then it worked, now I can execute it.
|
|
|
Post by loudent2 on Oct 13, 2008 21:17:54 GMT -5
David, including the script is not necessary when executing it (and in fact should not work since both, presumably, hav a main function.
My guess is that you simply forgot to compile the "executed" script which the act of including did when you compiled the calling script.
|
|