Jump to content

Need some help with Overlays


Recommended Posts

3 hours ago, dagobaking said:

That should work. But, why wouldn't you simply not use the "AddEntry" convenience function, use Add to collect the UID and remove them that way?

unfortunately I only started scripting around 5-6 months ago so I am still fairly new to this. (and I only did a couple of semesters of light programming at uni around 5 years ago)

so I don't understand how to use Add to collect the UID.

Link to comment

for the time being, I decide to scale down the overlays on my mods

 

I noticed a few bugs

when you use more than a few scripts (basically when you spammed the drink)

that one of the overlays get stuck on and doesn't get removed

 

The head skinoverride looks too different than the default so it is noticeable

 

The new materials (with overlays) based on CumWealth don't seem to work (red & blue colour)

 

 

so I am removing the skin override and reducing the randomize overlays to a single overlay in both White & Green

Link to comment
1 hour ago, Invictusblade said:

when you use more than a few scripts (basically when you spammed the drink)

 

Give the script a state and a timeout. When the first thing is drunk, go to a "JustDrunk" state which starts a timer and ignores further drinking events. When the timer expires, go back to the default state.

 

Can I ask: what's the second parameter for BodyGen.SetSkinOverride? There's nothing in the script about it and I'm having difficulty finding an example.

Link to comment
24 minutes ago, DocClox said:

 

Give the script a state and a timeout. When the first thing is drunk, go to a "JustDrunk" state which starts a timer and ignores further drinking events. When the timer expires, go back to the default state.

 

Can I ask: what's the second parameter for BodyGen.SetSkinOverride? There's nothing in the script about it and I'm having difficulty finding an example.

it is the name of the skin which is the ID in the skin file in F4SE

 

Scriptname INVB_SkinOverride extends ObjectReference

string Property Custom_string_01 auto
int Property int_time Auto

Event OnEquipped(Actor akActor)
	BodyGen.SetSkinOverride(akActor, Custom_string_01)
EndEvent

Event OnUnequipped(Actor akActor)
	Utility.Wait(int_time)
	BodyGen.RemoveSkinOverride(akActor)
EndEvent

so for example in the picture below the names you want is AA_Tattoo01 & AA_Tattoo02

Screenshot_040620_101311_PM.jpg

Link to comment
2 hours ago, Invictusblade said:

for the time being, I decide to scale down the overlays on my mods

 

I noticed a few bugs

when you use more than a few scripts (basically when you spammed the drink)

that one of the overlays get stuck on and doesn't get removed

well, I just tested the new changes and the results are less than good

so adding overlays is easy

but the real problem is removing the added overlays.

and I will have to have a proper think about the script

 

btw thanks for the help and I still have to figure out the help

Link to comment
2 hours ago, Invictusblade said:

btw thanks for the help and I still have to figure out the help

 

You're welcome, and I know the feeling well. I just set up a BGEM version of one of those designs to apply with LooksMenu:

 

image.png

 

Oh well, back to the drawing board... :)

 

[edit]

 

This is better.

 

image.png

 

I got the greyscale pverlay working. Now I just need to work out why it's ignoring the gradient map I made. I wonder if it needs to be a particular size?

Link to comment

so I have been working on my script today and I decided to rework one of my mods into an ESM.

 

I still have a bit of trouble with overlays not getting removed.

so the script works(I think) for normal gameplay usage but the problem is when the player spams the one(or two) of the Drinks

 

so I added a globalVariable to stop additional overlays from occurring during a cycle.

then I added an random timer to delay the spamming. (I have no idea if this works)

Scriptname INVB_Drinking extends activemagiceffect

string[] Property Custom_strings auto
int Property int_count Auto
int Property int_priority Auto
GlobalVariable Property Overlayed Auto Const

Event OnEffectStart(Actor akActor, Actor akCaster)
	float random_time_F = Utility.RandomFloat(0.1, 1.1)
	Utility.Wait(random_time_F)
	If Overlayed.GetValueInt() == 0
		Overlayed.Setvalue(1)
		int i
		Bool isFemale = akActor.GetLeveledActorBase().GetSex() as Bool
		int[] UID = new int[0]
		int random_seed = Utility.RandomInt(0, int_count)
		Overlays:Entry overlay = new Overlays:Entry
		overlay.priority = int_priority
		overlay.template = Custom_strings[random_seed]
		overlay.red = 0
		overlay.green = 0
		overlay.blue = 0
		overlay.alpha = 0
		overlay.offset_u = 0
		overlay.offset_v = 0
		overlay.scale_u = 1
		overlay.scale_v = 1
		UID.Add(Overlays.Add(akActor, isFemale, overlay))	
	
		Overlays.Update(akActor)
		int random_time = Utility.RandomInt(10, 15)
		Utility.Wait(random_time)
    
		Overlays.Remove(akActor, isFemale, UID[i] as int)
		Overlays.Update(akActor)
		Overlayed.Setvalue(0)
	else
	
	endif
EndEvent

does anyone have any suggestions?

Link to comment

I suspect the problem happens if the event triggers when it's already executing and you get two UIDs being written to the same index.

 

Maybe something like this?

state drinking
	Event OnEffectStart(Actor akActor, Actor akCaster)
		; ignore it
	EndEvent
endstate

Event OnEffectStart(Actor akActor, Actor akCaster)
	GoToState("drinking")
	; your original code here
	GoToState("")
EndEvent

For my part, I managed to get some color into my tats by using one of the CumNWealth grads. 

 

image.png

 

It doesn't help that I don't have photoshop, so I'm just guessing as to the format for these things.

Link to comment
4 hours ago, DocClox said:

I suspect the problem happens if the event triggers when it's already executing and you get two UIDs being written to the same index.

 

Maybe something like this?


state drinking
	Event OnEffectStart(Actor akActor, Actor akCaster)
		; ignore it
	EndEvent
endstate

Event OnEffectStart(Actor akActor, Actor akCaster)
	GoToState("drinking")
	; your original code here
	GoToState("")
EndEvent

For my part, I managed to get some color into my tats by using one of the CumNWealth grads. 

 

image.png

 

It doesn't help that I don't have photoshop, so I'm just guessing as to the format for these things.

thank you, I will test it soon.

 

edit->doesn't work so I am giving up on it, and I just going to have it as a known bug and tell people not to spam Milks

Link to comment

I finally(I think) got the overlay removal working(again, I think)

the solution was to remove it via UID and then remove it via string(egoballistic's solution))

 

it hasn't been stuck on since I changed the script

 

now, I am playing around negative colours on the Cum from CumWealth

the effect below is the drinking Blood

20200408124723_1.jpg

Link to comment
19 hours ago, DocClox said:

I suspect the problem happens if the event triggers when it's already executing and you get two UIDs being written to the same index.

 

Maybe something like this?


state drinking
	Event OnEffectStart(Actor akActor, Actor akCaster)
		; ignore it
	EndEvent
endstate

Event OnEffectStart(Actor akActor, Actor akCaster)
	GoToState("drinking")
	; your original code here
	GoToState("")
EndEvent

For my part, I managed to get some color into my tats by using one of the CumNWealth grads. 

 

image.png

 

It doesn't help that I don't have photoshop, so I'm just guessing as to the format for these things.

I was thinking about your problem

 

and I would think about having multiple overlays to create a layered effect

 

and with my experiences, making the blood overlay

I would look at the different glow gradients in invert colours in game

 

so for your overlay

1. pink circle background (using glow)

2, White highlights

3. black details

 

if that works

then we can create a script to add them in the correct order onto a NPC

Link to comment

I am an idiot,

 

I have been bug testing the overlays scripts and running into problems when it removes tattoo overlays along with the cum

 

turns out, that I was hitting the upper limit of overlays you can have. (I had around 10ish existing overlays on the character)

 

so after removing a few of the existing overlays, I tested again and it seems to work perfectly(at the moment)

Link to comment
8 hours ago, Invictusblade said:

so for your overlay

1. pink circle background (using glow)

2, White highlights

3. black details

 

if that works

then we can create a script to add them in the correct order onto a NPC

 

That would work,

 

9 hours ago, Invictusblade said:

now, I am playing around negative colours on the Cum from CumWealth

the effect below is the drinking Blood

 

Very nice.  Where do I specify a negative number? There are whole chunks of the material editor that mean nothing to me.

 

I think it's all right in the second one, a bit hard to see in the first - but that could just be the camera angle.

 

Sometimes subtle is good for things like this.

 

 

Link to comment
7 minutes ago, DocClox said:

 

That would work,

 

 

Very nice.  Where do I specify a negative number? There are whole chunks of the material editor that mean nothing to me.

 

I think it's all right in the second one, a bit hard to see in the first - but that could just be the camera angle.

 

Sometimes subtle is good for things like this.

 

 

fair enough, sorry I have been looking at it too long today

 

however because you wanted Pink, you might not have to deal with negative numbers

(it just because doing it gave me an really good red/black combo)

 

I assume you use paint.net or gimp

load the glow files(check zip) and invert the colours

Screenshot_040820_100954_PM.jpg

CumNWealth glow files.7z

Link to comment

OK, thanks. I looked at the CumNWealth glowmaps, but I hadn't looked at that end of the properties list.

 

Can you see why this might not be working? It's basically what you posted on Monday:

 

Spoiler

Scriptname rrs:tattoo extends ObjectReference

 

import Bodygen

 

string property tat_id auto

 

Event OnEquipped(Actor akActor)
        Debug.Notification("applying " + tat_id)
        BodyGen.SetSkinOverride(akActor, tat_id)
EndEvent

 

I attached it to the "Just Another Sex Slave" top I made and tested it out. The Notification line is printed correctly.

 

image.png

 

And the name matches the overlays file:

 

  {
    "id" : "rrs_breeder",
    "name": "$RRS Breeder",
    "slots" : [
      {
        "slot" : 3,
        "material" : "overlays\\docclox\\breeder.BGEM"
      }
    ],
    "playable" : true,
    "transformable" : false,
    "sort": 0,
    "gender": 1
  },

... but there is no tat in evidence.

 

image.png

 

I don't think it's a JSON problem because if I apply it from the LooksMenu UI ...

 

image.png

 

It works just fine.

 

I can't think what else it could be.

 

 

 

Link to comment
6 minutes ago, DocClox said:

OK, thanks. I looked at the CumNWealth glowmaps, but I hadn't looked at that end of the properties list.

 

Can you see why this might not be working? It's basically what you posted on Monday:

 

  Hide contents

Scriptname rrs:tattoo extends ObjectReference

 

import Bodygen

 

string property tat_id auto

 

Event OnEquipped(Actor akActor)
        Debug.Notification("applying " + tat_id)
        BodyGen.SetSkinOverride(akActor, tat_id)
EndEvent

 

I attached it to the "Just Another Sex Slave" top I made and tested it out. The Notification line is printed correctly.

 

image.png

 

And the name matches the overlays file:

 


  {
    "id" : "rrs_breeder",
    "name": "$RRS Breeder",
    "slots" : [
      {
        "slot" : 3,
        "material" : "overlays\\docclox\\breeder.BGEM"
      }
    ],
    "playable" : true,
    "transformable" : false,
    "sort": 0,
    "gender": 1
  },

... but there is no tat in evidence.

 

image.png

 

I don't think it's a JSON problem because if I apply it from the LooksMenu UI ...

 

image.png

 

It works just fine.

 

I can't think what else it could be.

 

 

 

because you are activating the wrong thing

the script wants a skin

but you want an overlay

 

edit the code to look like this (btw the number 7 is priority so it might/ will important in the future with backgrounds, but not yet)

Scriptname rrs:tattoo extends ObjectReference


import Bodygen (I don't know if this is important, I don't have them)


string property tat_id auto


Event OnEquipped(Actor akActor)
        Debug.Notification("applying " + tat_id)
        Overlays.AddEntry(akActor, true, 7, tat_id)
EndEvent

 

Link to comment

You're right about not needing the import. That's the Python way of doing it, and I've been writing a lot of Python lately. That said it should be harmless.

 

Still doesn't do anything though. But now I have a much better idea of where to look.

31 minutes ago, Invictusblade said:

the script wants a skin

but you want an overlay

Roght. So if I'd been using full skin textures, or materials based on them I guess, that would have been the right approach?

 

I was wondering what the difference was.

Link to comment
3 minutes ago, DocClox said:

You're right about not needing the import. That's the Python way of doing it, and I've been writing a lot of Python lately. That said it should be harmless.

 

Still doesn't do anything though. But now I have a much better idea of where to look.

Roght. So if I'd been using full skin textures, or materials based on them I guess, that would have been the right approach?

 

I was wondering what the difference was.

unless I am mistaken

 

Skin Override is replacer of the skin and requires an (armor, armor addon and texture set) to use (no Material) with code in F4SE folder

overlay is a image project onto a skin and only requires a material file with code in F4SE folder

 

also have a look at the code, I posted about yours for the "Overlays.AddEntry(akActor, true, 7, tat_id)

Link to comment
39 minutes ago, Invictusblade said:

also have a look at the code, I posted about yours for the "Overlays.AddEntry(akActor, true, 7, tat_id)

 

I did. This is what I have at the moment:

 

Scriptname rrs:tattoo extends ObjectReference

string property tat_id auto

Event OnEquipped(Actor akActor)
        string s = "rrs_breeder"
        Debug.Notification("Applying Overlay: '" + s + "'")
        Overlays.AddEntry(akActor, true, 7, s)
EndEvent

I got rid of the import and moved the id string to a local value, just to eliminate one possible source of errors. Otherwise it's the same.

Link to comment

Update! I wasn't calling Overlays.Update(akActor).

 

I wouldn't have realised, but I noticed that my test girl was getting the brand, but only after a reload. So I added in the update call, and now it works perfectly.

 

Not bad, considering I'm doing it with a command prompt to compile, and zEdit to link in the scripts :)

Link to comment
7 hours ago, DocClox said:

Update! I wasn't calling Overlays.Update(akActor).

 

I wouldn't have realised, but I noticed that my test girl was getting the brand, but only after a reload. So I added in the update call, and now it works perfectly.

 

Not bad, considering I'm doing it with a command prompt to compile, and zEdit to link in the scripts :)

damn, I forgot that too

btw why are you not using creation kit?

Link to comment
14 hours ago, Invictusblade said:

btw why are you not using creation kit?

If I'm honest, it's largely because I'm ticked off at Bethesda for various reasons, plus I'm a stubborn bastard.

 

But also, zEdit loads a hell of a lot faster than the CK, and I've always enjoyed working low-level. You learn a lot that way.

 

[edit]

 

All tats made and scripts working!

 

ScreenShot158.png

 

Many, many thanks for your help in figuring it all out.

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