Quick Questions -- Quick Answers, The Sixteenth

Post » Fri May 27, 2011 4:29 am

Hi,
Hopefully, a quick question. Is there a function that returns the X, Y coordinates of an object in the worldspace. I really just want to return the player's X Y coordinates.

thanks
a


http://cs.elderscrolls.com/constwiki/index.php/GetPos ;)
User avatar
Wayland Neace
 
Posts: 3430
Joined: Sat Aug 11, 2007 9:01 am

Post » Fri May 27, 2011 11:59 am

http://cs.elderscrolls.com/constwiki/index.php/GetPos ;)


Thanks,
but it isn't precisely what I am looking for. I wanted a command to tell me the cell that I am in (cell 0, 0 or 30, -19) something like that.

thanks again,
George
User avatar
Alberto Aguilera
 
Posts: 3472
Joined: Wed Aug 29, 2007 12:42 am

Post » Thu May 26, 2011 9:13 pm

Exterior cells are 4096 x 4096 units (http://cs.elderscrolls.com/constwiki/index.php/Oblivion_Units)

So, divide the position obtained with GetPos by 4096 and you have the cell coordinates.

Something like:

	set xPosX to player.getpos X	set xPosY to player.getpos Y	set xCol to xPosX  / 4096	if xPosX < 0		set xCol to xCol - 1	endif	set xRow to xPosY  / 4096	if xPosY < 0		set xRow to xRow  - 1	endif	messageex "You are in cell  %g, %g" xCol xRow

User avatar
Marine Arrègle
 
Posts: 3423
Joined: Sat Mar 24, 2007 5:19 am

Post » Fri May 27, 2011 4:05 am

Exterior cells are 4096 x 4096 units (http://cs.elderscrolls.com/constwiki/index.php/Oblivion_Units)

So, divide the position obtained with GetPos by 4096 and you have the cell coordinates.

Something like:

	set xPosX to player.getpos X	set xPosY to player.getpos Y	set xCol to xPosX  / 4096	if xPosX < 0		set xCol to xCol - 1	endif	set xRow to xPosY  / 4096	if xPosY < 0		set xRow to xRow  - 1	endif	messageex "You are in cell  %g, %g" xCol xRow



Thanks for this. I didn't realize that it needed to be calculated.

a
User avatar
natalie mccormick
 
Posts: 3415
Joined: Fri Aug 18, 2006 8:36 am

Post » Fri May 27, 2011 4:19 am

Can someone give me a quick rundown on the difference between Ambient, Diffuse, Specular, and Emissive colors of a nif?
User avatar
Kayleigh Mcneil
 
Posts: 3352
Joined: Thu Jun 29, 2006 7:32 am

Post » Fri May 27, 2011 7:17 am

Can someone give me a quick rundown on the difference between Ambient, Diffuse, Specular, and Emissive colors of a nif?

I'm not sure there is a difference between Ambient and Diffuse, I've seen both terms applied to the same thing, i.e. the basic color of the item under normal light, which is the RBG portion of the texture map, with alpha providing transparency.

Specular is the glossiness of the material, i.e how much it will reflect the light falling on it, stored in the alpha channel of the normal map. Since it doesn't have any color of its own, depending on the incident light for that, it only needs a single channel to store it. The RGB portion of the normal map is used to encode the direction of the normals of the surface, i.e. which direction the surface faces, letting you put more bumpiness into each triangle of the mesh, simulating a higher-poly mesh than you actually have, so it's not actually a color as such.

Emissive is light emitted, rather than reflected, by the object, i.e the glow map. Not all items will have one.
User avatar
Robert Jackson
 
Posts: 3385
Joined: Tue Nov 20, 2007 12:39 am

Post » Fri May 27, 2011 10:47 am

Can someone give me a quick rundown on the difference between Ambient, Diffuse, Specular, and Emissive colors of a nif?

Emmisive is used with glow maps. Just gray scale the glow map then set the emmisive color on the nif file to whatever color you want.
User avatar
Assumptah George
 
Posts: 3373
Joined: Wed Sep 13, 2006 9:43 am

Post » Thu May 26, 2011 11:30 pm

Ok that brings up another question then. I'm using nifskope, and where you can edit the light properties of a nif, you're given a color wheel for each parameter. If the light properties are stored in the various channels of the texture maps, which I could most likely change in any given graphics program I use (Photoshop, Fireworks, Gimp, etc), what is the use of changing the color setting on the wheels? Is that like an alternative for a nif that doesn't have an attached texture or normal/glow map?

EDIT: Another completely unrelated question: I've been searching for information on how to edit the UI. All I want to do is add an extra icon to the HUD. Is there a simple tutorial around to explain how to do this, or is it a matter of learning XML and figuring it out myself?
User avatar
XPidgex Jefferson
 
Posts: 3398
Joined: Fri Sep 08, 2006 4:39 pm

Post » Fri May 27, 2011 5:11 am

Hi,

I'm adding my own spell to an actor (a merchant). The spell is an ability with my own script attached. My problem is that I need the script to run immediately when I add it (using AddSpell), even if there is currently a menu open. I have tried with Begin ScriptEffectStart and Begin MenuMode, but the MenuMode block is never run, and the ScriptEffectStart block is not run until I exit any menu.

So my question is - is thera a way to set the spell/script up so that the script gets run (at least once) immediately, even if in a menumode?
User avatar
Laura Samson
 
Posts: 3337
Joined: Wed Aug 29, 2007 6:36 pm

Post » Fri May 27, 2011 1:53 am

I created a non armor "cloth" offhand version of http://www.tesnexus.com/downloads/file.php?id=20224 using the armor offhand version meshs already contained in the mod.
Now I experienced a couple of odd issues. Whenever the staff is removed and readded into my hand (because I summon a weapon, sit down or a script force unequips it, or just if I reload a savegame without restarting Oblivion) it won't show up in my hand but is shown as equipped in the inventory. Anyone know the reason for this behaviour?


Noone?
User avatar
Celestine Stardust
 
Posts: 3390
Joined: Fri Dec 01, 2006 11:22 pm

Post » Fri May 27, 2011 12:37 am

So my question is - is thera a way to set the spell/script up so that the script gets run (at least once) immediately, even if in a menumode?
Use a token - It's onAdd block runs in menumode as well. Similarly, the onActivate block.
User avatar
Jack Bryan
 
Posts: 3449
Joined: Wed May 16, 2007 2:31 am

Post » Thu May 26, 2011 11:41 pm

Is there a way to script buying or selling?
User avatar
Robert Bindley
 
Posts: 3474
Joined: Fri Aug 03, 2007 5:31 pm

Post » Fri May 27, 2011 5:29 am

Ok, this is more of a question about OBMM but I don't really know a better place to ask. With an OMOD script, is there a way to run something when the mod is deactivated (similar to when it is activated)? I think I already know the anwser but someone with a bit more knowledge of OBMM might know something. :shrug:

DerekBaker: If scripted buying and selling you mean moving items between inventories while retaining their individual extra data then you can try http://cs.elderscrolls.com/constwiki/index.php/Category:RefStuff. But you probably already knew that. I don't think there are alternatives right now, maybe when OBSE v19 comes into the picture.
User avatar
Samantha hulme
 
Posts: 3373
Joined: Wed Jun 21, 2006 4:22 pm

Post » Thu May 26, 2011 8:21 pm

shadeMe, I guess you're right. I will test if the OnAdd block runs soon enough for my needs.


Is there a way to script buying or selling?

What kind of buying and selling? Buying of houses is scripted in the game, (a dialog topic, where the response has a result script that removes the money and adds the ownership of the house). You could look at that. Instead of house ownership, you could add the bought item. More general buying/selling is harder to script.
User avatar
Lynne Hinton
 
Posts: 3388
Joined: Wed Nov 15, 2006 4:24 am

Post » Fri May 27, 2011 11:00 am

I'm way behind on this stuff, but an old idea is stuck in my brain now and I need a quick question quick answered.

If I make a cloneform of an item it gets saved in the savegame, correct? So, if I use setmalebipedpath (or whatever the correct spelling is) to alter the model for a cloned item, will that change get saved in the savegame as well, and therefore preserved on reloading? Or will I need to either store the path some other way, or reacquire it on every load?
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Fri May 27, 2011 1:02 am

Ok, this is more of a question about OBMM but I don't really know a better place to ask. With an OMOD script, is there a way to run something when the mod is deactivated (similar to when it is activated)? I think I already know the anwser but someone with a bit more knowledge of OBMM might know something. :shrug:
Can be done with a C# script - Look for the plugin file in the Plugins.txt file the game generates ( should be in %AppData%\Oblivion ) and check if your plugin's name's present in the list ( a simple System.String.Compare would do ). From what I can tell, Timeslip hasn't defined any methods to do just that using an OBMM script.

If I make a cloneform of an item it gets saved in the savegame, correct? So, if I use setmalebipedpath (or whatever the correct spelling is) to alter the model for a cloned item, will that change get saved in the savegame as well, and therefore preserved on reloading? Or will I need to either store the path some other way, or reacquire it on every load?
From my testing ( and confirmations from behippo ), changes to clone forms persist and are saved to the game saves.
User avatar
Chris BEvan
 
Posts: 3359
Joined: Mon Jul 02, 2007 4:40 pm

Post » Fri May 27, 2011 12:00 pm

I'm hoping for some help modifying a pair of daedric gauntlets in nifskope. I want to add a few nifs to them (rubies) to make a pair of ruby studded gauntlets. I've pasted a few copies of ruby branches and placed where I want them on the gauntlets. I didn't change the original gauntlet NiTriStrip, but I added each ruby NiTriStrip to the main NiNode's Children list, updated all tangent spaces and saved the whole thing as a new nif into the armor folder of the Data directory. I made a new armor object for the gauntlets in the CS, saved it and loaded it up. But when I add the studded gauntlets to the player and equip them, the rubies are not there, only the gauntlets. What am I not doing right in nifskope? I've spliced armor/armor and weapon/weapon pieces together before with a lot of success, but I've never tried splicing a static or havok item to armor before. Can it be done?
User avatar
laila hassan
 
Posts: 3476
Joined: Mon Oct 09, 2006 2:53 pm

Post » Thu May 26, 2011 11:29 pm

Is there a reason why
r.activate player 1
doesn't result in a guard recognizing a crime has been committed, when r is a reference to a stolen object, but
r.activate player
does?
User avatar
Sylvia Luciani
 
Posts: 3380
Joined: Sun Feb 11, 2007 2:31 am

Post » Fri May 27, 2011 11:11 am

It's been ten months since I tried modding and I think my brain has atrophied.

Does basic Oblivion or OBSE provide a way to run a function when a container is closed or do I simply use a menumode block with a switch so it runs only once after each time the container has been opened?

edit: Also, is there any way to force an armor mesh to display with a particular skin tone (I want to make that part transparent)? Or simply a way to remove the skin portions entirely?
User avatar
Chris Johnston
 
Posts: 3392
Joined: Fri Jul 07, 2006 12:40 pm

Post » Fri May 27, 2011 8:11 am

Does basic Oblivion or OBSE provide a way to run a function when a container is closed or do I simply use a menumode block with a switch so it runs only once after each time the container has been opened?


When I want a command or function triggered when something is closed, I do it this way:

short closedBegin OnActivateif ( closed == 0 )   set closed to 1   ActivateEndBegin Gamemodeif ( closed == 1 )   do stuff   set closed to -1;  Or set closed back to 0 if you want this done after every time the container is closed.endifEnd

Works pretty good for me when I want something done after the player closes a book.
User avatar
Bryanna Vacchiano
 
Posts: 3425
Joined: Wed Jan 31, 2007 9:54 pm

Post » Fri May 27, 2011 6:31 am

Is there a reason why
r.activate player 1
doesn't result in a guard recognizing a crime has been committed, when r is a reference to a stolen object, but
r.activate player
does?
Might have something to do with the http://cs.elderscrolls.com/constwiki/index.php/Activate
User avatar
Elisabete Gaspar
 
Posts: 3558
Joined: Thu Aug 31, 2006 1:15 pm

Post » Fri May 27, 2011 11:51 am

When I want a command or function triggered when something is closed, I do it this way:

Works pretty good for me when I want something done after the player closes a book.
Yeah, that's pretty much what I did, and it works, but for the life of me I can't remember whether Oblivion will only check the "closed" reference immediately after you close the container, or whether it will continue to run that script continuously in GameMode. Even if it does, the check is really quick, but I couldn't recall whether that was good practice or not.
User avatar
Ymani Hood
 
Posts: 3514
Joined: Fri Oct 26, 2007 3:22 am

Post » Fri May 27, 2011 12:07 pm

Why do you put "()" / "parentheses" around your conditions?
what happens if you don't?
User avatar
vanuza
 
Posts: 3522
Joined: Fri Sep 22, 2006 11:14 pm

Post » Fri May 27, 2011 12:52 am

Why do you put "()" / "parentheses" around your conditions?
what happens if you don't?
Nothing terrible, they are only required when you need to change the precedence of conditions or assignment (like with math things)
set result to 100 - 5 * 2	;this is 100 - 10 = 90set result to (100 - 5) * 2		 ;this is 95 * 2 = 190
Alot of modders always use it, either due to habbit from other scripting languages or cause they like how it looks. In the end it all depends on the modder.

P.S. parentheses around the entire condition don't serve a real purpose, since everything is inside them there is no change to the precedence of parts of the condition.
User avatar
Andrew Tarango
 
Posts: 3454
Joined: Wed Oct 17, 2007 10:07 am

Post » Thu May 26, 2011 7:47 pm

How would I separate an esp into an esm library (for armors, clothes, items) and an esp to refer to it....without pulling my hair out?
User avatar
Javier Borjas
 
Posts: 3392
Joined: Tue Nov 13, 2007 6:34 pm

PreviousNext

Return to IV - Oblivion