Well... Now it is time for me to hijack my own thread!
I am having an issue with my OnEnter script for the Endar Spire in the hopefully to-be-released FFK1 by jonathan7 and co.... It is probably my stupid work that is holding up the release
My original version of the OnEnter worked fine... Because it had less going on, or because I did something wrong with my .utc's... Either way, I think that I need to go in a different direction in how I achieve what we want for the mod - specifically either modifying directly the original vanilla OnEnter so that script injection is removed from the equation, or move the script to Trask's dialog...
Has anyone ever decompiled successfully the (edit!)
k_pend_1b_area.ncs? DeNCS fails as I am sure there are many include files....
Essentially, I have a cluster of bad guys to spawn in, and then separately their leader. They spawn in invisible and then "uncloak" and attack when they perceive the PC. The leader is a little more complex, with a talk-fight sequence. Also, according to PC class, several items are being added to either a new footlocker or the existing one... I was having difficulty getting my new one to appear.
I will post the code I was working with... it compiles, doesn't crash the game, but nothing works properly anymore - the main sequence with the leader has somehow been broken by the new enemies and footlocker I was spawning.
Code:
void main()
{
// Declarations
object oPC = GetFirstPC();
object oStalker = GetObjectByTag("qg_sithstalker");
object oAssassin1 = GetObjectByTag("ff_assnleadr");
object oAssassin2 = GetObjectByTag("ff_assassin2");
object oAssassin3 = GetObjectByTag("ff_assassin3");
object oContainer = CreateObject( OBJECT_TYPE_PLACEABLE, "ffk1lker001", Location(Vector(20.34,16.75,-1.08), 0.0));
effect eI1 = EffectInvisibility(INVISIBILITY_TYPE_NORMAL);
effect eI2 = EffectVisualEffect(8000);
effect eInvis = EffectLinkEffects(eI1, eI2);
int iClass = GetClassByPosition(1,oPC);
// Functional Code
switch (iClass)
{
case 0:
CreateItemOnObject("soldier",oContainer,1);
CreateItemOnObject("g_w_vibrosword04", oContainer,1);
CreateItemOnObject("g_i_gauntlet08", oContainer,1);
break;
case 1:
CreateItemOnObject("scout",oContainer,1);
CreateItemOnObject("g_i_belt009", oContainer,1);
CreateItemOnObject("g_w_blstrpstl004", oContainer,1);
break;
case 2:
CreateItemOnObject("scoundrel",oContainer,1);
CreateItemOnObject("g_i_gauntlet09", oContainer,1);
CreateItemOnObject("g_i_mask20", oContainer,1);
break;
}
CreateItemOnObject("g_i_upgrade003", oContainer,1);
CreateItemOnObject("g_i_upgrade005", oContainer,1);
if (!GetIsObjectValid(GetObjectByTag(oStalker)))
{
CreateObject(OBJECT_TYPE_CREATURE, oStalker, Location(Vector(76.90,84.12,0.00), 0.0));
CreateObject(OBJECT_TYPE_CREATURE, OAssassin1, Location(Vector(29.10,97.91,-0.52), 0.0));
CreateObject(OBJECT_TYPE_CREATURE, OAssassin2, Location(Vector(31.10,102.25,-0.23), 0.0));
CreateObject(OBJECT_TYPE_CREATURE, OAssassin3, Location(Vector(27.62,102.25,-0.21), 0.0));
ApplyEffectToObject(3, eInvis, oStalker, -1.0);
ApplyEffectToObject(3, eInvis, oAssassin1, -1.0);
ApplyEffectToObject(3, eInvis, oAssassin2, -1.0);
ApplyEffectToObject(3, eInvis, oAssassin3, -1.0);
}
// Script Injection
ExecuteScript("qg_pnd_1b_area", OBJECT_SELF);
}
As said, this code compiles fine, and the game tries to work it out, EPIC FAIL. Any glaring issues you see? Especially, why isn't the footlocker spawning?