I don't see how that's possible. The sneak function relies on the player's sneak skill or so the research I did at the time indicated and it works for me and lots of others. If I sneak around enemies undetected she doesn't react and enter combat. BUT, as soon as I am detected or when I go out of sneak on purpose she attacks anything that moves as she should. I've tested this over and over and it works so I don't know what's happening for you.
No you misunderstood me here. If I am in sneak mode and so is Rosie, she doesn't enter combat until I am detected. That works just fine. I am not sure how her sneak and the player's sneak work together but that isn't the issue, so I am fine with that also.
The problem I have is when the player is detected and I go out of sneak, she stays in sneak. She does attack but instead of running up to the enemy she moves very slowly(sneaks) to the enemy. Again this really isn't a problem for me as I like her staying in the mode I select for her and not the mode I am in.
That's exactly what happens for me. I sneak, she sneaks.
This is where I disagree with what what you say. If you look at the code, the only way you can change her from sneaking to not sneaking is when she is activated. If that part of the code doesn't control her sneaking why is it there? What does it do? This is the section in question:
Code: Select all
if (GetSelf.GetForceSneak == 0) && (player.IsSneaking == 1)
GetSelf.SetForceSneak 1
elseif (GetSelf.GetForceSneak == 1) && (player.IsSneaking == 0)
GetSelf.SetForceSneak 0
endif
This is in an ACTIVATE block so it only fires when activated right? In my opinion, if yo wanted it to work the way you say it should, you would have to put that section of code in a GAMEMODE block. That way it will continually check for what mode you are in and set her accordingly. Make sense right?
But the issue isn't what your intension are with the mod. I was just curious on how you wanted it to work.
You stated you use OBSE for other mods, so having it installed probably isn't the issue. CS Extender doesn't change how function works at all. It does catch compile errors that regular CS lets slide. So that probably isn't the issue either. That fact that regular CS compiles this part of the code doesn't mean it should work.
To me the problem is the way 'GefSelf' is being used. You cannot use a function to call a function whether using OBSE or not or regular CS or CS Extender. 'GetSelf.SetForceSneak' should never work from what I understand. 'GetSelf' and 'SetForceSneak' are both function so they cannot be strung together. The WIKI page agrees with me here.
From the WIKI page:
... 'GetSelf' must be recorded to a script variable before it can be used.
Meaing you would need to use this code to get it to work:
Code: Select all
ref rRosie
set rRosie to GetSelf
if (rRosie.GetForceSneak == 0) && (player.IsSneaking == 1)
rRosie.SetForceSneak 1
elseif (rRosie.GetForceSneak == 1) && (player.IsSneaking == 0)
rRosie.SetForceSneak 0
endif
But as I stated in my last post, since the script is attached to Rosie no qualifiers are need so this code will work just the same:
Code: Select all
ref rRosie
if (GetForceSneak == 0) && (player.IsSneaking == 1)
SetForceSneak 1
elseif (GetForceSneak == 1) && (player.IsSneaking == 0)
SetForceSneak 0
endif
It isn't easy to tell that she gets stuck in sneak mode. She will still run to catch up with you when following, walk normally when not in combat. The easiest way to see if she is stuck in sneak mode is how she reacts when combat starts. If she runs to the enemy she is not in sneak but if she slowly walks to the enemy then she is in sneak mode. Another way to test is to open up the console click on Rosie and type
issneaking. You will get a message about what mode she is in. Try it when the player is standing and sneaking and see what you get.
I hope I am not offending anyone with these posts. I am just trying to learn what can. All TES scripting is to say the least awkward. I have been coding for computers since the mid 1980s and find TES scripting frustrating. I sometimes wonder what the coders of the game were thinking!!!!
I knew I wasn't imagining things. All the other people who have used my companions over the years say the same so as you say MasterAub, it's not a problem on my end and I'm not going to fix what's not broken.
I'm not asking you to fix anything. If it works for the masses then that fine with me. I just wanted you to be aware of what might be going on.