PDA

View Full Version : [TSL]Sith Assassin spawn script?


jinger
07-05-2006, 05:49 PM
it may be a bug, Sith Assassins keep their stealth field visual effect after getting hit, i'm pretty sure actually, you get to see the 8001 vfx (cloak removal), so i guess the stealth field vfx was supposed to be removed. does anybody here happen by any chance to have that script decompiled? it'd be a great help.

Lit Ridl
07-06-2006, 04:56 AM
If I understand you right, you need decompiled scripts for KII.
Look at pcgamemods. In find field enter: "decompiled".

jinger
07-06-2006, 06:10 AM
thanks but it seems DeNCS has difficulties with this script, there ain't all the scripts in the game, just the ones it was able to decompile or partially decompile.

Lit Ridl
07-07-2006, 01:43 AM
May be try to decompile it with nwnnsscomp???
But it will be on pcode.

Pavlos
07-10-2006, 07:25 AM
I can't actually decompile scripts myself (Byte code gives me a headache). I was wandering around scripts.bif looking for something and I stumbled across this:

// k_sithas_spawn01
/*
Default On Spawn In
*/

#include "k_inc_generic"
#include "k_inc_debug"

void main()
{

GN_SetDayNightPresence(AMBIENT_PRESENCE_ALWAYS_PRE SENT);

GN_SetListeningPatterns();
GN_WalkWayPoints();

effect eUncloak = EffectVisualEffect( 8001 );

DelayCommand( 0.5, ApplyEffectToObject( DURATION_TYPE_TEMPORARY, eUncloak, OBJECT_SELF, 5.0f));

}

That is the default (global) script for the Sith assassins. Now, whether or not they all use that I don't know. The problem seems to be that nothing tells them to cancel their cloak, just to play another visual effect.

Edit: I removed all the commented out lines as they are just part of the default spawn-ins. Obsidian left them in, probably so they could quickly reverse mistakes.

stoffe
07-10-2006, 12:44 PM
That is the default (global) script for the Sith assassins. Now, whether or not they all use that I don't know. The problem seems to be that nothing tells them to cancel their cloak, just to play another visual effect.


Most Sith Assassins tend to use module-specific OnSpawn scripts. Most of those I've seen tend to be similar to this, with some minor variations:

#include "k_inc_generic"

void main() {
GN_SetSpawnInCondition( SW_FLAG_EVENT_ON_DAMAGED );

effect eVis = EffectVisualEffect(8000);
ApplyEffectToObject( DURATION_TYPE_PERMANENT, eVis, OBJECT_SELF, 2.0);

DelayCommand(2.0, EnableRendering(OBJECT_SELF, TRUE));
DelayCommand(2.0, ChangeToStandardFaction(OBJECT_SELF, STANDARD_FACTION_HOSTILE_1));
DelayCommand(2.0, GN_DetermineCombatRound());

GN_SetDayNightPresence( AMBIENT_PRESENCE_ALWAYS_PRESENT );
GN_SetListeningPatterns();
GN_WalkWayPoints();
}


Their user-defined script then has an OnDamaged event handler that "decloaks" them when they get hurt. The user-defined scripts are usually module-specific since they tend to contain other things relating to that particular encounter as well. They usually contain an OnDamaged handler with script code looking something like:

if (!GetLocalBoolean(OBJECT_SELF, 63)) {
SetLocalBoolean(OBJECT_SELF, 63, TRUE);
RemoveEffectByID(OBJECT_SELF, 8000);
effect eVis = EffectVisualEffect(8001);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eVis, OBJECT_SELF, 5.0);
}

jinger
07-10-2006, 03:44 PM
i figured but there's a bug in there, RemoveEffect won't remove vfx 8000, i used a ClearAllEffects instead and it works, then i thought that any "curse" effect (force powers, weapons...) would be removed as well so i used just the uncloak effect 8001 as soon as the rendering switches on. and another thing, in those scripts the rendering is never switched off, how come they're already invisible when they spawn in?

stoffe
07-10-2006, 04:07 PM
and another thing, in those scripts the rendering is never switched off, how come they're already invisible when they spawn in?

The WillNotRender field is set to 1 in their UTC template, meaning they will spawn with rendering disabled. The scripting function toggles this value.

jinger
07-11-2006, 12:44 AM
The WillNotRender field is set to 1 in their UTC template, meaning they will spawn with rendering disabled. The scripting function toggles this value.cool :) i never knew about that, thanks