1. Actually, what I want to do is the exact reverse of that. I'm writing a plugin that detects when an enemy is attacking the player's companion(s) or horse, and redirecting them to attack the player instead. However, I've got a specific issue with Vilja's horse Bruse, who is owned by a faction. So what I am looking to do when I find an actor like this is get a list of the members of the owning faction and check each one to see if they are flagged as a player companion (or are the player), in order to determine if the owned actor should also be flagged as a player companion. If I can't find any generic way of doing this, I'll just hard-code a check for Bruse (or ask Emma to change Bruse so he is owned by Vilja).
2. I'm not sure I want to use CloneForms then, as there could potentially be a fair number of these temporary containers required at the same time, although for the most part there will only be one or two needed. What I'm trying to do here is have an activator/scripted spell effect change an NPC's equipped items. I tried just force-equipping the stuff I want them to use, but I can't stop them from re-equipping their normal stuff when the evaluate their AI packages. So what I thought of doing was creating a temporary container and removing their items to the container for the duration of the effect. Maybe I could do it by using one container for all NPCs, and keeping track of the removed equipment for each NPC using arrays.
Eloise
1. Seems to me it would be better if you could get a list of the player's companions, e.g. with GetFollowers, and check each of them to see if they are in the faction.
2. You probably don't want to keep the equipment in an array as you'll lose any extra data associated with the items (e.g. script variables, weapon/armor health, etc).
I suggest something like:
Spoiler scn someGlobalScriptarray_var containers
scn FnStoreActorInventoryref actorarray_var containersarray_var itershort indexshort iref itemref containerbegin Function { actor } let containers := someQuest,containers if containers == 0 let containers := ar_construct Array endif let index := ar_size containers let i := 0 foreach iter <- containers if (*iter)->isInUse == 0 let index := i break else let i += 1 endif loop if eval index == ar_size containers let containers[index] := ar_Map { "isInUse"::0, "container"::cloneForm someEmptyContainer } let someQuest.containers := containers endif let containers[index]->isInUse := 1 let container := containers[index] foreach item <- actor item.removeMeIR container loop setFunctionValue indexend
scn FnRestoreActorItemsref actorshort indexref containerref itembegin Function {actor, index} let container := someQuest.containers[index]->container foreach item <- container item.removeMeIR actor loop let someQuest.containers[index]->isInUse := 0loop
This way you only create as many containers as are ever needed at one time, and reuse them when they're not in use.
I have one request. I know, I always come here with requests and nothing else. Sorry about that. Would it be possible to add functions for modifying creature values like 'combat', 'stealth' or 'magic'? Preferably functions that don't affect the base, but only the reference. Ahem.
Setting for base objects: no problem.
Setting for individual references: not really possible. You may be able to work around this with a Fortify Skill spell.
Hey, found a odd issue with the v19+ of OBSE and http://www.tesnexus.com/downloads/file.php?id=29120. It may be because a command doesn't work the same as in v18, but when you name a backpack, the name is discarded and you get a backpack called . I'm quite clueless with OBSE scripting, and which command would do what, so I can't figure out what part of which script I should be looking at.
All I know is that it's making cloned forms of the backpack with a name you select, and the name is going missing.
Is this happening with 0019b?
We have a request, that we really really hope can be implemented!
Is it possible to create a function that retrieves all the available Topics from an actor at the moment the function is called, and stores them in an array (maybe called GetTopicList)? And if that's possible, can you also create a function that retrieves the text from a Topic and stores it in a string_var (called GetTopicText)? With text I mean the text of the topic button.
Thanks a lot in advance, it would be really great,
The MERP team!
Should be. I need to locate the game code that looks up a topic's text.
Hey. I figure I would reinstall oblivion after being away from it for a few years. I installed OBSE 0019b and the latest patch. When I launch with OBSE there is no main menu, no text appears, it just plays the background video. However, the vanilla launcher works just fine. I haven't bothered with any other mods so far, so it can only be OBSE causing this.
I'm on windows 7 if it matters. Thanks for any help.
Well that's interesting.
Can you PM me with the contents of obse.log?
GetSelf returns 0 (or, sometimes FF000800) on dynamic (PlaceAtMe'd) carriable items and lights (supposed to be on purpose).
It returns the right FormID for dynamic statics and doors (I did not test other types)
Although the WIKI mentions it, I had completely forgotten about this and wasted three hours this morning debugging the deletion of a clone of the Anvil Lighthouse. The code deleted the building, the doors and the fire (activator), but failed on the light. Only after wasting all this time I remembered about it.
And scruggsy, a weird thing about it: under certain circumstances (when called from within a function), GetFormIDString returns the right FormId and GetRawFormIDString returns 0, for those GetSelf'ed ref var. I will PM the test setup and details.
Got your PM, will take a look shortly.