Jump to content

Actor Object Script Disappears on Reload


jaredl

Recommended Posts


scn CreatureScatter

float timer
short iConfidence
short toggle

Begin GameMode

if toggle == 0
set iConfidence to getav confidence
endif

if player.GetAnimAction == 2
&& GetActorAggroRadiusViolated == 1
set toggle to 1
setav confidence 0
startcombat player
endif

if timer < 1 && toggle == 1
set timer to timer + GetSecondsPassed
else
setav confidence, iConfidence
set toggle to 0
set timer to 0
endif

End
Edited by jaredl
Link to comment
Share on other sites

Yes that is a comma. I saw it used that way in an example script online and it seems to be the only way I can use a variable with that function.

 

The second part is not on a single line but GECK lets me save it and it does work, at least on the first load. I will try it on the same line and see if it makes a difference.

Link to comment
Share on other sites

I have applied an object script to an actor

Applied how? Is the script attached to the actor by default, or are you using the SetScript command to attach it? If the latter, then the issue you're describing is to be expected, as SetScript doesn't work properly (as of NVSE 4.5b7).

Link to comment
Share on other sites

Even this compile:

 

if player.GetAnimAction == 2 && || %% GetActorAggroRadiusViolated == 1

 

I don't blindly trust the compiler

I went ahead and edited it into the same line but results were the same.

 

 

I have applied an object script to an actor

Applied how? Is the script attached to the actor by default, or are you using the SetScript command to attach it? If the latter, then the issue you're describing is to be expected, as SetScript doesn't work properly (as of NVSE 4.5b7).

 

The script is attached to the base actor by default. For the rest I use the template flag Use Scripts. It turns out the scripts were working on other NPCs, but I was just testing on the same ones over which lose their script after a second load. 00157B37 is the FormID of the Placed Object of one of the NPCs (FalloutNV.esm). Perhaps if someone could take a look.

Edited by jaredl
Link to comment
Share on other sites

 

Even this compile:

 

if player.GetAnimAction == 2 && || %% GetActorAggroRadiusViolated == 1

 

I don't blindly trust the compiler

I went ahead and edited it into the same line but results were the same.

 

did you remove the comma too?

 

after that, I would printC every script line, to see what exactly is executed and what's not, and when. And I would reload an older save, before the mod, or start a new game.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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