Quick Questions -- Quick Answers, The 26th

Post » Thu Sep 23, 2010 2:20 am

Previous Thread : http://www.gamesas.com/index.php?/topic/1110872-quick-questions-quick-answers-the-25th/

Got a quick question? Post here for a quick-ish response.
User avatar
Natalie J Webster
 
Posts: 3488
Joined: Tue Jul 25, 2006 1:35 pm

Post » Wed Sep 22, 2010 4:43 pm

OK, I got two:

I have an NPC who gets drunk and dances. At the end of the dance (which is scheduled, so just driven by time), I want her to fall down on the floor.

1) what's the best way to have an NPC fall down and stay there? SetAV to zero for both fatigue (for the collapse) and Endurance (to prevent regaining fatigue)?
2) what do I need to ensure the collapse happens at the right time - OnPackageChange with a scheduled new package after the first?
User avatar
Joey Avelar
 
Posts: 3370
Joined: Sat Aug 11, 2007 11:11 am

Post » Wed Sep 22, 2010 7:04 pm

OK, I got two:

I have an NPC who gets drunk and dances. At the end of the dance (which is scheduled, so just driven by time), I want her to fall down on the floor.

1) what's the best way to have an NPC fall down and stay there? SetAV to zero for both fatigue (for the collapse) and Endurance (to prevent regaining fatigue)?
2) what do I need to ensure the collapse happens at the right time - OnPackageChange with a scheduled new package after the first?


Perhaps a paralyze effect (or modified version to remove the visuals of the effect) added at the end of the dance for however long of a duration that you wanted her to stay there.
User avatar
George PUluse
 
Posts: 3486
Joined: Fri Sep 28, 2007 11:20 pm

Post » Wed Sep 22, 2010 4:14 pm

@Ghastly: Try using http://cs.elderscrolls.com/constwiki/index.php/SetUnconscious It sounds like it's just what you need.

I'm having a bit of trouble changing the Havok on an item. Currently, the item behaves like an immobile activator. What I want it to do is behave like clutter, so it will move when hit by something. So far, I've changed:

Layer and Layer Copy to OL_CLUTTER
Collision response to RESPONSE_SIMPLE_CONTACT
Motion System to MO_SYS_BOX
Deactivator Type to DEACTIVATOR_SPATIAL
SolverDeactivation to SOLVER_DEACTIVATION_LOW
Motion Quality to MO_QUAL_DEBRIS

but it still doesn't behave like clutter. What else am I missing?
User avatar
Amysaurusrex
 
Posts: 3432
Joined: Wed Aug 09, 2006 2:45 pm

Post » Wed Sep 22, 2010 3:59 pm

@Ghastly: Try using http://cs.elderscrolls.com/constwiki/index.php/SetUnconscious It sounds like it's just what you need.

I'm having a bit of trouble changing the Havok on an item. Currently, the item behaves like an immobile activator. What I want it to do is behave like clutter, so it will move when hit by something. So far, I've changed:

Layer and Layer Copy to OL_CLUTTER
Collision response to RESPONSE_SIMPLE_CONTACT
Motion System to MO_SYS_BOX
Deactivator Type to DEACTIVATOR_SPATIAL
SolverDeactivation to SOLVER_DEACTIVATION_LOW
Motion Quality to MO_QUAL_DEBRIS

but it still doesn't behave like clutter. What else am I missing?


Those settings sound about right -- does it have any settings in Mass - Linear and angular damping - Max Linear and angular Velocity - etc. ? without Mass there is nothing to move so that might be the problem if it is set to 0.
User avatar
Hannah Barnard
 
Posts: 3421
Joined: Fri Feb 09, 2007 9:42 am

Post » Wed Sep 22, 2010 5:47 pm

Those settings sound about right -- does it have any settings in Mass - Linear and angular damping - Max Linear and angular Velocity - etc. ? without Mass there is nothing to move so that might be the problem if it is set to 0.

In the NiTriStringExtraData listing, the settings are:

Mass = 6.000000
Ellasticity = 0.300000
Friction = 0.300000
Unyielding = 0
Simulation_Geometry = 3
Proxy_Geometry = c_ARGreatWelkydStoneItem01
Use_Display_Proxy = 0
Display_Children = 1
Disable_Collisions = 0
Inactive = 0
Display_Proxy =
Collision_Groups = 1

These are the same as the settings as the Varla Stone mesh. The only difference is Collision_Groups. The value is 4 for the Varla Stone mesh. I've tried that value for this mesh and it doesn't appear to have any effect.

There's definitely something I'm missing here, but what? :unsure:
User avatar
Laura Samson
 
Posts: 3337
Joined: Wed Aug 29, 2007 6:36 pm

Post » Thu Sep 23, 2010 5:26 am

@JDFan: Paralysis freezes the character in the middle of the animation, instead of flopping down, so it wouldn't work for this.

@The Vyper: SetUnconscious appears to just turn off the NPC's AI when I've used it - they just don't do any animations or react to anything. I've found an NPC unconscious standing up when the command took effect while they were travelling, and had to force a MoveTo to get them to be unconscious where I wanted, and make them sleep first to get the right pose.

It may be appropriate after the collapse as an alternative to zeroing out the endurance, though. Then the problem is timing, because if she's unconscious before she falls, she might not go down. But first I have to get the dance package to trigger off the collapse at all. It's probably a flag to turn on or off in either the dance package or the one after it that's preventing a timely transition at present. I'll take a look at the way the Helpless Army quest in SI does it, where the Saints/Seducers drop after entering the Wellspring chamber.

(Edit : The SI quests killed and resurrected, which wouldn't work for my case. I ended up using a disease (which I called Alcoholic Stupor) with massive Drain Fatigue, as trying to change her stats directly left her standing up unconscious, or recovering immediately. That also turned out to be the easiest way for reversing the effect when I needed to do so).
User avatar
Sabrina garzotto
 
Posts: 3384
Joined: Fri Dec 29, 2006 4:58 pm

Post » Wed Sep 22, 2010 5:06 pm

How could I make a Creature that can Deactivate your invisibility and lower negate chameleon when the player would be in a "viewable" area of this creature. Aka if it "sees" you, it disables your ability to hide. ?
User avatar
Heather M
 
Posts: 3487
Joined: Mon Aug 27, 2007 5:40 am

Post » Wed Sep 22, 2010 9:55 pm

Dialog not showing up. This is the script I have for it but only the first addtopic dPGAulasBloodTopic plays ingame, the other two don't.

scn PGGeneralDialogueScript

short doonce

begin gamemode

if doonce == 0
addtopic PGAulasBloodTopic
addtopic PGDollabellaTopic
addtopic PGSecretGirlTopic

set doonce to 1

endif
end


Anyone got any ideas why?
User avatar
Misty lt
 
Posts: 3400
Joined: Mon Dec 25, 2006 10:06 am

Post » Thu Sep 23, 2010 2:39 am

Dialog not showing up...

I usually do something dumb in the topic conditions. Have you checked the really stupid things that you can so easily overlook

. a GetIsId check that has "onTarget" checked ?
. Typo's in the GetStage conditions that make it check the wrong quest entirely?
. GetStage tests with the < or > back to front ?
. conditions of A == B AND A == C when you meant OR ?

(Yes I've done all of those!)
User avatar
Franko AlVarado
 
Posts: 3473
Joined: Sun Nov 18, 2007 7:49 pm

Post » Wed Sep 22, 2010 10:30 pm

Thanks, that gives me some areas to look at. :)
User avatar
Jessica Lloyd
 
Posts: 3481
Joined: Fri Aug 25, 2006 2:11 pm

Post » Thu Sep 23, 2010 1:37 am

I have (almost) never done anything that places anything in the real world in my mods, so I thought I just as well ask for the best solution before trying. :)

I need some kind of object that is completely invisible, but can be scripted, duplicated with PlaceAtMe (or similar - and yes, I know about what kind of bloat PlaceAtMe can cause, and how to completely avoid that bloat), can be moved with PositionWorld, and can be used to check for distance to player.

What I want is to detect when the player is within a certain distance of a number of places in the game. The places will be read from an array and positioned in the world at load time (hence the need for PlaceAtMe), or can be added at the player's position during play (PlaceAtMe). The object's sole purpose is to set a script variable when the player is within a certain position of it, and should for all other purposes be as non-existant as possible.

So what kind of object should I base this on?

btw, to create copies of this in certain locations, is PlaceAtMe + PositionWorld the best, or is there some way to create such an object in the right pos without having to create it at the player pos and then move it?
User avatar
Crystal Birch
 
Posts: 3416
Joined: Sat Mar 03, 2007 3:34 pm

Post » Thu Sep 23, 2010 3:07 am

I have (almost) never done anything that places anything in the real world in my mods, so I thought I just as well ask for the best solution before trying. :)

I need some kind of object that is completely invisible, but can be scripted, duplicated with PlaceAtMe (or similar - and yes, I know about what kind of bloat PlaceAtMe can cause, and how to completely avoid that bloat), can be moved with PositionWorld, and can be used to check for distance to player.

What I want is to detect when the player is within a certain distance of a number of places in the game. The places will be read from an array and positioned in the world at load time (hence the need for PlaceAtMe), or can be added at the player's position during play (PlaceAtMe). The object's sole purpose is to set a script variable when the player is within a certain position of it, and should for all other purposes be as non-existant as possible.

So what kind of object should I base this on?

btw, to create copies of this in certain locations, is PlaceAtMe + PositionWorld the best, or is there some way to create such an object in the right pos without having to create it at the player pos and then move it?

I believe a Trigger Zone (found under Activators) would best suit your needs. They are invisible in game and can be scripted as desired. I don't know if PlaceAtMe would work for them (never tried it), but is there a reason you can't use MoveTo?
User avatar
Marine x
 
Posts: 3327
Joined: Thu Mar 29, 2007 4:54 am

Post » Thu Sep 23, 2010 2:32 am

I believe a Trigger Zone (found under Activators) would best suit your needs. They are invisible in game and can be scripted as desired. I don't know if PlaceAtMe would work for them (never tried it), but is there a reason you can't use MoveTo?

Thanks. MoveTo can of course be used, but I think I need PlaceAtMe to create the object to place/move. It is possible PlaceAtMe doesn't work for Trigger Zones (I know it doesn't work for Map Markers), in which case I guess I just have to define a high enough number in the CS, and then use MoveTo or PositionWorld to move them one by one when I know where to place them?
User avatar
Jani Eayon
 
Posts: 3435
Joined: Sun Mar 25, 2007 12:19 pm

Post » Thu Sep 23, 2010 7:37 am

Thanks. MoveTo can of course be used, but I think I need PlaceAtMe to create the object to place/move. It is possible PlaceAtMe doesn't work for Trigger Zones (I know it doesn't work for Map Markers), in which case I guess I just have to define a high enough number in the CS, and then use MoveTo or PositionWorld to move them one by one when I know where to place them?

If you go the MoveTo route, you may only need to define one trigger zone, depending on what you'd script it to do. What I would try to do is:

1.Create an empty interior cell, place an XMarker in it and give it a unique RefID.

2.Put the custom trigger zone in the cell, make it a persistent reference with it's own unique RefID.

3.Have that trigger zone move to the Player and do whatever, then move back to the XMarker until called again.

If one trigger zone wasn't enough, then I'd place several in the cell, each with it's own unique RefID.
User avatar
Laura Richards
 
Posts: 3468
Joined: Mon Aug 28, 2006 4:42 am

Post » Thu Sep 23, 2010 1:14 am

If you go the MoveTo route, you may only need to define one trigger zone, depending on what you'd script it to do. What I would try to do is:
...

Thanks, but I don't think that solution is very useful for me, I guess I need to explain a bit more what I want to achieve.

What I want, is to have a script variable set when the player gets close to certain areas. The script variable will tell me (or rather Enhanced Economy) that all plants and containers in that area should have ownership. EE then sets the ownership of any such item in the crosshair (and clear it afterwards to avoid problems with NPCs than need to harvest the containers).

So in principle, I could manually add all those Trigger Zones in the CS to all places where looting plants/containers should be forbidden. But instead I want to build up a list of positions the Trigger Zone should be, and move them out on savegame load, thus completely avoiding touching the cells in the CS for what it means in avoiding compatibility problems or load order dependencies.

Furthermore, I would like to make it possible for any player to add a new such Trigger Zone at the player character's position by pressing a certain hotkey. The mod will then print the position data of the new Trigger Zone to the console, making it easy for me to get this info and add the new one to the main list, thereby building up a list of Trigger Zones that will make it illegal for the player to loot plants or containers in that area. Those Trigger Zones should typically be placed in the middle of farms or gardens.

So I want to move out all the Trigger Zones at savegame load, and then forget about them.

When thinking about this, maybe I should forget any placed object at all, and just check if the player's position is within a certain range of a list of positions... The advantage of the latter is obvious, but the disadvantage is that instead of the loaded Trigger Zone's script doing the check (and there would normally be a few Zones in the loaded cells, and most often none), I would have to check distance to all positions in the array on each loop, maybe every 2 seconds or so.
User avatar
Logan Greenwood
 
Posts: 3416
Joined: Mon Jul 30, 2007 5:41 pm

Post » Thu Sep 23, 2010 7:52 am

In the Idle Animations box where exactly do I create a new idle animation so that it doesn't play for all NPCs? I did 'insert sibling' under what is obviously the wrong brach as when I went ingame every NPC in Oblivion started to dance, thank goodness I backed up my ESP right before. I want my idle animation to play only for my NPCs and through a token and AI package.

http://i110.photobucket.com/albums/n99/Shezrie/animation.jpg
User avatar
SUck MYdIck
 
Posts: 3378
Joined: Fri Nov 30, 2007 6:43 am

Post » Wed Sep 22, 2010 5:34 pm

Your condition is GetIsUsedItem == 0, which means GetIsUsedItem == No, so everyone that is not using the item meets the condition and will play the anim.

Since the conditions is inverted, most likely, the NPC you wanted to dance is the only one not dancing.

I supposehttp://cs.elderscrolls.com/constwiki/index.php/Idle_Animations may not be news to you, but I thought it would not hurt to mention, just in case.
User avatar
Ruben Bernal
 
Posts: 3364
Joined: Sun Nov 18, 2007 5:58 pm

Post » Wed Sep 22, 2010 11:33 pm

@TheNiceOne

I played a little bit with your scenario and the best solution I've found is using disabled, non-dynamic, persistent, scripted barrels.
- Disabled - to make them invisible and unplayable (scripts runs fine on disabled objects)
- Non dynamic - as PlacedAtMe'd, scripted objects tend to not always run their scripts after being moved. The script runs fine if the object is moved to the player location, but if it is moved somewhere and the player gets there later, as you need, the script does not run.
- Persistent - So you can place an enough number of then in a hidden cell and find them with GetFirstRefInCell, when needed.
- Scripted - to detect the player arrival/proximity.
- Barrel - because I like them (lol). I suppose any container or activator should work fine.

PlacedAtMe may be used to create trigger zones, but they suffer the problem mentioned above after being moved. Another problem with TZ is that, when triggrered by multiple objects, only one of them is accessible by GetActionRef and it may not be the one you want. Also, even with "begin ontrigger player", they get triggered by other NPCs.

Although the PlacedAtMe issue of savegame bloating has been significantly reduced with the availability of OBSE's DeleteReference (so you may add and remove temporary objects at will), there is a second side effect of PlacedAtMe when creating less temporary objects. In these cases, usually, there is not a particular moment in the life of the mod to remove the object (as in your scenario). PlacedAtMe'd references are not associated with the creating mod( FormID FFxxxxxx"), so, if the player removes the parent mod, the objects will stay in the game (not sure if cell reset would remove them all).
Using non-dynamic references solves this, as they will go away along with the parent mod.
User avatar
Breautiful
 
Posts: 3539
Joined: Tue Jan 16, 2007 6:51 am

Post » Thu Sep 23, 2010 8:38 am

Thanks. I guess I have got good info to do what I consider (this is just on the idea stage for the time being) now. :)
User avatar
James Rhead
 
Posts: 3474
Joined: Sat Jul 14, 2007 7:32 am

Post » Wed Sep 22, 2010 7:17 pm

Your condition is GetIsUsedItem == 0, which means GetIsUsedItem == No, so everyone that is not using the item meets the condition and will play the anim.

Since the conditions is inverted, most likely, the NPC you wanted to dance is the only one not dancing.


That makes sense. Thank you and thanks for the link. :)
User avatar
Alkira rose Nankivell
 
Posts: 3417
Joined: Tue Feb 27, 2007 10:56 pm

Post » Thu Sep 23, 2010 8:58 am

Is there any way to get the bounding box dimensions of a static (base) object, namely, a building exterior? I saw in the obse docs the GetBoundingBox function, which only works on actors and projectiles, so it looks like the answer is no, but I thought I'd ask anyway, in case anyone knows better. All I need is the width and depth (x and y extents).

Also, does anyone know if setting the fQuestDelayTime variable multiple times within the same script depending on different states would work? For example, I have a script which is mostly relevant within city worldspaces, only a little relevant in tamriel, and not relevant at all if the player is in an oblivion plane. Would it be ok to track the players current worldspace, and adjust the fQuestDelayTime variable accordingly? All I've ever seen, even in scripts where this might be useful, is this variable being set once and left constant, so I was wondering if there is a reason for this, or have the script writers just not bothered trying it.
User avatar
ONLY ME!!!!
 
Posts: 3479
Joined: Tue Aug 28, 2007 12:16 pm

Post » Thu Sep 23, 2010 7:32 am

Can OBSE's setattackdamage function be used on creatures to set their unarmed attack damage?

If not, is there any way to do this in a script?
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am

Post » Thu Sep 23, 2010 7:07 am

Is there any way to get the bounding box dimensions of a static (base) object, namely, a building exterior? I saw in the obse docs the GetBoundingBox function, which only works on actors and projectiles, so it looks like the answer is no, but I thought I'd ask anyway, in case anyone knows better. All I need is the width and depth (x and y extents).

I've asked this same question in the past and the answer was NO.
I really needed the size of the building meshes for my mod, so I spent A LOT of time, developing a mod to measure all those meshes (building exteriors, castles and walls) and saving the data, which, ultimately, was used to generate the code I use in the mod.

Bottom line: download my http://www.tesnexus.com/downloads/file.php?id=32257, open it in CS and check the "zvObjectGet" function. It returns an array with the dimensions of the ref passed as argument, including some additional objects that are part of the building (like the stairs on the Bravil style houses)
It returns the 6 dimensions from the center of the mesh (right, left, front, back, top and bottom) plus the distance from the center of the mesh to the ground.

Feel free to use and adapt the scripts to your needs. Just let me know if you use them in any way.


Also, does anyone know if setting the fQuestDelayTime variable multiple times within the same script depending on different states would work? For example, I have a script which is mostly relevant within city worldspaces, only a little relevant in tamriel, and not relevant at all if the player is in an oblivion plane. Would it be ok to track the players current worldspace, and adjust the fQuestDelayTime variable accordingly? All I've ever seen, even in scripts where this might be useful, is this variable being set once and left constant, so I was wondering if there is a reason for this, or have the script writers just not bothered trying it.

This should work fine.
User avatar
Robyn Lena
 
Posts: 3338
Joined: Mon Jan 01, 2007 6:17 am

Post » Wed Sep 22, 2010 10:50 pm

Can OBSE's setattackdamage function be used on creatures to set their unarmed attack damage?

If not, is there any way to do this in a script?

Not sure about that. I think it's more likely that you have to modify the creature's actor values (strength, attack bonus, etc.). I've always used setattackdamage on weapons, but it might work on creatures, who knows.
User avatar
Kelly Upshall
 
Posts: 3475
Joined: Sat Oct 28, 2006 6:26 pm

Next

Return to IV - Oblivion