Jump to content

Check detection status, inventory and set aggression.


Looca

Recommended Posts

Hello everyone.

1. As the title suggests, I would like to know whether I check an actor's combat state somehow, i.e. whether they are in [CAUTION] or [DANGER], and make that a condition?
I'd like to set the actor's aggression to 0 when sneaking and not in combat but as soon as they or the player get attacked it should go back to 1.
I tried:

If (Player.IsSneaking==1) && (ActorREF.IsInCombat==1 || Player.IsInCombat==1)
    ActorREF.SetAV Aggression 1
EndIf

So that actor in question fights back even if the player is still crouching around. It appears to be working except the problem with that condition is that [CAUTION] counts as "InCombat" which kind of ruins the whole point of the exercise.
I've also tried GetAttacked but that was apparently a bad idea.
Would IsActorDetected work (if so, how) or does [CAUTION] count as detected as well?

___

 

2. Also:

If (ActorREF.IsPassive==1)
    ActorREF.SetAV Aggression 0
ElseIf (ActorREF.IsPassive==0) && (ActorREF.Sneak==0)
    ActorREF.SetAV Aggression 1
EndIf

is not working. I've tried removing the "Sneak" condition; "IsPassive" is set via a dialogue result script that is
set ActorREF.IsPassive to 1/0 (respectively).
Actor goes passive alright; but then he never ever goes into combat anymore (which is odd because that is the same command I've used to make him passive while sneaking and THAT works).

___

 

3. Another thing I was wondering: Is there a way to check the player's inventory for any food item or ammo without having to type up a whole list? I must've missed something there.
I know how to check for one specific item and apparently there's a way to check FormLists too, although I don't know how that works.

___

 

4. While I'm here: How do I make an actor attack the player when they pick up an item based on conditions?

Begin OnLoad    If (ActorREF.HasBeenHired==0) && (Player.GetItemCount ItemInQuestion==1)
        ActorREF.RemoveFromFaction PlayerFaction
        ActorREF.StartCombat Player
    EndIfEnd

It's an object script on the Item In Question. I tried Begin GameMode as well. Only using GetItemCount because I thought maybe that would work but it doesn't. Would I have to set an ownership flag?

Edit: Solved - It works with OnAdd Player. Why is it that I always find solutions to things after asking how to do it? :<

___

 

5. Last, not least but kind of unrelated: Would it be okay for me to take the model and texture of an item from Old World Blues, use them to make a new item and drop that in the game just so that the plugin doesn't need OWB as a master? Or would I have to use the actual thing and add OWB to the master list?

Edit: Solved - No, it would not be okay.

___

 

Thanks for reading.

Edited by Looca
Link to comment
Share on other sites

Wow, this post is a mess. Whenever you ask for help, it's always a good idea not to give anyone who tries a headache. To this end, if you must post multiple questions / topics under one title, at least make use of a bullet point list. And clearly mark your edits so people can tell what you have and haven't done. E.g:

 

- Blah blah blah question 1

 

- Blah blah even more blah

(Here's a script or something)

Question 2

 

- Blah blah blah question 3

--EDIT--

Never mind, did it, here's how.

Link to comment
Share on other sites

Hrm. Sorry about the headache. If you got one, that is. I'll try and edit the post to make it... er, less headache-inducing.

 

As for multiple questions, I just didn't want to make multiple topics. I suppose it's really not that great an idea to stuff such unrelated things into one post.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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