🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

KaiClavier

74
Posts
5
Topics
183
Followers
29
Following
A member registered 3 years ago · View creator page →

Projects

Recent community posts

Hey! This is the support forum for Super Save Loader! Make sure to check out the docs!

Hey!

I've never used Wwise before, but if it has functions similar to Unity's built-in audio source, it can probably be swapped out?

The only major functions you'd need are Play() and Stop(), and some way to change the pitch of an audio source, and what clip is currently being used. Try making the "audioSource" variable an "AkSoundEngine" instead of an "AudioSource", see what breaks, then replace with similar variables? I'm completely guessing at the functionality of this class, but this is how I'd do it!

For the text wrap, try checking and unchecking the "break text" boolean, that setting should be the cause of what you're describing! It's good for some situations, but not most.

Published a fix, hopefully it all works good, I'm supposed to be heading to sleep r/n

Hey, working on it now, just figured out the cause. The offset is being applied before the lowest line is calculated. Just gotta figure out a way around this

actually nvm this one's my fault, this is being caused by some code related to indents

It's effecting empty strings, since the code is trying to get the indent of the first character in a string, which doesn't exist.


Replace line 1907 with this:

Vector3 pos = new Vector3(info.Count > 0 ? info[0].indent : 0f, 0f, 0f); //keep track of where to place this text

and line 1921 with this:

 float lineWidth = info.Count > 0 ? info[0].indent : 0f;

I'll publish a hotfix right now!

Hey! The playmaker actions haven't been updated in a long time, and were written by a pal, since I don't use playmaker myself. I'll get them to take a look at it!

Posted in Period

Pushed an update so this wont be an issue, thanks for catching it!

Posted in Period

Hey!

Fuck I completely fucked up on this one, I wasn't thinking when I made that new update. I added a new field called "auto voice" to TextData, it's under the "master" foldout. Just clear that string and it'll remove the dot, I'll push an update without it right now. It was supposed to effect just the demo, but I forgot it'd end up as default for everything, too

Published it! On itch already and should be on the asset store shortly.

#4 done, indents are in!

The float value determines the indent in localspace, so resizing the text keeps the indent at the same spot. I wanted it to be just an "<indent>" tag that sets the indent to be at the letter it was typed at, but all my autowrap code takes place before my positional data I'd need, so I'd have to redo that section to get it working that way. But I think this should be a good fix for now!


I'll publish the update soon, but I want to see if I can get one or two other features working first, since this will be a new version number. Drop me an email and I'll send you a build of what I currently have if you want, though!

Also, there's an exposed variable named "lowestLine" now, which holds the latest line drawn by STM. So if you don't like the scrolling effect I did, that can be used to create your own!

#3 is in! Mother 3 style dialogue boxes are something I really can't believe I forgot.


It'll be out in the next update, which is hopefully soon if I can get the <indent> tag in shortly!

Fixed #2, forgot to rename a field from ages ago. On line 288 of SuperTextMesh.cs, change "STMClipData" to "STMAutoClipData".

Alright, working on the first bug.  I was able to recreate it by having a very long string, then a delay, and more text after.

STM is supposed to only be able to play a sound in the reading out loop if the latest letter being read is a different one than the last frame, so... ok got it.

The issue is that every frame the mesh is updated, it'll say "the last letter that was read was X", so it'll only play the sound of the latest letter that was read. So the issue is caused by the mesh moving so fast, the last letter that was read could be... 40, and the delay is at 80 and lasts 1 second, so the mesh will try to play the sound for everything between 40 and 80 as it catches up.

On line 1127, replace the if statement with this one:


if(myAnimPos > 0f && !undrawingMesh && i > latestNumber){
    DoEvent(i); //do every event up to this integer
    if(!playedSoundThisFrame){
        PlaySound(i); //only play one sound this frame, from the first letter drawn this frame
    }
    latestNumber = Mathf.Max(latestNumber, i); //find latest number to start from next frame
}


The variable "playedSoundThisFrame" replaces "foundLatestNumber", so change the name of the boolean on line 1111, too.

Hey!

In STM's resources folder, change the object named "TextData" to "SuperTextMeshData". This was changed in v1.5 to avoid any future conflicts with other assets. I wanted to remove the dependence on this object to avoid this problem popping up, but was having issues replacing the info this ScriptableObject holds with static variables. Sorry about that!

Hey!

Not too sure what's causing this, would it be possible to send me a link to a sample project? My best guess is that it's some kind of material issue or shader issue? I renamed some shaders in the last update, so maybe it's trying to use the wrong one?  That's my best guess from this screenshot.

Are there any errors being returned in the console?

Ah right, quads won't draw on Unity UI in Unity versions older than 2017.1, since it'd cause a nasty crash before that, sorry about that!

There's no event to subscribe to yet, I think only the index of the current letter being read out is exposed. The value could be exposed, but it would just be an integer of the current line. Another way this could work is that... STM puts a line break character (\n) at the end of each row, so that could potentially be used, too? I'm trying to think of the most user-friendly way to fix this...

Working on other fixes now!

Hey!

These are very good bugs, lemme go at em one at a time

1. This one's weird... Maybe the audio script isn't keeping up with the actual read out script...? maybe the indexes are getting mixed up? I'll give it a look tomorrow, it's gotta be some weird timing oversight in the Read function. I changed some code there recently, so I might have broken something.

2. I probably have some field labeled incorrectly, or it's not refreshing the inspector like it should? For now, create in assets folder, click "ping" while your assets folder is up to go to the autoclips, and duplicate one by hand. Click "refresh database" in the STM inspector to update it.

3. THAT'S!!! a really good idea! this should probably be the default behaviour, but I wouldn't be able to have it be animated when it scrolls up like that. I'll try to figure out how to add this to the Read function, cause it really should do this. It might also be possible for me to do w/ vertex modification, since I can use that to change what vertices are visible as a mesh is being read out. For now, I could try modifying the shader to use the stencil buffer, or try the included UI Masked shader and see if that works? It's an old shader, and sorta hacky so it might not work. 

I dont think the value for the current line being shown is an exposed one, but I could be wrong? It'd be somewhere int he code near the "lineCountLimit" variable, since those need to interact. The current y position of a letter might also be useful for this?

4. If I were to add a tag that let you set an additional offset for text, would that work? Something like... <o=-1> to offset the next letter by 1 unit to the left? For now, try making a quad (Inline image) to use as a bullet point since you can set an offset for those already. That's the best quickfix I can think of. I think and indent function could be done tho, I'd just have to have the mesh remember the offset, and start new rows from there... I think it'll be doable, so I'll probably add that!

It's already pretty late here, so I'll look into this more tomorrow! Some of these things I typed are also notes to myself, so sorry this response is a little free-form!

Oh weird... but I guess a quick fix to a quick fix isn't so bad? I'm trying to think of what would even cause this to happen - the same math should be happening every time. I really want to get the shader doing all this automatically in the future, so I really hope this works for now?

(Edited 2 times)

Oh oops, you're right, it's only based upon the very first character right now!

You can see if the row is changed by seeing if position[i]'s y value is different than the previous one! The position[] array is the base position of each letter, so the y value shouldn't change unless the character drops down a row.


Give this a shot, still not sure if it's perfect though:

public void AlignToGrid(Vector3[] verts, Vector3[] middles, Vector3[] positions){
        //figure out offset of first position to grid
        int rowStart = 0;
        Vector3 posDifference = RoundDifference(positions[0]);
        for(int i=0, iL=positions.Length; i<iL; i++){
            if(positions[i].y != positions[rowStart].y){
                rowStart = i; //new row
                posDifference = RoundDifference(positions[rowStart]);
            }
            verts[4*i+0] += posDifference; //apply this offset to every vertice
            verts[4*i+1] += posDifference;
            verts[4*i+2] += posDifference;
            verts[4*i+3] += posDifference;
        }
    }
    private Vector3 RoundDifference(Vector3 original){
        Vector3 roundedPos = new Vector3(Mathf.Round(original.x), Mathf.Round(original.y), Mathf.Round(original.z));
        return original - roundedPos;
    }

Gave this a huge look-over today, the blurring in your screenshot looks like the type from the font's filter mode, so try changing that from bilinear to point? Other than that, I'm unfortunately not having much luck making this pixel snap shader work much better, yet. I know that friends who have done pixel-perfect games before usually use some combination of render textures to achieve the effect, but I'm not sure if that's compatible with Unity UI.

I also tried comparing Unity's default UI text to STM, and Unity's does seem to do pixel snapping a bit better, but still isn't perfect, either. Since the problem for you seems to be based on when the text is centered, maybe it'd be best to just align it to grid?

I've tried doing this through vertex modification (under the position foldout, check "modify vertices"), and it seems to have pretty good results? It looks about the same as the build-in text stuff, but my setup could be different. Here's the function I'm using:


public void AlignToGrid(Vector3[] verts, Vector3[] middles, Vector3[] positions){
        //figure out offset of first position to grid
        Vector3 firstPosition = positions[0];
        Vector3 roundedPos = new Vector3(Mathf.Round(firstPosition.x), Mathf.Round(firstPosition.y), Mathf.Round(firstPosition.z));
        Vector3 posDifference = firstPosition - roundedPos;
        for(int i=0, iL=verts.Length; i<iL; i++){
            verts[i] += posDifference; //apply this offset to every vertice
        }
    }

make sure the event is set to happen while the editor is running, too! I'll be adding this function to the next update, so you can see it in the sample scene, too.

I think it's gotta be... since it has an internal timer, when it's set to ignore time scale and you move out of the window, the internal timer counts up based on the delta time, the last time since the previous frame. So it keeps counting, even when the window is in the background (and the app is set to not run in the background)

This isn't the intended behaviour of ignore time scale (its for animated effects on pause menus, really) so I should either change the way STM counts up time (Use Time.time - timestarted) or make a special bool that checks whether the window is focused or not. The first option wouldn't be the best, since meshes can have variable read speeds, so I'll try the second.


Yep, got it working!! This fix will be in v1.5.2. Thanks!

Thanks for the info! I'll give it another look, but yeah there's a couple things that are just strange editor quirks. Hopefully I can find a workaround tho, this should help!

Hey!

This is a weird one - could you let me know if it still happens when "ignore time scale" is true/false, and if "remember read position" is true/false?

It might just be a quirk of the editor if those don't effect it, since meshes reading out should be based on an internal timer, not Time.time.

The centred text has gotta be an issue since it's not aligned perfectly, so... the solution would be to get it to line up right. The pixel snap shader /should/ have done this, but I guess I still have more to figure out with that. It might also be possible to align it to the grid inside of STM's code, but that feels like a bit of a clunky solution to me.

I'll give the shader another shot soon! I really hope I can get it working right.

Hey!

Here's an experimental pixel snap shader I've been working on, let me know if this changes anything: https://pastebin.com/qjn5grc3

Have you tried a different font and seeing what happens? Or try seeing if the same thing happens with Unity's default UI Text? When messing with this pixel snap shader, I found that some fonts had kerning values that made things line up in really odd ways, and that the exact same problems were happening with the included UI Text, too.

Also, try making the quality value match the size, and see if that helps at all? For UI text, the size /should/ be the actual screen size in pixels, so quality should match up with that. Also see if changing the filter from bilinear to point does anything!

The centred text having this all the time makes me think it has to do with pixel snap, so hopefully the shader is a good starting point? It's not perfect yet, but I want this shader to fix this problem in the next version.

Hey!

This is a feature I've been meaning to add for some time, but haven't added it yet as it's not really needed for STM's main usage.

If you're using STM for dialogue text, this wouldn't be needed as having differently-sized text appear between boxes would look bad.

And if you're using STM for a static text element, you'd be able to tweak the size yourself, to a better degree of accuracy. (Since text quality/point size and size are independent of each other, this is easy)

The only time it'd be useful is for static text elements that change what they say between different languages or something like that? But even then, very long words/phrases could look weird.  So I think I might be adding this as an additional component that sets the size element automatically, in the near future?


size = maxX / AutoWrap or something might do it, this is just a note for myself when I come back to it later

(Edited 1 time)

Hey!

As of STM v1.5, multi-material UI is only supported on Unity 2017.1+, as it would cause some nasty crashes in older versions, so make sure you're using that, first. Otherwise, you'll have to use the non-UI version of STM to use multiple materials.

 To switch between multiple materials, go into TextData (click the T in the top-right of any STM inspector) and find the "Materials" drop-down. Define a new material there, the name you use here will be the string you use to call it. Then, in your mesh you can use the tag <m=materialname> to switch, and </m> to return to the default material!

noid?

Hey!

If you're using the perlin noise pitch mode, make sure the perlin multiplier isn't 0. That multiplier decides how quickly the pitch raises and lowers. That's the first thing that comes to mind.

Glad it worked out! I should probably mess with this more to have it built-in... I personally never touch Unity UI, so I'm always worried about getting the uGUI implementation wrong.

Try the "Playmaker Actions" package here, under "support packages for other assets". Should be the same file from that link: http://supertextmesh.com/docs/SuperTextMesh.html

Also make sure "autoread" is enabled, or text will just go blank automatically when rebuilt.

Looking thru STM's code right now, try messing with the boolean on line 2510? It tells the mesh to only resize the rect when autoWrap is off. I forget why I have that in place, so hopefully it doesn't break everything else?

(Edited 2 times)

I've been away from updates for so long, forgive me if I've forgotten stuff about my own asset!


Is it possible to just use the size of the recttransform, itself?

Hey! This should be doable, I know other users have used the text mesh's bounds to get the right size, so I'll look into why that isn't updating. The textMesh variable there is the actual mesh used by STM.

That said, I know that accessing a variable from a mesh directly can cause garbage, so I have some variables in STM for getting bounds data (which I use for drawing the blue outline, in-editor.

I finally updated the docs to the latest version here, as I changed some bounds-related stuff since. http://supertextmesh.com/docs/SuperTextMesh.html

Check out the "topLeftBounds", "topRightBounds" etc variables in there, see if those work for you?

Hey! I should probably make this more clear in the docs - you have to make a new material for the new mesh to allow them to have different shader settings. This lets material settings be stored in a material, rather than in the STM component, so setting can be shared between text meshes, but you do need to make a new material to do otherwise w/ it.

I can't seem to recreate the second issue you mention - I'm creating a new gameobject under a canvas, attaching STM as a component to it, and it seems to be showing up fine? Could you give me more details?

Hey!


You can have events go over multiple letters with the tag <e2=string> instead of <e=string>, and then use the tag </e2> to stop it. The sample code for links should work with this!

I think I'll be able to add the shader channel myself through code when that comes, so hopefully this works! Either way, my asset that replaces Unity UI should be going up soon, too. Let me know if you want a copy!

Ahh okay. Hopefully it'll be fixed in the next major Unity release, then?

(Edited 4 times)

Testing this out more in-depth now!

The additional shader channels variable seems to have been added in Unity 5.6, so this should fix it for that. But even though I'm following the sample code on the page here: https://docs.unity3d.com/ScriptReference/Canvas-additionalShaderChannels.html it still seems to cause a crash after a second or so. Are you applying the code in a different place? I'm applying it to the parent canvas immediately before the materials are set.

Setting the canvas to have the extra layers in the inspector also seems to crash. Not sure what I'm doing differently?