Quick Questions -- Quick Answers, The 26th

Post » Thu Sep 23, 2010 5:19 pm

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.


Yeah, I use Textpad, but I don't have all the scripts in there because most of them are similar enough that I usually use a template. Make a couple of changes and paste into the CS. Unfortunately in this case, it would actually be faster to change every single script in the CS :( I know a person who shall remain unnamed is working on an overhaul of the CS, but I don't know where that stands. Maybe I can get an early alpha or something ;)
User avatar
jessica breen
 
Posts: 3524
Joined: Thu Aug 03, 2006 1:04 am

Post » Thu Sep 23, 2010 7:35 am

Hi!
Is it possible with available tools either:

- changing .nif model for an furniture item in game (is it possible with obse?)
or
- changing collision properties of .nif to toggle item from static to movable and vice versa? (maybe with NifSE?)

For example, chair. When activating it while holding some key it would be toggled from static to movable so that player could change it's position in game, and by activating it again change it back to static. Or leave it as a movable (which could produce some amusing side effects).
User avatar
josie treuberg
 
Posts: 3572
Joined: Wed Feb 07, 2007 7:56 am

Post » Thu Sep 23, 2010 7:42 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.


I think it is the uGridsToLoad (I have it = 11 - meaning an 11x11 grid)

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.

Yes, it does work the way you planned it.

I am doing exactly the same thing on an auxiliary mod of mine, except I am mapping everything inside each interior, except NPCs.
Some things to consider
- You will only find persistent NPCs in cells you have not visited recently.
- Be careful not to enter an infinite loop: an interior A has a door to Interior B. If you go thru all interior B doors, one of them leads back to interior A. Make sure you don't reprocess interior A
- When you follow door after door, you may end up back outside at the other end of the building. If the building is large or has a basemant that leads to a cave, the exterior cell you will find may not be loaded.

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.

All I can think of is the hard way, one by one.
There is a way to speed it up.
Use the Find (^F) to find he first occurrence of the to-be-replaced text
Then copy the new text to the clipboard.
Then keep the Ctrl ky pressed and go V (paste) >> F3 >> V >> F3 >> V >> F3 >> V . . .
Then press the "next script" arrow and repeat F3 >> V >> F3 >> V >> F3 >> V . . .
In a few minutes you will cover all 100 scripts.
User avatar
Add Me
 
Posts: 3486
Joined: Thu Jul 05, 2007 8:21 am

Post » Thu Sep 23, 2010 5:10 pm

I think it is the uGridsToLoad (I have it = 11 - meaning an 11x11 grid)


Awesome, thanks QQuix. :foodndrink:
User avatar
anna ley
 
Posts: 3382
Joined: Fri Jul 07, 2006 2:04 am

Post » Thu Sep 23, 2010 10:29 am


Yes, it does work the way you planned it.

I am doing exactly the same thing on an auxiliary mod of mine, except I am mapping everything inside each interior, except NPCs.
Some things to consider
- You will only find persistent NPCs in cells you have not visited recently.
- Be careful not to enter an infinite loop: an interior A has a door to Interior B. If you go thru all interior B doors, one of them leads back to interior A. Make sure you don't reprocess interior A
- When you follow door after door, you may end up back outside at the other end of the building. If the building is large or has a basemant that leads to a cave, the exterior cell you will find may not be loaded.



- I didn't realise you could have non-persistent NPCs. Now that I think about it, I'm guessing spawning bandits out in the wilderness would be non-persistent, but are there ever likely to be non-persistent NPCs in cities/buildings?
- Yep. Covered.
- I had thought about ending up back outside the building, but not that the exterior cell might not be loaded, so good point. I had just figured it would still be in player vicinity, which it would be most of the time, but you're right, there would be other circumstances. A simple IsFormValid check should handle that though. Do you know if GetParentWorldspace == 0 is the best way to test for cell being interior? The obse documentation was a little vague on that point.
User avatar
Katie Pollard
 
Posts: 3460
Joined: Thu Nov 09, 2006 11:23 pm

Post » Thu Sep 23, 2010 3:43 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.

This should fit the bill...

www.inforapid.com
User avatar
Bloomer
 
Posts: 3435
Joined: Sun May 27, 2007 9:23 pm

Post » Thu Sep 23, 2010 4:46 am

This should fit the bill...

www.inforapid.com


Yeah I use InfoRapid actually. I was thinking of doing exactly that, but I didn't think it would work on a compiled script. I figured that I'd have to go in and recompile all the scripts anyway... I had another situation in which I copied a script from one plugin to another with TES4Edit and I found I still had to go into the CS and compile the scripts after copying to get them to register properly. Wasn't sure if InfoRapid would work or not... Does it work for doing something like this - have you successfully done it? Would certainly be a time saver...

I wound up pretty much using a similar method to what QQuix suggested. It took me about 10 hrs! Mind you, I just had to go in and fix up all the formatting and clean up some spurious variable declarations too :) I didn't create this mod originally, so I didn't write the scripts - I'm just cleaning them all up now. Anyway all done and it looks like I've zapped the saved game bloat that was happening, so I'm happy. Anxiously awaiting the release of the secret project though ;)

Thanks for the suggestions.
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Thu Sep 23, 2010 1:04 pm

- I didn't realise you could have non-persistent NPCs. Now that I think about it, I'm guessing spawning bandits out in the wilderness would be non-persistent, but are there ever likely to be non-persistent NPCs in cities/buildings?

I am not that familiar with how the NPCs are set up, but I suppose the named NPCs are on low level processing, therefore they must be persistent.


- I had thought about ending up back outside the building, but not that the exterior cell might not be loaded, so good point. I had just figured it would still be in player vicinity, which it would be most of the time, but you're right, there would be other circumstances. A simple IsFormValid check should handle that though. Do you know if GetParentWorldspace == 0 is the best way to test for cell being interior? The obse documentation was a little vague on that point.

If memory serves, I had the problem of exiting to an unloaded cell in Anvil Castle (the entrance door was in a loaded cell, but the balcony on the other side was not). And somewhere there is a house that has a hidden floor in the basemant, leading to a series of tunnels/caves that exit way out in the wilderness.

Anyway . . . I used LinkedDoor.IsInInterior to determine if the interior door linked to an interior or exterior cell.

IsInInterior works because the interior cells are persistet, in a way. In other words, the game keeps in memory the information about all interior cells, even if the cell itself is not loaded. Therefore IsInInterior can access that info and return 1 if the cell is an interior cell.
User avatar
Angel Torres
 
Posts: 3553
Joined: Thu Oct 25, 2007 7:08 am

Post » Thu Sep 23, 2010 3:06 am

Is there a way to get rid of items droped by the player for good with a script or another way?

I need this for an event, where the player drops items from his inventory into a trigger area and based on the kind of the item a special event will happen. The items will of course be "destroyed" in the process and thus should also be removed from the game. Just moving the items isn't perfect, since they would still be placed "somewhere". With hundreds of such items there is bound to be some impact on the save game size (or something like that).
User avatar
Neil
 
Posts: 3357
Joined: Sat Jul 14, 2007 5:08 am

Post » Thu Sep 23, 2010 7:41 am

Is there a way to get rid of items droped by the player for good with a script or another way?

I need this for an event, where the player drops items from his inventory into a trigger area and based on the kind of the item a special event will happen. The items will of course be "destroyed" in the process and thus should also be removed from the game. Just moving the items isn't perfect, since they would still be placed "somewhere". With hundreds of such items there is bound to be some impact on the save game size (or something like that).

Use GetActionRef on the trigger zone script to check if the item is the one you want or use GetPCLastDroppedItem to check if the player dropped the correct item.

Use GetFirst/NextRef to locate the reference

Use "If GetSourceModIndex == 255" to make sure it is a dynamic reference and DeleteReference to remove it from the game. Or Disable, if it is not a dynamic reference.
User avatar
Eoh
 
Posts: 3378
Joined: Sun Mar 18, 2007 6:03 pm

Post » Thu Sep 23, 2010 5:59 pm

@QQuix: Thanks. LinkedDoor.IsInInterior would be better. If you know of a way to test if a cell is a cave that would be helpful too as I'm not interested in scanning those cells, although I haven't looked into it, and I don't like asking questions without putting some effort into finding the solution myself, but if you know off the top of your head, it would save me some time. Anyway, I'm actually replying to ask you about that building mesh dimension data you told me about in your construction suite. Firstly, what is the last and eighth value? I get the first 7, as you described to me. Secondly, do you have that dimension data for the IC meshes as well (it was not in any of your zvGetObject functions)? If not, can you give me some tips on how you got your data so I can figure those out myself, bearing in mind I have no experience working with nifs, although I have installed nifskope to see if I could find that data in the nodes somewhere, which I couldn't.
User avatar
Avril Louise
 
Posts: 3408
Joined: Thu Jun 15, 2006 10:37 pm

Post » Thu Sep 23, 2010 4:45 pm

Use GetActionRef on the trigger zone script to check if the item is the one you want or use GetPCLastDroppedItem to check if the player dropped the correct item.

Use GetFirst/NextRef to locate the reference

Use "If GetSourceModIndex == 255" to make sure it is a dynamic reference and DeleteReference to remove it from the game. Or Disable, if it is not a dynamic reference.


Unfortunately those are OBSE functions and I would like to avoid using them. I should have made this clear right away, sorry. So, to rephrase the question - is there a way to get rid of the dropped objects without using OBSE?
User avatar
candice keenan
 
Posts: 3510
Joined: Tue Dec 05, 2006 10:43 pm

Post » Thu Sep 23, 2010 11:52 am

Unfortunately those are OBSE functions and I would like to avoid using them. I should have made this clear right away, sorry. So, to rephrase the question - is there a way to get rid of the dropped objects without using OBSE?


No there isn't. I just went through something similar and have changed my mod so that it now requires OBSE. In my case, the saved game bloat could be significant, so I decided that it was worth using OBSE. Previously the mod just moved the disabled objects to a "trash" cell, but the game never cleared that out, so bloat was occurring. I find there's very few players that don't have OBSE loaded already, so I don't think it will be an issue. In fact I've discovered that quite a few of them have already upgraded to the new version of OBSE, even though it hasn't been out all that long.
User avatar
Kathryn Medows
 
Posts: 3547
Joined: Sun Nov 19, 2006 12:10 pm

Post » Thu Sep 23, 2010 2:47 am

Is it possible to switch run/walk animations for the player in game? Using werewolf mods as an example, I thought I read somewhere that it's possible to switch skeletons or animations on the player so that, when human, they walk normal. But when in werewolf form, can walk kind of hunched over (I'm guessing from a different animation).

Can someone point me in the direction of how to accomplish this?

Thanks.
User avatar
Victoria Vasileva
 
Posts: 3340
Joined: Sat Jul 29, 2006 5:42 pm

Post » Thu Sep 23, 2010 1:59 pm

@QQuix: Thanks. LinkedDoor.IsInInterior would be better. If you know of a way to test if a cell is a cave that would be helpful too as I'm not interested in scanning those cells, although I haven't looked into it, and I don't like asking questions without putting some effort into finding the solution myself, but if you know off the top of your head, it would save me some time.

No, I don't.
Maybe GetCellMusicType, but the docs say that it works only for the player current cell.
Alternative: checking the statics in the cell against a list of cave tile statics, but I suppose this would require a lot of research and may turn out quite heavy on processing.

Anyway, I'm actually replying to ask you about that building mesh dimension data you told me about in your construction suite. Firstly, what is the last and eighth value? I get the first 7, as you described to me.

Not sure which one you cal the 8th.
There are 6 values for the distances from the origin of the mesh to the bounding box faces
There is one, called zAngZ, that determines the Z angle of the mesh when the building is facing south. Most vanilla buildings face south at Z-angle = 0, but a few don't.
And there is one (zposZ) that gives you the distance from the mesh origin to the ground. Meaning: if you place that mesh zposZ units above a flat ground, the main door will be at street level.

Secondly, do you have that dimension data for the IC meshes as well (it was not in any of your zvGetObject functions)?

I don't have them.
The IC buildings are not a single mesh. They are a sort of a tileset and you need more than one to have a complete building and this was not fit for my purposes, so I decided to drop them.

If not, can you give me some tips on how you got your data so I can figure those out myself, bearing in mind I have no experience working with nifs, although I have installed nifskope to see if I could find that data in the nodes somewhere, which I couldn't.

I also don't know a thing about nifs.
What I did was creating an auxiliary mod just to do that: measure the meshes.
It generates the scripts used in the published mod (the zvGetObject functions)

To measure the meshes I tried many approaches, from projectiles to several ways of using GetLOS, but what I finally used was raining cats and dogs over the meshes (only very small dogs, actually. lol).
I positioned a few hundred dogs in a pattern, way above the building and let them fall. Each dog was scripted to record its z position at the moment it stopped falling. The highest z-position determining the height of the building. Repeat the process with all the six faces and there you are.

This process was another reason I dropped the IC buildings: many of the IC meshes don't have all the 6 faces for the dogs to land on, and the process does not work.

The only suggestion I can give you is the hard work of measuring some selected IC meshes by hand, in the CS, using http://www.tesnexus.com/downloads/file.php?id=27291
User avatar
BEl J
 
Posts: 3397
Joined: Tue Feb 13, 2007 8:12 am

Post » Thu Sep 23, 2010 11:36 am

No, I don't.
Alternative: checking the statics in the cell against a list of cave tile statics, but I suppose this would require a lot of research and may turn out quite heavy on processing.

No problem. I'm actually working on putting some of this stuff into an obse plugin, if possible, so the performance might not be so bad if there isn't another way. I've actually already got most of your building mesh data into a map structure in an obse plugin, and while I haven't tested it thoroughly, finding the desired data in the map appears to be reasonably efficient. Certainly better than an oblivion script with a massive if/elseif structure.

Not sure which one you cal the 8th.

Yeah, it was the angle. I thought it was an angle of some sort, given that most values where either 0 or 90. I pretty much guessed what you said, just wanted to check.

The only suggestion I can give you is the hard work of measuring some selected IC meshes by hand, in the CS, using http://www.tesnexus.com/downloads/file.php?id=27291

That was one hefty procedure. As its only the IC, measuring manually might not be so bad. Thanks for the link, will definitely check it out.
User avatar
Christine Pane
 
Posts: 3306
Joined: Mon Apr 23, 2007 2:14 am

Post » Thu Sep 23, 2010 3:27 am

Is there any ID of an object or anything that I can use to change where the player starts off at after creation?
User avatar
Jaylene Brower
 
Posts: 3347
Joined: Tue Aug 15, 2006 12:24 pm

Post » Thu Sep 23, 2010 5:45 am

How do you clear the ownership on an item? "SetOwnership 0" doesn't work and leaving "Owner" blank sets it to player instead.
User avatar
Amy Smith
 
Posts: 3339
Joined: Mon Feb 05, 2007 10:04 pm

Post » Thu Sep 23, 2010 9:31 am

I'm trying to figure out the obse function "SetScript". I can't get it to work. The test script I've set up is a spell effect that sets a script to the currently equipped weapon.

The spell script that sets the script
Spoiler
scn MfSpellSetScriptRef WeaponRef MfSetScriptTarBegin GameModeSet Weapon to Player.GetEquippedObject 16Weapon.SetScript MfSetScriptTar Player.UnequipItem weaponPlayer.EquipItem WeaponEnd


The simple test script
Spoiler
scn MfSetScriptTarShort ControlVarBegin OnEquip	If ControlVar == 0		MessageBox "Test 1 2 3"		Set ControlVar to 1	EndIfEnd


The spell script un/re-equips the weapon which I thought would start the OnEquip script on the weapon. But it doesn't.
User avatar
Jaylene Brower
 
Posts: 3347
Joined: Tue Aug 15, 2006 12:24 pm

Post » Thu Sep 23, 2010 2:21 pm

I have a few basic ones:

Is there any decent document online that lists ALL script functions for Oblivion? I read the UESP list but it's incomplete.

1: How do I make the player 100% invisible, literally. I don't even want to see a clear outline or even so much as a blur. I need to be able to make the player completely gone, but still controlable.

2: What is the function for "force 1st person" and "force 3rd person"

3: What is the function that allows me to monitor the input from a keyboard button? (example: Press H to activate)

4: What function do I use to delete an object permanently? I'm under the impression that Disable won't delete the reference in the save file so there will end up being references to deleted objects if I just use 'Disable'.


Thanks!
User avatar
Prisca Lacour
 
Posts: 3375
Joined: Thu Mar 15, 2007 9:25 am

Post » Thu Sep 23, 2010 11:19 am

Is there any decent document online that lists ALL script functions for Oblivion? I read the UESP list but it's incomplete.


I don't know the answer to your other questions, sorry, but I do know that all the script functions are listed http://cs.elderscrolls.com/constwiki/index.php/List_of_Functions. There are also a lot other ones that aren't listed there, but are found in the OBSE documentation.
User avatar
helen buchan
 
Posts: 3464
Joined: Wed Sep 13, 2006 7:17 am

Post » Thu Sep 23, 2010 4:35 pm

I don't know the answer to your other questions, sorry, but I do know that all the script functions are listed http://cs.elderscrolls.com/constwiki/index.php/List_of_Functions. There are also a lot other ones that aren't listed there, but are found in the OBSE documentation.


Thank you, that will help me out a ton!

I think I found the answet to one of my questions, but I'm trying to understand a few functions:

"player.SetActorAlpha 0.0" seems like what I want to use for making the player invisible, confirm?
"GetGameSetting fChase3rdPersonXYMult" the closest thing I found to checking/changing the status of the player camera mode (1st/3rd)
I'm also wondering what "con_ToggleDetection" does. In the Wiki, it just says "Mirrors TDETECT", but I'm not sure what that is either.
User avatar
Chelsea Head
 
Posts: 3433
Joined: Thu Mar 08, 2007 6:38 am

Post » Thu Sep 23, 2010 4:37 am

3: What is the function that allows me to monitor the input from a keyboard button? (example: Press H to activate)

IsKeyPressed or IsKeyPressed2. In the obse docs http://obse.silverlock.org/obse_command_doc.html#Input_Functions
For example, put this in a gamemode block

Spoiler
if ( curKey && isKeyPressed2 curkey ) ; key still being held down  	return ; wait until it's releasedelse	set curkey to 0endifif ( isKeyPressed2 35 )  			MessageEx "H pressed"        set curKey to 35endif

You'll also need to have your fQuestDelayTime low enough such that it will execute whenever the key is actually pressed, otherwise it wont register.

I don't know the answer to your other questions, sorry, but I do know that all the script functions are listed http://cs.elderscrolls.com/constwiki/index.php/List_of_Functions.

I've found that link not to be entirely up to date, at least last time I checked it which was a little while ago now, so it might be up to date now, but I prefer http://cs.elderscrolls.com/constwiki/index.php/Category:Functions. It's easier to navigate too.
User avatar
*Chloe*
 
Posts: 3538
Joined: Fri Jul 07, 2006 4:34 am

Post » Thu Sep 23, 2010 8:15 am

2: What is the function for "force 1st person" and "force 3rd person"


http://cs.elderscrolls.com/constwiki/index.php/IsThirdPerson + http://cs.elderscrolls.com/constwiki/index.php/ToggleFirstPerson

4: What function do I use to delete an object permanently? I'm under the impression that Disable won't delete the reference in the save file so there will end up being references to deleted objects if I just use 'Disable'.


http://cs.elderscrolls.com/constwiki/index.php/DeleteReference
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am

Post » Thu Sep 23, 2010 6:37 pm

http://cs.elderscrolls.com/constwiki/index.php/IsThirdPerson + http://cs.elderscrolls.com/constwiki/index.php/ToggleFirstPerson


http://cs.elderscrolls.com/constwiki/index.php/DeleteReference


QQuix...


Exactly what I needed, thank you both! And thanks for suggesting this thread, QQuix. I was up all night reading all of the previous pages and learned quite a bit / answered some questions.

This should be all the info I need to make a quick demo of the "Oblivion Building Utility" mod.

Cheers!
User avatar
Kira! :)))
 
Posts: 3496
Joined: Fri Mar 02, 2007 1:07 pm

PreviousNext

Return to IV - Oblivion