Quick Questions -- Quick Answers, The 26th

Post » Thu Sep 23, 2010 2:54 pm

GetCreatureType does work fine for me, returning the right type for both, scamps and skeletons.

Make sure you use the right syntax, depending on whether you are using the reference or the base object:

MyReference.GetCreatureType

Or

GetCreatureType MyBaseObject
User avatar
Dean
 
Posts: 3438
Joined: Fri Jul 27, 2007 4:58 pm

Post » Thu Sep 23, 2010 2:18 pm

I need to get a door locked to 'needs a key' lock level, during dialog, what command do I put in in my Script Results?
User avatar
Tarka
 
Posts: 3430
Joined: Sun Jun 10, 2007 9:22 pm

Post » Thu Sep 23, 2010 11:35 am

GetCreatureType does work fine for me, returning the right type for both, scamps and skeletons.

Make sure you use the right syntax, depending on whether you are using the reference or the base object:

MyReference.GetCreatureType

Or

GetCreatureType MyBaseObject



Huh that's strange, thanks for checking QQuix. Maybe the problem is with how I'm using GetNthActiveEffectSummonRef. Here's the code I'm using...

if player.getactiveeffectcount >= 1	set SummonedDaedra to player.GetNthActiveEffectSummonRef 1	set CreatureType to SummonedDaedra.getcreaturetype	if SummonedDaedra.getcreaturetype == 1		set DaedraSummonedCount to (DaedraSummonedCount +1)		message "success!!!"	endifendif


I need to get a door locked to 'needs a key' lock level, during dialog, what command do I put in in my Script Results?


DoorRef.lock 100 should do it for you.
User avatar
Marguerite Dabrin
 
Posts: 3546
Joined: Tue Mar 20, 2007 11:33 am

Post » Thu Sep 23, 2010 2:32 pm

I tried with PlaceAtMe'd creatures.
Maybe the function works differently with summoned creatures (I don't know a thing about summoned creatures, actually)

Try inserting a "" printc "%i %n" SummonedDaedra SummonedDaedra "" in the code to see what GetNthActiveEffectSummonRef is returning.
User avatar
Josephine Gowing
 
Posts: 3545
Joined: Fri Jun 30, 2006 12:41 pm

Post » Thu Sep 23, 2010 6:01 am

DoorRef.lock 100 should do it for you.


Thanks! :)
User avatar
RAww DInsaww
 
Posts: 3439
Joined: Sun Feb 25, 2007 5:47 pm

Post » Thu Sep 23, 2010 10:30 am

Huh that's strange, thanks for checking QQuix. Maybe the problem is with how I'm using GetNthActiveEffectSummonRef. Here's the code I'm using...
Yes, I think the problem is the use of GetNthActiveEffectSummonRef, or especially the 1 you use as input parameter to it.

Have you added a
PrintC "Summon is %n (%i)", SummonedDaedra, SummonedDaedra 
line to check that you really get the summon's reference from the call? That would be the first check to do.


Here's my code for getting ref to the player's summon, from HUD Status Bars, as you see, it is quite a bit more complicated, but I needed all this to get it work:
		ForEach ar <- PlayerRef.GetActiveEffectCodes			let type := *ar			if (MagicEffectUsesCreatureC type)				let type := ar["key"]				let rt := PlayerRef.GetNthActiveEffectSummonRef type				Break			endif		Loop

User avatar
Karine laverre
 
Posts: 3439
Joined: Tue Mar 20, 2007 7:50 am

Post » Thu Sep 23, 2010 10:46 am

I have guards in my Gallery with patrol packages. The problem is that they will not begin their patrols unless I enter the cell they are in. So I am hiding in another cell waiting for the guard to pass through as his patrol dictates, but nothing. I have to go to the cell he begins in and then he starts his patrol.

Any way to get around this or is this a limitation of Oblivion AI that there is nothing that can be done about it?
User avatar
Stefanny Cardona
 
Posts: 3352
Joined: Tue Dec 19, 2006 8:08 pm

Post » Thu Sep 23, 2010 2:40 pm

Thank you again QQuix and TheNiceOne. I put in the printc command but nothing showed up in the console. You were right TheNiceOne, I think the problem was with the 1 parameter on the end. I inserted your code and that worked fine though. Thanks for helping me out.
User avatar
Carlos Vazquez
 
Posts: 3407
Joined: Sat Aug 25, 2007 10:19 am

Post » Thu Sep 23, 2010 4:59 am

I read in a post somewhere that the maximum scale factor is 10. i.e. SetScale 10 is the maximum. Can anyone confirm that? Also, what is the minimum?

Thanks...
User avatar
Alyce Argabright
 
Posts: 3403
Joined: Mon Aug 20, 2007 8:11 pm

Post » Thu Sep 23, 2010 6:13 am

I have guards in my Gallery with patrol packages. The problem is that they will not begin their patrols unless I enter the cell they are in. So I am hiding in another cell waiting for the guard to pass through as his patrol dictates, but nothing. I have to go to the cell he begins in and then he starts his patrol.

Any way to get around this or is this a limitation of Oblivion AI that there is nothing that can be done about it?


Really need to know this in order to proceed.

Is there no way to get around having to be in and load a cell to in order for the guard to start his patrol package. Am I forced to only have guards perform their patrol in one cell, rather then crossing a few cells?

Thanks.
User avatar
Blaine
 
Posts: 3456
Joined: Wed May 16, 2007 4:24 pm

Post » Thu Sep 23, 2010 1:09 am

Really need to know this in order to proceed.

Is there no way to get around having to be in and load a cell to in order for the guard to start his patrol package. Am I forced to only have guards perform their patrol in one cell, rather then crossing a few cells?

Thanks.


I'm no expert at AI, but do you have the No Low Level Processing flag checked on them? If so, try turning that off, that should fix your problem. If not, you can always call GuardRef.evp in a script to force them to reevaluate their packages, but I'm not sure if that's the most efficient way to do things.
User avatar
Dawn Farrell
 
Posts: 3522
Joined: Thu Aug 23, 2007 9:02 am

Post » Thu Sep 23, 2010 2:17 pm

I'm struggling with learning to use leveled lists and I'm hoping I'm just doing something stupidly obvious -

As a short preface, I'm trying to learn by creating something similar to what CorePC did with his Random Clothing for NPCs mod.

I created a new NPC and put her in the testinghall. I added three leveled lists to her inventory - LL0NPCCLothingPantsMiddle, LL0NPCClothingShirtMiddle and LL0NPCClothingShoesMiddle. When I coc in the first time, I do get a "random" selection of clothing as expected. However, if I coc out, wait for 72 hours (and have waited up to 96) and coc back in, her clothing items always remain the same.

Perhaps I am misunderstanding how Leveled Lists work, but I thought that her clothing would reset and I would have a chance (as determined by the LL) of seeing something different. I'm testing with a very limited mod list which is referenced below.

Any help would be greatly appreciated.

Active Mod Files:
00 Oblivion.esm
01 Unofficial Oblivion Patch.esp [Version 3.2.6]
02 DLCShiveringIsles.esp
03 Knights.esp
04 mkLLTest.esp

EDIT - Additional Question

If I try to add a LL to add clothing or armor to an existing NPC, that NPC will not equip it (or in other words, shows up as completely naked). I've tried a bunch of different things including coc'ing all over the map and waiting over 72 hours but nothing seems to work. The only way I can get a LL with clothing/armor to appear on an NPC is to create a new NPC or begin a brand new game. If I use an existing save, the leveled items will not appear.
User avatar
Sudah mati ini Keparat
 
Posts: 3605
Joined: Mon Jul 23, 2007 6:14 pm

Post » Thu Sep 23, 2010 11:45 am

How do you make any mesh appear at far distances?
User avatar
Soraya Davy
 
Posts: 3377
Joined: Sat Aug 05, 2006 10:53 pm

Post » Thu Sep 23, 2010 1:24 am

I'm struggling with learning to use leveled lists and I'm hoping I'm just doing something stupidly obvious -

As a short preface, I'm trying to learn by creating something similar to what CorePC did with his Random Clothing for NPCs mod.

I created a new NPC and put her in the testinghall. I added three leveled lists to her inventory - LL0NPCCLothingPantsMiddle, LL0NPCClothingShirtMiddle and LL0NPCClothingShoesMiddle. When I coc in the first time, I do get a "random" selection of clothing as expected. However, if I coc out, wait for 72 hours (and have waited up to 96) and coc back in, her clothing items always remain the same.

Perhaps I am misunderstanding how Leveled Lists work, but I thought that her clothing would reset and I would have a chance (as determined by the LL) of seeing something different. I'm testing with a very limited mod list which is referenced below.

Any help would be greatly appreciated.

Active Mod Files:
00 Oblivion.esm
01 Unofficial Oblivion Patch.esp [Version 3.2.6]
02 DLCShiveringIsles.esp
03 Knights.esp
04 mkLLTest.esp

EDIT - Additional Question

If I try to add a LL to add clothing or armor to an existing NPC, that NPC will not equip it (or in other words, shows up as completely naked). I've tried a bunch of different things including coc'ing all over the map and waiting over 72 hours but nothing seems to work. The only way I can get a LL with clothing/armor to appear on an NPC is to create a new NPC or begin a brand new game. If I use an existing save, the leveled items will not appear.

I don't know for sure, but I think you need to create or add an AI package to have her change clothes.
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Thu Sep 23, 2010 4:00 pm

I don't know for sure, but I think you need to create or add an AI package to have her change clothes.


I'm an extreme novice at packages, but I didn't see an option that would work for me. I messed around with "UseItemAt", but (unless I'm missing something), it doesn't appear that an NPC will equip and item in inventory.

Thanks for the suggestion, I'll keep poking around.
User avatar
Mimi BC
 
Posts: 3282
Joined: Sat Oct 07, 2006 10:30 pm

Post » Thu Sep 23, 2010 1:23 pm

...I created a new NPC and put her in the testinghall. I added three leveled lists to her inventory - LL0NPCCLothingPantsMiddle, LL0NPCClothingShirtMiddle and LL0NPCClothingShoesMiddle. ...

I think your problem is that the leveled list is used only at creation of the character. As it's not a leveled creature being respawned, once created, the inventory content is in the save game and no amount of waiting changes it. You'd have to remove the items, and re-add them, to get the leveled lists re-evaluated, and a new selection made.
User avatar
Robert Jr
 
Posts: 3447
Joined: Fri Nov 23, 2007 7:49 pm

Post » Thu Sep 23, 2010 9:41 am

I can't seem to remember this, or if it even matters, but is there a certain format that needs to be followed when using Movetomarker and Enable for a single If statement?

For example:

If (X == Y)     NPC1.Movetomarker Z     NPC2.Movetomarker Z     NPC1.Enable     NPC2.EnableEndif


or

If (X == Y)     NPC1.Movetomarker Z     NPC1.Enable     NPC2.Movetomarker Z     NPC2.EnableEndif


Which way would be better/correct?
User avatar
chloe hampson
 
Posts: 3493
Joined: Sun Jun 25, 2006 12:15 pm

Post » Thu Sep 23, 2010 12:46 pm

Which way would be better/correct?


Either. No difference.

The movement+enabling of one NPC is independent flom the other and the order does not matter.

But, since you are moving both to the same spot, there will be a different result whether you move NPC1 or NPC2 first.
User avatar
Jah Allen
 
Posts: 3444
Joined: Wed Jan 24, 2007 2:09 am

Post » Thu Sep 23, 2010 5:26 am

I think your problem is that the leveled list is used only at creation of the character. As it's not a leveled creature being respawned, once created, the inventory content is in the save game and no amount of waiting changes it. You'd have to remove the items, and re-add them, to get the leveled lists re-evaluated, and a new selection made.


Thanks ghastley - that makes a lot of sense based on what I've been seeing as I've tried to figure this out. I'll have to look through CorePC's Random Clothing mod in more detail because simply based on the description, I thought he was only using a leveled list to reset the NPC's clothing every couple of days.
User avatar
Budgie
 
Posts: 3518
Joined: Sat Oct 14, 2006 2:26 pm

Post » Thu Sep 23, 2010 12:07 pm

Either. No difference.

The movement+enabling of one NPC is independent flom the other and the order does not matter.

But, since you are moving both to the same spot, there will be a different result whether you move NPC1 or NPC2 first.

Okay, that's what I was thinking but I needed to be sure. Thanks :D
User avatar
Soku Nyorah
 
Posts: 3413
Joined: Tue Oct 17, 2006 1:25 pm

Post » Thu Sep 23, 2010 3:35 pm

Thanks ghastley - that makes a lot of sense based on what I've been seeing as I've tried to figure this out. I'll have to look through CorePC's Random Clothing mod in more detail because simply based on the description, I thought he was only using a leveled list to reset the NPC's clothing every couple of days.

I went and read the description and it appears that way. An NPC's choice of equipped clothing/armor is re-evaluated when they change AI package (and maybe more often than that), so the critical question is whether an unequipped leveled item is remembered as what it rolled, or just as the unused list. Your experience (and mine) says that once the LL item is equipped, it doesn't get re-rolled, but NPC's who switch from armor to clothing and back may get the chance to re-roll any time the LL item is just in inventory. Someone else may be able to fill in that last detail.
User avatar
J.P loves
 
Posts: 3487
Joined: Thu Jun 21, 2007 9:03 am

Post » Thu Sep 23, 2010 7:03 am

Does anyone know if there's an ini setting to allow the CS to render more cells at a time? Only seeing 5x5 can be a little restrictive sometimes.
User avatar
Krista Belle Davis
 
Posts: 3405
Joined: Tue Aug 22, 2006 3:00 am

Post » Thu Sep 23, 2010 2:39 am

What I'm trying to do is get all the NPC's that are in the interior cells associated with a particular building exterior mesh.

Now I have a method, though I'm yet to fully try it, which goes roughly like this.

1. Get all the doors in building vicinity with getfirstref/getnextref
2. Find the doors for that building by testing that they are within the buildings bounding box (I have bounding box data to use, thanks QQuix).
3. Get all the interior cells for the building by starting at the located doors, using getteleportcell to get first cell, get all the doors in that cell, getteleportcell again and so on until all interior cells found (recursive, probably).
4. Use getfirstrefincell/getnextref to get all npcs in all the interior cells found.

Now I think that will work, the only question is what the performance will be like (it's in a quest script, I'll spread it out over as many frames as I can).

I'm just wondering if anyone has any better ideas that are less likely to be as convoluted or performance hungry. Or even better, if someone has already done this before.
User avatar
Tania Bunic
 
Posts: 3392
Joined: Sun Jun 18, 2006 9:26 am

Post » Thu Sep 23, 2010 10:11 am

I need to do a search and replace on a string of text in over 100 scripts - is there anyway to do this? I know that TES4Edit can be used to change a value in several records, but I don't think it works on scripts.
User avatar
CSar L
 
Posts: 3404
Joined: Fri Nov 09, 2007 9:36 pm

Post » Thu Sep 23, 2010 12:27 pm

I need to do a search and replace on a string of text in over 100 scripts - is there anyway to do this? I know that TES4Edit can be used to change a value in several records, but I don't think it works on scripts.

No idea if this can be done with any TES/CS tools, but I always use Notepad++ for writing scripts, just for situations like this. That may not help you much if you've just been writing your scripts in the CS, as you'll need to copy and paste all your scripts into separate text files to use Notepad++'s find and replace tools, but that would still probably be faster and more reliable than doing it all manually in the CS.
User avatar
lisa nuttall
 
Posts: 3277
Joined: Tue Jun 20, 2006 1:33 pm

PreviousNext

Return to IV - Oblivion