Quick Questions -- Quick Answers, The Seventeenth

Post » Fri May 27, 2011 1:51 am

Sixteenth Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=1035831
Fifteenth Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=1027524
Fourteenth Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=1020604
Thirteenth Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=1018432
Twelfth Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=1008041
Eleventh Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=996298
Tenth Thread : http://www.gamesas.com/bgsforums/index.php?showtopic=974783
Ninth Thread: http://www.gamesas.com/bgsforums/index.php?showtopic=957607
Eighth Thread: http://www.gamesas.com/bgsforums/index.php?showtopic=937577
Seventh Thread: http://www.gamesas.com/bgsforums/index.php?showtopic=912613
Sixth Thread: http://www.gamesas.com/bgsforums/index.php?showtopic=878165

Got a quick question? Post here for a quick response.
User avatar
Amber Ably
 
Posts: 3372
Joined: Wed Aug 29, 2007 4:39 pm

Post » Fri May 27, 2011 4:50 am

can i export a cell's terrain as a mesh i can open in 3dsmax, including textures and shadows?
User avatar
dell
 
Posts: 3452
Joined: Sat Mar 24, 2007 2:58 am

Post » Fri May 27, 2011 7:22 am

Does anyone know of a list of unused game settings? The cs wiki doesn't have to much information about the least common ones, and I've found quite a few which seem to have been abandoned at some stage in development but were left in the game. Examples like sHeavyArmorSink and sHeavyArmorNoJump which seem to indicate that novice heavy armor players would sink in water and be unable to jump, and sPotionFailed which suggests that making potions could fail like in Morrowind.
Also, is there some way of adding those unused game settings' features back, or the obvious answer is "if there was some way, somebody would have done it long ago without even using obse"?:D
User avatar
Emma louise Wendelk
 
Posts: 3385
Joined: Sat Dec 09, 2006 9:31 pm

Post » Thu May 26, 2011 7:48 pm

What's a script i could use to have a spell damage health using this formula
Playerluck/10 * multiplyermultiplyer is a random number from 1-10

User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am

Post » Fri May 27, 2011 8:16 am

Got a quick question? Post here for a quick response.
In the last thread you mentioned disabling and re-enabling a frame later. Is this done in a different way than just using a countdown timer, because my timer didn't seem to affect anything even with a huge number like 10000. Does a Label/Goto prevent the script from advancing a frame? Do I have to use GetSecondsPassed in order to advance a frame?
User avatar
Hella Beast
 
Posts: 3434
Joined: Mon Jul 16, 2007 2:50 am

Post » Fri May 27, 2011 6:58 am

In the last thread you mentioned disabling and re-enabling a frame later. Is this done in a different way than just using a countdown timer, because my timer didn't seem to affect anything even with a huge number like 10000. Does a Label/Goto prevent the script from advancing a frame? Do I have to use GetSecondsPassed in order to advance a frame?

Using a timer is basically equivalent to enabling some n frames later. Control structures like a Label/Goto and while loops start and complete execution in a single frame. No. A script completes processing for the current frame when it reaches its end. The next iteration will be running in the subsequent frame. You can construct if clauses to perform operations in subsequent frames
if ( sProc == 1 )   someObj.disable   let sProc := 2   return  ; skip processing the rest of the script for the current frameelseIf (sProc == 2 )   someobj.enable   let sProc := 3endIf

User avatar
Stephanie Valentine
 
Posts: 3281
Joined: Wed Jun 28, 2006 2:09 pm

Post » Fri May 27, 2011 8:15 am

Hopefully a quick question, why do my Water in different heigts (changed in cell editor) not appear when i generated the Distant Land

Bump
User avatar
willow
 
Posts: 3414
Joined: Wed Jul 26, 2006 9:43 pm

Post » Fri May 27, 2011 10:02 am

Hopefully a quick question, why do my Water in different heigts (changed in cell editor) not appear when i generated the Distant Land
The answer and solution can be found in http://www.gamesas.com/bgsforums/index.php?showtopic=965089.
User avatar
Vivien
 
Posts: 3530
Joined: Fri Apr 13, 2007 2:47 pm

Post » Thu May 26, 2011 10:00 pm

ref rTargetset rTarget to GetCrosshairRef


How do I check to see if rTarget returned a valid target?

if !(rTarget.IsValidReference) doesn't seem to work.

if rTarget <= 0 also doesn't seem to work.
User avatar
Devils Cheek
 
Posts: 3561
Joined: Sun Aug 13, 2006 10:24 pm

Post » Fri May 27, 2011 3:13 am

ref rTargetset rTarget to GetCrosshairRef


How do I check to see if rTarget returned a valid target?

if !(rTarget.IsValidReference) doesn't seem to work.

if rTarget <= 0 also doesn't seem to work.

if rTarget

or
if rTarget != 0

both works (and is essentially the same)
User avatar
ZANEY82
 
Posts: 3314
Joined: Mon Dec 18, 2006 3:10 am

Post » Fri May 27, 2011 9:21 am

if rTarget

or
if rTarget != 0

both works (and is essentially the same)


ref rTargetset rTarget to GetCrossHairRefif !(rTarget.IsValidReference) returnendifif rTarget <= 0 returnendifif rTarget == player returnendifrTarget.killprintc %i rTarget


In making a script that is supposed to kill things you attack in their sleep, I discovered that this script will kill the player and print '0' to the console. I don't get it.
User avatar
Zach Hunter
 
Posts: 3444
Joined: Wed Aug 08, 2007 3:26 pm

Post » Thu May 26, 2011 10:50 pm

In making a script that is supposed to kill things you attack in their sleep, I discovered that this script will kill the player and print '0' to the console. I don't get it.


if !(rTarget.IsValidReference)
This line is broken for at least two reasons:

IsValidReference is not supported. Use "!= 0" or "IsFormValid" instead to check for its validity.

But even more important is a general programming rule: Whenever you make a call on the form "ref.SomeFunc", the script will fail if ref is not a valid ref. That is why you must call "IsValidReference rTarget" and not "rTarget.IsValidReference".

Anyway, replace your code with:
ref rTargetset rTarget to GetCrossHairRefif rTarget  == 0 || rTarget == player  returnendifrTarget.killprintc "%i" rTarget

...and try again

Of course, you may want to check that rTarget is a non-dead NPC/creature before you attempt to kill it too.
User avatar
kitten maciver
 
Posts: 3472
Joined: Fri Jun 30, 2006 2:36 pm

Post » Fri May 27, 2011 2:47 am

...And I wonder why I don't participate in forums much. My posts are invisible. Not to worry though, this thread has very indirectly lead me to what could be a much more elegant solution to my problem, via TESAnnwyn.
User avatar
Mrs. Patton
 
Posts: 3418
Joined: Fri Jan 26, 2007 8:00 am

Post » Fri May 27, 2011 10:45 am

Question about SaveIP/RestoreIP: Does your jump-to point (SaveIP) have to be an ...."accessable".... condition before RestoreIP can be used? For example:

I have SaveIP in an if condition that has yet to return true.
if ( myvar == 1 )	 SaveIP	 more stuff happensendif


If I call RestoreIP at some point in the script before myvar is set to 1, will the script still jump to SaveIP and process everything after it (basically bypassing the requirements of the condition)?

I ask because I'm having trouble getting some parts of my scrip following a SaveIP to process after the RestoreIP is called. It could be something completely different, but I noticed I had the SaveIP in an if statement and want to make sure that's not the problem before I go tearing my script apart to find the issue.

Thanks.
User avatar
Dj Matty P
 
Posts: 3398
Joined: Sat Jun 09, 2007 12:31 am

Post » Fri May 27, 2011 4:57 am

Question about SaveIP/RestoreIP: Does your jump-to point (SaveIP) have to be an ...."accessable".... condition before RestoreIP can be used?
Yup. RestoreIP/Goto needs to know which label to jump to. The label must be parsed before it can be used. If not, the goto call will freeze up script processing, and the game.
User avatar
Sunny Under
 
Posts: 3368
Joined: Wed Apr 11, 2007 5:31 pm

Post » Fri May 27, 2011 8:34 am

How do i generate DistantLod files for my worldspace. I'm having problems with some meshes not showing from distance
User avatar
Lil'.KiiDD
 
Posts: 3566
Joined: Mon Nov 26, 2007 11:41 am

Post » Thu May 26, 2011 8:06 pm

I'm trying to manually integrate two mods, and this requires changing the textures and meshes in the body and face data of race edition screen. The selected texture/mesh has a path too long to see what file is actually selected on the button, so is there a way to show the full path and file?
User avatar
Dagan Wilkin
 
Posts: 3352
Joined: Fri Apr 27, 2007 4:20 am

Post » Fri May 27, 2011 5:07 am

Is it common for the editor to give me Error Chimes every time I click something? Also for certain cells to become imune to ground texture changes?
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Thu May 26, 2011 9:39 pm

Question on how best to detect hostile actors. I already tried GetShouldAttack but as the wiki says it is unreliable. It also gives an alternative by using the actors aggression vs their disposition towards you. Although this works most of the time, it does not work when I attack a normally-friendly-actor, lets say a shopkeeper. Since his aggression does not seem to change and their disposition only drops by 20 or so (and thus still well above their aggression) this methode won't return true either.

I considered using GetCombatTarget to verify they are attacking the player but this won't work for my purpose. Mainly because I need all of this for a companion, thus once the shopkeeper shifts combat from the player to the companion, all the scripting would indicate the shopkeeper is no longer hostile. Which is wrong, obviously, as soon as I remove my companion from the scene (or kill him) the shopkeeper continues his combat with me. :shrug:

Such is the dilemma I am facing. Any help would be nice. :(

-kyoma
User avatar
Cassie Boyle
 
Posts: 3468
Joined: Sun Nov 05, 2006 9:33 am

Post » Fri May 27, 2011 10:35 am

Are companions always in a faction with the PC? Might be able to see if the combat target is an ally that way?

"ref.GetinFaction PlayerFaction" perhaps?
User avatar
Miranda Taylor
 
Posts: 3406
Joined: Sat Feb 24, 2007 3:39 pm

Post » Fri May 27, 2011 9:41 am

Are companions always in a faction with the PC? Might be able to see if the combat target is an ally that way?

"ref.GetinFaction PlayerFaction" perhaps?
No they're not in the player faction, but I can do that. Although I'm not sure how this helps me with determining if the companion's combat target is actually hostile towards the player. :unsure:
User avatar
Tanya Parra
 
Posts: 3435
Joined: Fri Jul 28, 2006 5:15 am

Post » Fri May 27, 2011 3:28 am

The Player is in PlayerFaction. I thought most companions would be too, since that seems to be the purpose of PlayerFaction.

I thought you were looking for a way to determine if an NPC was hostile to either the player or the companion. Getting the NPCs CombatTarget and then checking if that target is in PlayerFaction would tell you if the NPC was targeting either the player or a companion.

Or maybe I'm turned around and you actually want to do the reverse of what I thought.

edit: From the wiki it looks like GetShouldAttack will work if you are in the same cell and visible. Maybe you need to use a combination of the Disposition/Aggression comparison and GetShouldAttack to get the result you want?
User avatar
Lady Shocka
 
Posts: 3452
Joined: Mon Aug 21, 2006 10:59 pm

Post » Thu May 26, 2011 10:24 pm

The Player is in PlayerFaction. I thought most companions would be too, since that seems to be the purpose of PlayerFaction.

I thought you were looking for a way to determine if an NPC was hostile to either the player or the companion. Getting the NPCs CombatTarget and then checking if that target is in PlayerFaction would tell you if the NPC was targeting either the player or a companion.

Or maybe I'm turned around and you actually want to do the reverse of what I thought.
No you are correct, that is what I'm trying to do. But I also left something out, that is that there might be situations where the companion would initiate combat with something that should not and does not attack the player. So to expand on my example, if my companion were to initiate combat with the shopkeeper and the shopkeeper begins to fight back, I cannot simply check the combat target for the player or the companion. Cause the companion should stop fighting since the shopkeeper does not want to fight the player.

Basically, I wanna stop any fight the companion is having with someone that does not want to fight the player.
edit: From the wiki it looks like GetShouldAttack will work if you are in the same cell and visible. Maybe you need to use a combination of the Disposition/Aggression comparison and GetShouldAttack to get the result you want?
Yes, often the function works. It is mostly with actors that start out friendly but then turn hostile (e.g. I assaulted them) for which the function keeps returning a negative value.

If all else fails I might be able to make a hybrid using all three methodes so far, it'll probably work fine for most combat situations. Anyway, thanks for the reply. :)

-kyoma
User avatar
Kate Murrell
 
Posts: 3537
Joined: Mon Oct 16, 2006 4:02 am

Post » Fri May 27, 2011 1:15 am

What is the best way to check if the NPC you're in dialog with is a merchant?

In the current version of Enhanced Economy, I check if the barter button is visible, but I have a nagging suspicion that the button may be invisible for a few frames for some players, and this breaks my logic.

I consider using OBSE's GetServicesMask funtion, and then use the result and make a LogicalAnd with 13727 (all service flags except Spells, Training, Recharge and Repair) - or simply calling all the relevant OffersXXX functions and assuming he is a merchant if at least one returns true.

But is there a simpler way of finding out if he is a merchant?
User avatar
Tom Flanagan
 
Posts: 3522
Joined: Sat Jul 21, 2007 1:51 am

Post » Fri May 27, 2011 12:19 am

Too bad nobody answered my previous question, I'll try with something more practical.
I'm trying to make a script that will add crime gold to your character if you try to sell something "illegal", but I don't know how to force an exit of the bartering menu or some way to avoid the sell to take place. Is there some way? Also, what's better or less prone to conflicts, using modcrimegold or setcrimegold?
BTW TheNiceOne, would you consider adding this feature to your Enhanced Economy mod for dealing with skooma? I like the features of your mod very much, and the only thing I'm waiting for using it is for Obse to come out of beta.
User avatar
Lisa
 
Posts: 3473
Joined: Thu Jul 13, 2006 3:57 am

Next

Return to IV - Oblivion