Jump to content

Script Go BOOM Episode II: Non-Attack of the NPCs


Recommended Posts

So I'm having some...problems with the SexoutStore update. This was posted in that thread but it might get more attention here...

 

The player enters a trigger. The following should occur in order:

  • Player is moved to new cell
  • NPC starts combat with other NPC
  • Variable is set so the trigger doesn't fire again

I know that variable is being set because I manually moved myself back to the first cell via coc and the trigger was properly disabled. So the script is running and completing. Just apparently ignoring that one command. For reference, the script:

scn SexoutStoreDarkScriptInterlude

Begin OnTriggerEnter PlayerREF

if SexoutStoreDark.interlude == 0
	PlayerREF.moveto SexoutStoreDarkInterlude
	SexoutStoreNPCInterludeKillerREF.StartCombat SexoutStoreNPCInterludeKilledREF
	set SexoutStoreDark.interlude to 1
endif

End

Just to make sure something weird wasn't going on because the trigger and the NPC were in different cells, I also added this to the NPC:

scn SexoutStoreDarkScriptInterludeKiller

Begin OnLoad
SexoutStoreNPCInterludeKillerREF.StartCombat SexoutStoreNPCInterludeKilledREF
End

Still nothing.

 

I even had the quest script try to start the combat.

scn SexoutStoreDarkScript

int trigger
int panels
int door
int scene
int interlude

Begin GameMode

if interlude == 1
	SexoutStoreNPCInterludeKillerREF.StartCombat SexoutStoreNPCInterludeKilledREF
	set interlude to 2
endif

if panels == 3
	SexoutStoreDarkBridge.enable
	set panels to 4
endif

End

Still nothing. So I tried using the console to start combat. Still nothing! I tried to use the console to have the NPC start combat with the player. Still nothing!

 

Both NPCs, the Killer and the Killed, are not in any faction whatsoever. The Killer is set to Aggressive so they will actually attack their target...theoretically, anyway. And I did remember to give the NPC ammo this time.

 

EDIT: Probably going to use the UseWeapon function for this sequence. Would like to know what's going wrong here for future reference, though.

 

So let me ask another question since I've got a thread here. Is there any way to detect items a player has dropped within a cell?

EXAMPLE: The Player drops a weapon and a set of armor in a cell they can't return to after leaving. Later, an NPC who has magical-NPC-go-anywhere powers returns their dropped items to them.

Link to comment

When I encounter a situation like this, I like including print statements between every line in the suspect region.

 

They do not have to be fancy -- printing 1, 2, 3 (one number for each line) will be enough to show if the script is terminating abnormally or if a line is not having the effect I thought it should have.

 

And then, if the script is stopping abruptly, you can tell where.

 

Or, if a line is not taking effect, you can change the print statements to display every value used on that line...

Link to comment

Well, since the game sets the variable in the first script, I know the script is not terminating before it runs the StartCombat script.

 

And I'm trying to use UseWeapon but it's now giving me a headache too. It shoots the first NPC properly, but when I tell it to shoot the second one it unholsters and reholsters the weapon without firing.

 

And since using the console to force the NPC to start combat, even with the player, does nothing... I'm not sure if anything is wrong with the script at all.

Link to comment

-- nevermind, my bad --

 

You can scan a room (or more likely an interior cell) for items (GetFirstRef/GeTNextRef). But there is nothing specific about items dropped by the player.

You could create a list of what is by default and compare each item found with the list. But that means only one of each (not good)

Link to comment

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...