PDA

View Full Version : NWNNSSCOMP & Spawn Scripts


Darth InSidious
09-14-2005, 10:01 AM
The only version of nwnnsscomp I can get to work is one with a "compileall" .bat with it. Any other versions open and close instantly, and this one isn't able to handle all the doohickeys in K2's scripts. Edith: I'm an idiot. Is there a version which will work properly with XP, and will be able to support the K2 scripting functions?

Also, for some reason, when I attach spawn scripts to dialogues, they almost never fire.

Finally, could someone tell me how to ensure something has saved as 32 bits?

Thanks,
Insidious

Fred Tetra
09-14-2005, 10:32 AM
There's an excelllent thread on this (How to compile scripts?) right up in the stickies:

http://www.lucasforums.com/showthread.php?t=143681

Nwnnsscomp is not a GUI-based application; it's run from a command line. If you want a GUI, use the Project Manager in Kotor Tool.

Darth InSidious
09-14-2005, 11:43 AM
Thanks :)
I'll see if this works....

Darth InSidious
09-14-2005, 01:19 PM
Hmmm........nope....nwnnsscomp still refuses to work...???

Fred Tetra
09-15-2005, 12:02 AM
We're really going to need more info, such as your workflow, to help you out :)

Darth InSidious
09-15-2005, 05:03 AM
OK, sorry. I was trying to compile the scripts stoffe used in the puppet-making tut, and also a couple of scripts of FPs made using the script creator by jmac, but neither would compile properly...I don't however have the scripts to hand at the moment, I'll get them ASAP, thx for all the help!

Darth InSidious
09-15-2005, 06:38 AM
This following script is from Stoffe's very nice puppet-making tutorial...I'm afraid I can't remember what it does, though...

// ST: st_ai_puppethb.nss
#include "k_inc_generic"

void main() {
object oEnemy = GetNearestCreature(
CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN,
OBJECT_SELF, 1,
CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY,
CREATURE_TYPE_IS_ALIVE, TRUE
);

if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF)) {
if(GetIsPuppet()
&& (GetIsObjectValid(GetPUPOwner())
&& (GetCurrentAction(OBJECT_SELF) != ACTION_MOVETOPOINT)
&& (GetCurrentAction(OBJECT_SELF) != ACTION_FOLLOWOWNER)
&& !GetIsConversationActive()
&& !GN_GetSpawnInCondition(SW_FLAG_SPECTATOR_STATE)
&& GetCommandable()
&& (GetDistanceBetween2D(OBJECT_SELF, GetPUPOwner()) > 3.0)
&& (!GetIsObjectValid(oEnemy) || (GetDistanceBetween(oEnemy, OBJECT_SELF) > 20.0))))
{
ClearAllActions();
ActionFollowOwner(2.0);
}
}

if(GN_GetSpawnInCondition(SW_FLAG_EVENT_ON_HEARTBE AT))
SignalEvent(OBJECT_SELF, EventUserDefined(1001));
}


This next script was generated by the KotOR Script Generator,and is meant to be some kind of ice-power, IIRC...

// Generated by jmac7142's KotOR Script Generator
// Offensive FP
#include "k_inc_force"

void main()
{
SWPF_DAMAGE_TYPE = DAMAGE_TYPE_ION;

object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

effect eBeam = EffectBeam(VFX_BEAM_ION_RAY_01, oSource, BODY_NODE_HAND_LEFT, FALSE);
effect eVFX = EffectVisualEffect(VFX_DUR_STEALTH_PULSE);
effect eSource = EffectVisualEffect(VFX_COM_FORCE_RESISTED);

int nDamage = GetHitDice(oTarget)2;
effect eDamage = EffectDamage(nDamage);

ApplyEffectToObject(1, eBeam, oTarget);
ApplyEffectToObject(1, eVFX, oTarget);
ApplyEffectToObject(1, eSource, oSource);
ApplyEffectToObject(0, eDamage, oTarget);
}

Fred Tetra
09-15-2005, 10:19 AM
How are you executing the compiler? What does the comman line look like?

stoffe
09-15-2005, 11:14 AM
This next script was generated by the KotOR Script Generator,and is meant to be some kind of ice-power, IIRC...


(snip)
SWPF_DAMAGE_TYPE = DAMAGE_TYPE_ION;
(snip)
int nDamage = GetHitDice(oTarget)2;
effect eDamage = EffectDamage(nDamage);
(snip)



I don't know if this has anything to do with your problem, but the second script has two errors in it:

You are missing a multiplication (I assume) operator between GetHitDice(oTarget) and 2 on the line quoted above. This would probably prevent the script from compiling successfully.

Further, the script will cause damage of the "Universal" type to its target, not Ion damage, which I assume is what was intended from the first quoted line above. You never assign the damage type in the EffectDamage() effect constructor, thus it will use the default damage type. This shouldn't prevent it from compiling properly though.

When you are applying the effects, you have not assigned any duration to the duration effects (the beam and the visual) you apply to the target. Also, you are applying the visual to the caster as a temporary effect even though it's a Fire&Forget visual, which should be applied as Instant.

Last, you are not signalling the target that they have been struck by a Hostile force power, thus their combat AI will not react to being attacked by it.

Your script should probably look something like:

// Generated by jmac7142's KotOR Script Generator
// Offensive FP

void main() {
object oSource = OBJECT_SELF;
object oTarget = GetSpellTargetObject();

effect eBeam = EffectBeam(VFX_BEAM_ION_RAY_01, oSource, BODY_NODE_HAND_LEFT, FALSE);
effect eVFX = EffectVisualEffect(VFX_DUR_STEALTH_PULSE);
effect eSource = EffectVisualEffect(VFX_COM_FORCE_RESISTED);

int nDamage = GetHitDice(oTarget) * 2;
effect eDamage = EffectDamage(nDamage, DAMAGE_TYPE_ION);

SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId(), TRUE));

ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBeam, oTarget, 1.0);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVFX, oTarget, 1.0);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eSource, oSource);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eDamage, oTarget);
}


(This is assuming that this is supposed to be a fairly powerful force power, since it will pass right through force resistance and offers no saving throw.)

Det. Bart Lasiter
09-15-2005, 01:09 PM
I pretty sure I uploaded a fixed version for those errors, though I recently got a virus and had to format my HD ( :wornout: ), although I managed to get some code files on to a backup disk. But if there's no fix posted yet, I'll finish the fixes tomowrow night and have it uploaded to PCGM :)

Darth InSidious
09-16-2005, 04:24 AM
I think that's with the fixed version...2.1b......:(
@FT, I don't know, I tried everything! Like I said, no matter what I do, nwnnsscomp shuts down as soon as it starts up...

maaneeack
09-16-2005, 02:43 PM
I know when I was trying to get nwnnsscomp to compile, it won't work with k2 if you don't add the -g 2 to the command line (-g(ame) 1/2: 1 is k1, 2 is k2, no -g is nwn).

ChAiNz.2da
09-16-2005, 02:54 PM
Hey DS, what (if any) does your .bat file look like? You can open it up with notepad to see. ;)

I'm wondering if you're missing the "pause" feature to make the window stay open...

My Compile .bat file looks like this: nwnnsscomp -c -g 2 --outputdir "C:\Documents and Settings\ChAiNz\Desktop\CompileDump\Output" *.nss
pause

and my De-compile .bat looks like this: nwnnsscomp -d -g 2 --outputdir "C:\Documents and Settings\ChAiNz\Desktop\CompileDump\Output" *.nss
pause

Of course, your output directory would be different (if you specify one).. but I had a similar problem when I didn't use the "pause" feature.

I'm also using "nwnnsscomp.exe v1.03" found in the thread that Fred gave a link to...

tk102
09-16-2005, 03:05 PM
I think that's with the fixed version...2.1b......:(
@FT, I don't know, I tried everything! Like I said, no matter what I do, nwnnsscomp shuts down as soon as it starts up...
Darth InSidious, what you're seeing sounds familiar to me. Take a peek at this thread to see if it helps you.
http://www.lucasforums.com/showthread.php?t=130747

Darth333
09-16-2005, 03:18 PM
yes but if he's using Fred's compiler, he'll have to specify the game -g 1 for K! and -g 2 for K2.

Darth Insidious, if the above doesn't work, let's try the other way around. Can you give us this info:

- location to which you extracted nwnnsscomp.exe
- location of your scripts to compile
- Do you have the int'l version of the game or the US version?
- command that you are entering to get nwnnsscomp to work.

Perhaps with this we will be able to figure out exactly what's wrong.