Sign in to follow this  
blinkyzero

Newly-spawned enemies breaking scripted scenes

Recommended Posts

Hi folks. I'm working on a mod for KotOR1 that does a number of things to increase the difficulty and replayability of the game, and one of the features is a "call for help" mechanic that lets enemies summon in reinforcements. I've got this working perfectly now in the scripts...with one exception: certain scripted scenes don't seem to like having enemies around and in combat. A good example of this is the very first encounter with the Sith soldiers on the Endar Spire. If you kill the two soldiers, a script automatically fires that has Trask talk to you about medpacs -- and any seemingly unexpected live enemies in range will cause the conversation to rush to its completion (or the enemies will take periodic whacks at you as you stand there chatting).

 

I thought active conversations automatically disabled combat from proceeding, but apparently this isn't quite the case. I've tried inserting checks into the master heartbeat script to disable combat when a conversation is active, but it's unreliable at best. I think my next step is to actually disable the AI flag of enemies when a conversation's ongoing...but I'm afraid this might have unintended consequences.

 

Any ideas?

 

edit: well, I did come up with one solution -- removing the "reinforcement" enemies with DestroyObject() if their heartbeat scripts detect them being in combat during a conversation. This seems to work. Not the prettiest fix, but probably best when it comes to compatability. Still very much open to other methods though. :D

Share this post


Link to post
Share on other sites

If they did it anyway like KOTOR2 it's because each enemy killed increments a global (or local) counting towards the proper number killed. So after it received "2" it notes all enemies are dead (since 2 are what it's in vanilla) and the conversation triggered.

 

A sollution would be to change it to living enemies on the map (although as Dxun learns us that can also be glitchy), or if you always summon a fixed number of extra foes simply increase the killcount before the conversation triggers.

If not, the best I could think of would be to have a new global increment per additional enemy spawned, and alter the original dialogue from being "2" to "2+NEWGLOBAL", and having it reset the global as it triggers the conversation so it could be re-used during the next encounter. Might still be quite some scripts to alter...

Share this post


Link to post
Share on other sites

If they did it anyway like KOTOR2 it's because each enemy killed increments a global (or local) counting towards the proper number killed. So after it received "2" it notes all enemies are dead (since 2 are what it's in vanilla) and the conversation triggered.

 

A sollution would be to change it to living enemies on the map (although as Dxun learns us that can also be glitchy), or if you always summon a fixed number of extra foes simply increase the killcount before the conversation triggers.

If not, the best I could think of would be to have a new global increment per additional enemy spawned, and alter the original dialogue from being "2" to "2+NEWGLOBAL", and having it reset the global as it triggers the conversation so it could be re-used during the next encounter. Might still be quite some scripts to alter...

 

Yeah, I glanced at the globals and it looks like there's variables used all over the place to determine the kill count before a conversation is triggered. Messing with those would probably be a massive headache.

 

I figure there's probably few enough of them though that having the reinforcements fade out (which doesn't look bad at all) when a conversation starts won't be too ridiculous. I suppose I could always EffectDeath() them too with a message saying they gave up the will to live now that their friends and allies have perished. :P

Share this post


Link to post
Share on other sites

Eh, forgot to mention the spawned in enemies would also need to increment the global the script referes in their ONDEATH, otherwise it wouldn't work.

 

But yeah, it wont be a small task going around it like this 'properly' :P

Not to mention compatibility with other mods...

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this