Jump to content

useful community scripts to start mods with


Guest Donkey

Recommended Posts

@Movomo

That's a scenario that I didn't consider.  Mainly because I've never been present during a birth so I forgot there is an animation sequence involved.  Will be sure to test that if I decide to use the OnBirth event.  Excuse the followup questions, but how do I check if the animation is playing? and delay until it's over? I know how to do delays in Spell and quest scripts, but not in a function that the event handler is set to call.

 

@comrade fienyx

you had me at throwing.  I was looking at some armor mods the other day and one had a kunai belt.  Thought how fun those would be, if they weren't just for show.  Looking forward to see what you got in the works.

Link to comment

@Movomo

 Excuse the followup questions, but how do I check if the animation is playing? and delay until it's over? I know how to do delays in Spell and quest scripts, but not in a function that the event handler is set to call.

 

Event handler is a one time script, just the same as any other type of functions. You can even call it manually regardless of any actual events. That is, you can't delay it for multiple frames. But you could use them like switches... then you can do the rest in a quest/token/spell script. Probably quest, in this case, because token or spell script becomes unreliable once the owner gets away from the player's vicinity.

 

There's a LPK system token called LoversPkrIdentifier (or something like that). It's the simplest form of identifying lovers action. If someone has this token then he is screwing someone else.

 

Before that, see if you actually need to care about this lovers animation thing or not. The xLoversCmnIsReady function might be handy for testing this. Hiyoko shooter checks the targets with this function, and if this fails, that pair is ignored. For example, if they are in a different interior cell, they don't need to play animation that no one will ever watch, thusly ignored.

 

Anyways... your onBirth even handler will be called at the same frame with the hiyokoshooter's one. You just don't know if your handler was called before hiyokoshooter or after it. This means your xLoversCmnIsReady call result will *probably* be valid during that frame. If it failed for you, it will probably fail for hiyokoshooter as well. Just be aware that two persons are needed to execute a sex. The onBirth event does not directly tell you how well the child's mother is... You probably have to check both of them, mother and child.

 

So, the actor may or may not need your special attention depending on whether he was ignored by hiyokoshooter or not, and he may or may not (yet) have been given the LPK identifer token at the point you check it.

Link to comment

@iamnoone if you would like to check out the throwing function, look up "Throw Any Weapon" on the nexus. I was given permission to use that. It may have a few issues, mostly, I think, you can lose what you throw. There's a spell that lets you find stuff though. It's what became the throwing in UV. I'm basing mine off DR5. Although I've read it has issues with this mod or that mod, I've never had issues with it. I think the problems come from the complicated dodge system, which I don't use. I'm incorporating double tap dodge.

Link to comment

@Movomo - Ah, ok I get what you're saying about using it as a switch and not directly.  That makes much more sense now. I'll do some testing and give some thought if this is the way I want to do this. Would periodically checking for new entries in aHiyoko (?) be a viable alternative?  Is it safe to assume the newest are at the end? I get there may timing issues and encounter the same situation as before, but I'm just exploring options at this point. 

Thank you for walking me through this.

 

@Comrade Fienyx I'll check it out.  I got turned off by combat mods when I tried UVIII.  My available keys and mouse buttons made it inconvenient with all combos, which I didn't want to memorize and use.  I was planning to try "Duke Patrick's Combat Archery" on my next run, and I'll be sure to add "throw any weapon" in there.  Then again, you'll probably be on the next version by the time I get to playing again, and then can try yours too.

Link to comment

@Movomo - Ah, ok I get what you're saying about using it as a switch and not directly.  That makes much more sense now. I'll do some testing and give some thought if this is the way I want to do this. Would periodically checking for new entries in aHiyoko (?) be a viable alternative?  Is it safe to assume the newest are at the end? I get there may timing issues and encounter the same situation as before, but I'm just exploring options at this point. 

Thank you for walking me through this.

 

 

Err...  apparently, yes. They're always appended, not inserted. The flow is like this: onConception handler -> delivery -> setHiyokoData (you can find the appending code here)

Cool. I haven't thought it that way. If you think it's fine, that's fine. That may be easier to code. I guess you still have to make sure that the hiyoko is not in 'action', though. Choose whichever way that fits you.

Link to comment

Reading about event handlers, do you think vipcxjs airfight could use an "OnCombatStart" instead of game mode for the npcs?

 

Airfight is a big performance hitter. A part of the reason is because it has so incredibly many things to do each and every frame. To make someone fly you should track his movement every frame. If you use OnCombatStart event for npcs, it may help fps a bit while not in combat.... I think, but won't make single difference once the combat starts.

Link to comment

So what is the most accurate way to determine if NPC is pregnant?

 

I'd like to switch clothes of NPC(s), but want to avoid the pregnant ones because it gets weird. Movomo explained how and why this happens on the last page, so now I'd like to prevent it altogether.

 

I don't really understand how to check the womb state, at least for the purpose of avoiding the TSB stuff or whichever mod changes the body/clothes.  My last mod just checked for tokens 2003 (a4tcFertilizedOvum) and 2004 (a4tcConception).  Now reusing the same trick I'm not so sure this is the right way.  I'm not getting a positive item count on some NPCs early in the pregnancy.  Not unless these tokens aren't valid until some delay after loading the game/cell.

 

(Maybe this post belongs to the TC/HC thread but most of the conversation is already here)

Link to comment

So what is the most accurate way to determine if NPC is pregnant?

 

I'd like to switch clothes of NPC(s), but want to avoid the pregnant ones because it gets weird. Movomo explained how and why this happens on the last page, so now I'd like to prevent it altogether.

 

I don't really understand how to check the womb state, at least for the purpose of avoiding the TSB stuff or whichever mod changes the body/clothes.  My last mod just checked for tokens 2003 (a4tcFertilizedOvum) and 2004 (a4tcConception).  Now reusing the same trick I'm not so sure this is the right way.  I'm not getting a positive item count on some NPCs early in the pregnancy.  Not unless these tokens aren't valid until some delay after loading the game/cell.

 

(Maybe this post belongs to the TC/HC thread but most of the conversation is already here)

Here's what I use to check for and respond to a changed womb state. You can probably glean what you need. (I've removed what I actually do for each of these stages.)

 

 

if player.GetItemCount a4tcWombState != LastWombState
  set WombState to player.GetItemCount a4tcWombState
  if WombState == 10 ;Period
  elseif WombState == 15 ;Late Follicular Phase
  elseif WombState == 20 ;Ovulation Phase
  elseif WombState == 30 ;Luteal Phase
  elseif WombState == 40 ;Time Lag Phase
  elseif WombState == 110 ;Pregnant, First Trimester
  elseif WombState == 120 ;Pregnant, Second Trimester
  elseif WombState == 130 ;Pregnant, Third Trimester
  elseif WombState == 140 ;Postterm Pregnancy
  elseif WombState == 150 ;Postpartum Phase
  elseif WombState == 151 ;Stillbirth
  endIf
endif
set LastWombState to player.GetItemCount a4tcWombState

 

Link to comment

Thanks, Supierce

 

I was staring at the WombOne script and had no idea what I was looking at.  I was expecting to find a variable with an actual value that I'd have to extract.  Never would have expected a token count to store state, but probably should have since these mods do have some clever (arcane) tricks.

Cool. Thanks again. :)

Link to comment

Wombstate count should work and it's good for any general purpose. But if you're worried about specifically tamago setbody, you could use its internal "preg-o-meter".

 

(tamagosetbody.esp v2.00+, 00080A) tsbrFnGetWombStateIndex

@param (ref) actor

@param (int) item index size (you don't need to know, but this indicates the number of compatible _prg#.nif items.)

 

And the return values

wombstate conversion: 110->1, 120->2, 130->3, 140->4, else->0
;             iWombState 1    2    3    4    0
;           iItemIndexSize
;(basemesh only)    1    0    0    0    0    0
;            (1)    2    0    1    1    1    0
;            (2)    3    1    1    2    2    0
;            (3)    4    1    2    3    3    0
;            (4)    5    1    2    3    4    0

So, if you pass (some actor, 3) as arguments, it will return 1 for wombstate 110 and 120, 2 for 130 and 140, and 0 for all other cases. And return value of 0 means the actor's equipment should use the base(non-pregnant) mesh path.

 

You might be wondering what's special about this function. Why use this when you can just check wombstate tokens yourself...

Tamagosetbody reboot (v2.00+) has a rather weird feature called sperm override. It makes one look like pregnant if too many sperms are in her. Like you can sometimes see in a hentai manga. better you haven't.... anyways, this means tsb may be tampering even with a non-pregnant actor. In that case tsb uses a fake wombstate number instead of actual token count.

 

However, this function was not intended to be public. I broke compatibility after v2.00. For v1.x tsb, the return values are the same, but the function's ID is different: 002368. v1.x doesn't have spermoverride. Plus, any other tamago setbody (very old versions) don't even have this function at all. Yet they're all named "tamagosetbody.esp"... So you may have to check the version or the validity of the retrieved function's form, or both of them.

 

For v1.x, the main quest id is: a3tsb (I think very old versions use this id too), float Version (this variable may or may not present in very old versions)

For v2.x, the main quest id is: tsbrMain, float fVersion

 

You can retrieve the version number like this:

set somequest.something to -1.0
RunScriptLine "set somequest.something to tsbrMain.fVersion"
if somequest.something == -1.0: (means it's not v2.00+) else: ()
Link to comment

I actually just started digging through tamagosetbody to see how it works and handles cell changes because I need something similar for my mod.  NPC's  seem to want to equip as much as possible, including items that were force un-equipped.  My current solution is to periodically refresh the outfit.  I wanted something lightweight without constantly scanning for nearby actors to see if they exist my array.  Now the more the I test and see overlapping clothes, the more it bothers me to the point I'm looking into more active management.  I also really dislike the idea of flat-out removing items from inventories, even from generated NPCs like hiyokos.  It would make it (so so sooooo much) easier, but no. not doing that.  So if I at least do a refresh on loading the cell, that handles the major package revaluation that causes the NPCs to redress themselves.

 

With regards to wombstate it is compatibility issues with tamagosetbody specifically I'm trying to resolve.  I definitely want the pregos to look prego, and try to minimize the collateral damage of the other NPCs.  Thanks to Supierce and you for enlightening me on wombstate checking, preventing existing pregnant NPCs from getting clothes switched is pretty straightforward.  Now it's the when the NPC is wearing an outfit and then gets pregnant that I'm not so sure of.  When my mod does a restore it unequips the added items, then removes them, then re-equips the original items (it's currently a lazy single frame operation).  I don't know how TSB deals with a clothes change after it has done it's thing.  Preliminary testing appears to be just fine since clothes will change, but the mesh (?) stays. (pregnant clothes -> different pregnant clothes)

 

Movomo, thank you for telling me about tsbrFnGetWombStateIndex, as well as the other...um...situation it handles.  I didn't even know that was in this mod. yeah, ok, then. That function is very useful and eliminates relying on eventhandlers to anticipate tsb actions.

 

<OT> looking through tamagosetbody comments who deserves the credit for these gems:

;Ok, this is truly a fine piece of crap. Armors should be handled a bit differently.
...
;Overwrite the new path entry with the new one, hope this won't give too much trouble

the last being my personal favorite.  TSB's documentation is probably the most entertaining I've read.

 

Link to comment

Well.... it's my joy if those comments at least helped you feel less bored......
 

I actually just started digging through tamagosetbody to see how it works and handles cell changes because I need something similar for my mod.

I'm afraid you might not get the best answer for that from tsb. tsb does not control what they wear, it just reacts when they decided to wear anything. It doesn't have any functionality that prevents them from wearing specific clothes. It doesn't walk npcs at all, too.

FYI, npcs also fire onEquip event when they are loaded. Doesn't matter if they've actually changed or attempted to change their equipment. tsb takes advantage of this behavior. Just thought perhaps this may help you detecting npcs that have just equipped the clothings you don't want.
 

Now it's the when the NPC is wearing an outfit and then gets pregnant that I'm not so sure of.
...
I don't know how TSB deals with a clothes change after it has done it's thing.

You can consider that tsb performs two different operations, that are basically independent from each other. The codes especially the mesh swap part look quite scary but the idea is simple in essence.

(1) Make some cloth look like preg. This is a passive operation that is triggered by onEquip event.
(2) Decide when an npc has to start or stop looking like a prego. These are triggered by tamago events, but are sort of active operations. These include naked body changes, and forced clothing re-equip. These two occur at the same time.

(1) - Once tsb has decided that someone is pregnant, any clothing she attempts to wear will trigger (1). tsb will try to find a compatible _prg#.nif meshes. If found, that will be her new look. If not found, before tsb gives up, it attempts to assign random mesh of same biped slot, instead of the exact same one. (this requires the random equipment setting enabled (default) I think this is what "pregnant clothes -> different pregnant clothes" that you said means.)
OnEquip handler is called just before it's actually equipped, and this (1) is roughly a single frame operation. So, the chick will already look pregnant by the time the clothing is finally equipped.

(2) - You are notified via tamago's onWombstateChange event that someone's wombstate has changed, then you have to change her clothing's look correspondingly. To do that you must fire (1). To fire (1), you unequip clothings (first frame) and equip them again (one or more frames later - npcs need one frame to be updated properly). This will trigger onEquip event for them, thusly (1) starts. Note that not only this but any equip event -including other mods' scripted equip and player's manual equipment change - can fire (1) too.

Link to comment
>> Does anyone know how to detect what stage sex is at for the player during sex via a script?
 
Just looked into Lovers with PK.esp, and my guess is
player.getItemCount xLoversPkrStep   ; seems to be 1..5 for 4 phases and orgasm(?)

- but i'm not sure, never had that task.

 
Link to comment

Upgrade ?

In Oblivion value, health (durability) and weight never changes. And the damage depends on your  attributes and skills values. And damage automatically changes if you get higher attributes and skills. No script needed.

But a iron sword is a iron sword and will to level up to a steel sword or silver sword, you must buy or find a better sword .

There a one or two quest weapons which are really getting better. But by using ( kill more enemies) .

Link to comment

The original Merchants also levels ( they have level lists, Player with higher level can buy better armor and weapons)

I never buy armor and weapons. Bandits and marauders always have better armors and weapons as the merchants sell, so kill bandits !

 

Most game overhaul mods change the Bandits armor and weapons, because in the original game you can hardly find good weapons and armors at a merchant but all bandits wear daedric and elfen armors. Overhaults change the Bandits and merchants level lists, so that bandits rarely have the best weapons and armors  and you must buy the good stuff.

Link to comment

@ randomdude

 

If player.GetLevel == 25 && player.HasItem "iron sword"

player.removeitem "iron sword" 1

player.additem "steel sword" 1

Endif

 

You want to find the actual id's. I've used a similar script to "advance" a special spell. I suggest setting a quest delay of 600, that makes it 10 min. No need to have a quest constantly checking your level. Of course, that does mean there is a possibility of needing to wait. Could set a OnLevelUp function. Can't explain how to do that, I haven't learned those yet.

Link to comment

@fejeena Yea, I know the vanilla merchants suck balls and had modded my Oblivion to hell and back. The problem now is that; merchants and bandtis have wider variety of item regardless of my level, turning the game into something of luck-based affair. If I want to buy something, the store in local city might not have the thing I really need and if it does, more often than not it's so so pricey I won't have enough to buy potions.

 

 

@Comrade Fienyx I'll try that on levelup function once I got my CS to start again (and bored from my current run).

Link to comment

There are many repeating lines in SetBody's AutoSetBody.ini like these:

 

set aaaAutoSetBodyIni.iBody1 to sv_Construct "....."
set aaaAutoSetBodyIni.iBodyRare to 1
set aaaAutoSetBodyIni.iBodyClass to 0
set aaaAutoSetBodyIni.ibodyCategory to 1
SetStage aaaAutoSetBodyIni 15

 

Those same variables are being overwritten repeatedly. As RunBatchScript command reads all those lines before continuing, I assume that quest stage change is used to circumvent this limitation. I'm implementing something like this in Dymanic Underwear System, and I'd like to have a verification that my assumption is correct. This is a bit complicated after all, and who ever figured this out (gerra6, movomo?) is genious.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use