Standardize across game templates

So now that I have pulling in the .txt file variables working, I need to tell it which  .txt file to bring in.

So far I’ve done this by adding a gameobject to each scene named & tagged “SceneType”. It has a textmesh component with the rendering turned off, and the name of the .txt file in it.

This way, for any given scene, it can still have the same scripts attached to it, and it finds the correct .txt

Note – I have it done pretty redundantly right now. There are 2-liners pulling this in in the exact same way in the following scripts:

  • GameManager.InitGame()
  • WordDictAdd.SetUp()
  • WordDictAdd.CreateObjects()
  • LoadEasyMode.Propogate()
    • [which, should be noted, should also switch names etc. #todo]
  • GoMenuVowelTeams.MainMenu()
    • [#todo also should change names]

GameManager.InitGame() is my first attempt to make this so it doens’t have to be repeated.

Hmm. So this isn’t working as smoothly as I wanted it to. This might be a good instance to run it by Joao.

A thing I’d also like to know is if making an empty game object with a non-rendered textmesh that tags the scene is the way I’m supposed to do it.

Ooh – apparently there’s multi-scene editing, that sounds nice.  #todo

https://docs.unity3d.com/Manual/MultiSceneEditing.html

Some interesting food for thought around using names and stuff:

  • against:
    • https://akbiggs.silvrback.com/please-stop-using-gameobject-find
  • pro
    • https://www.reddit.com/r/gamedev/comments/3t74w4/unity_devs_should_stop_using_gameobjectfind/

#todo – I could have the same menu scene for everything, but I’m not sure that’s worth it right now. It feels like it would make it hard to make builds and my energy really isn’t going into menu stuff right now. Eventually maybe.

Add in sounds depending on easy/hard mode:

  • right now this mainly happens in GetButtonLevel, where it checks if it has an easy tag, and if so, adds sounds
    • complication: for VowelTeams, answers is always in there. (this could just be a standardized thing I have, where anything tagged answers is always there…)
  • It also happens in GameManager.Awake() so that any scene I start with will have sounds without having to go through the menu

This makes me think I want to have this information embedded into my text file, so that I don’t have to individually specify it every time.

 

Use .txt column variables in scene

Command R replaces everything in the script. Exit to cancel, enter to keep.

Now I’m working on automating pulling in the column names, creating the things they need from those, and inserting htem into everything. This is basically WordDictAdd.SetUpOnsets. I want this for a couple reasons – 1, the script was super repetitive. 2, making new templates with this system is a real pain, and involves an annoying amount of manually find&replacing. Feels like I shouldn’t need a python script to do this, I can do it inside C# Unity itself.

Okay – so first goal – bring in the names of the columns and return them.

Done.

Now:

  • name GameObject[] sets using the string
    • This is a little tricky.
    • http://answers.unity3d.com/questions/247517/c-gameobject-lists.html
    • OH – I don’t need to name them separately. They’re just object sets. They don’t need the name embedded the way they do in the hard code.

To fix:

Turned off InitGame SetUpOnsets in several places (Propogate on the main camera, and also in GameMnaager when it starts)

I also took out the level name, which is a real pain. So now I should go back and add in the level name but make it so it skips it in the set

 

Random thoughts on how to do more specific feedback in the future:

  • have a set of answer objects in each slot, that get filled in by the Reader, to have the textmesh of the right answer block
  • then, if they are currently colliding with something that has the same textmesh, they are correct. (tehy can be colliding with more than one thing – if there is a correct thing colliding with them, it works) – #todo – the only problem with this is this feasibly could have them out of order but marked as correct -play around with this

Okay, so now I’ve got it working for VowelTeams.

I’ve imported ShortLongA scene to see how this can translate. A thing I think I now need to do is to tag each scene with which .txt file it uses, so I can use the same gameManager prefab. This wouldn’t be necessary if it weren’t in the same project, so I should consider this. I’m pretty sure it’s better to be in the same project tho so that if I change any of the main scripts, they’re always changed, instead of having so many versions of them runn

 

Fix up button levels

Now that everything else is working, I need to pull the level from the button name and call that row from the spreadsheet.

Annoying thing I just discovered. Prefabs for buttons, where you add the script in the scene that it needs – they don’t work, bc the prefabs are outside the context of the scene. To have that work, I think I’d need it just be attached scripts, bc that works. Maybe I’ll consider switching my buttons to not really use the button functions that are context-dependent, and just do added script components.

Lol silly indexing problem. Button #1 is taking it to row[1], which is actually row 2. I guess I need to subtract one from it?

Make audio present or absent based on type of scene

Okay, so in PuzzleBot, here are the ways that audio interacts:

  • In NameButton.GoOneLearn() (which is attached to the main camera and called upon click inside the button component): public void GoOneLearn()
        {
            SceneManager.LoadScene(1Learn);
            //1014-16
            // change GM instance audioList & score to be the ones you want in that level
            GameManager.instance.audioList.Add(Onset);
            GameManager.instance.audioList.Add(Ending);
            GameManager.instance.audioList.Add(Answer);

            GameManager.instance.scoreValue = 5; 

This requires that there is a thing in GameManager called audioList. Let’s go look at that.

  • GameManager only has thing thing, setting up audioList but never using it.
    •     public List<string> audioList = new List<string>();

Okay, so what script winds up calling audioList? Is it PlaySound?

Nope, PlaySound doesn’t’ call it.

Ahhhhh – it’s in PlayerCoroutine. Because PlaySound isn’t even attached to those objects!!!! WHOAH CRAZY. PlayerCoroutine() is attached to each of the objects that should (or shouldn’t) make sounds. And it’s not that no sound is attached – it actually attaches and plays a blank sound. This feels like a hack but whatever 😉 Keep things consistent. (Maybe come back and look at it #todo).

void PlayAudio()
    {
        

        TextMesh onsetText = gameObject.GetComponent<TextMesh>();
        AudioSource audioSource = gameObject.GetComponent<AudioSource>(); // script doesnt like this for ones where its not there 

        if (audioSource == null) // consider just adding audio to game components at beginning of game? not sure theres a diff 
        {
            audioSource = (AudioSource)gameObject.AddComponent<AudioSource>();
        }

        if (GameManager.instance.audioList.Contains(gameObject.tag))
        {
            
            audioSource.clip = Resources.Load(Sounds/ + onsetText.text) as AudioClip;
        }
        else
        {
            audioSource.clip = Resources.Load(Sounds/blank) as AudioClip;
        }

        audioSource.Play();

    }

 

 

Ohhh okay. In Vowel Teams, the script on the menu buttons is called ButtonLoadScene.Propogate()

Interesting. Now my Check answers button is broken. I bet this is because I deleted a damn prefab. Hmm… actually it just looks like it’s because something got confused with the text showing up in front of that button and in front of the Answers buttons. It was working at enabling and un-enabling the mesh renderers, it’s just the z scales were off. I wonder if it’s something to do with how I redid any of the prefabs? It really shouldn’t have broken those, but I fussed with the text z scale and that didn’t fix it, and then I ALSO fussed with button z scale, and that DID fix it. Weirdly, I think I only fussed with the CheckButton z scales, and when those got fixed, so did the answer buttons. Huh. Let’s keep an eye on that. #todo (And maybe come back and confirm that that’s done right.)

Okay, so I moved the thing adding audio onto the GetButtonLevel() which is attached to the button scripts, so that I can use tags on the buttons to indicate which one should have which audio.

It’s not perfect, but I’ve got everything set up now.

 

 

Make middles work

SetUpOnsets() only sets up the onsets (a la the name), so I need another function that does Middles.

Woooo I did it! A thing I’d like to do is go back to WordDictAdd.SetUpOnsets() and script the super repetitive stuff. I never learned how to do that and that’d be a thing that’d make me happy to do. #todo

I’d also like to go back and see why GameManager.instance.levelCounter isn’t working where I thought it should have. I had to call GameManager.InitGame() an additional time in the Propogate.cs script to make it so the menu buttons worked.

Note: I also had to reset each of the counters inside Start() in WordDictAdd, or else they got too high and stopped calling the right index.

 

Trigger Check Answers button to appear

So now that I have the show/hide button working, and I know how to trigger collisions, I need to make the button only show up when each of the slots has been filled.

A question for myself:

  • does each slot need to be filled with a like color?
    • I’m not going to do this for now. I want to see how kids interact with it, and if they start learning the patterns on there own without too many initial restrictions.

Implementation questions:

  • how do I make sure that the slot is actually being filled, rather than just having been collided with?
  • Do I have the collisions/fillings count to 15, and on 15, the button shows up?
    • This could be something where if there are 15 collisions simultaneously, then the check button appears
  • Or do I have something arranged more individually, box collider by box collider …
  •  Or, this might not exactly be about collisions, but about slots being filled

http://answers.unity3d.com/questions/756868/2d-collision-detecting-simultaneous-collisions.html

http://answers.unity3d.com/questions/574630/find-objects-colliding-with-collider.html

This is a super cute interaction, and might be useful for me to reread in the future:

https://forum.unity3d.com/threads/how-do-i-check-for-two-boxcollider2d-overlapping.232646/

A lot of stuff was recommending Physics.OverlapSphere , which does maybe what I want but with a sphere.

I looked in the rest of the Physics command, and found Physics.CheckBox

https://docs.unity3d.com/ScriptReference/Physics.CheckBox.html

This might be it – gonna give it a shot.

Joao just suggested these too ideas:

  • there’s also OnTriggerExit (cool I didn’t know!!!), so I could tally on trigger enters and on trigger exits and when it hits 15, I know they’re done

Boolean – is something placed here?

  • Joao also pointed out – but what if a letter block overlaps two box colliders 🙁 Which will almost definitely happen, unless I really change how I’m doing this, and I don’t want to bc I don’t want it to be too rigid bc it’s like 6 year-olds using this

OHHHH – I only need a single box collider, over the entire frame where the answer slots are, and then all I need is for all of the letter blocks to be inside it. Doesn’t need to be 15, doesn’t need to be individualized, just once all of the letter blocks collide or overlap with it simultaneously, then the check box appears. Really cool how that idea occurred to me while talking with Joao! Social thinking about coding problems is helpful and happy.

http://answers.unity3d.com/questions/459219/check-that-an-object-is-within-the-bounds-of-a-tri.html

Hmmm … blocks are getting stuck in the box collider.

http://answers.unity3d.com/questions/733114/ontriggerstay-or-ontriggerenter.html

Keeping Track of Targets in a Trigger

Do I want a script on the collider block, or a script on each of the letter blocks? (Or … no matter where the script is, what direction is it going in – for every letter block, is it in the collider currently? )

blocks are getting stuck in the box collider:

PROBLEM: Because raycast from Move Object and Play Sound was hitting the box collider instead.
SOLUTION : move box collider to -1000, and then it works again.
This could also be potentially solved by using Raycast All, which might end up being necessary if there’s no way to satisfy all the z requirements.

So I’ve gotten it down to the point that being left in the boxcollider is making the letter blocks freeze and not be consistent about playing their own sounds. This happens even when I remove my collision script. I’ve removed the sprite component, rigidbody2D, and checked and unchecked “istrigger”. Hoping that the site below helps. This feels oddly familiar and maybe like something I’ve solved in the past, possibly in PuzzleBot.

http://answers.unity3d.com/questions/689414/unity-2d-freezing-player-in-position-on-collision.html

When you raycast, it figures out all the things that are intersecting it. So it finds the first object (box collider) instead of finding the letters block (which it needs to in order for Move Object and Play Sound).

Raycast – can always deal with z things by just looking at all of the things. Raycast can give a bunch of different objects. –> there’s a Raycast All, which gives you a bunch of Raycast hits, which I can try to use at some point if my z stuff gets sad.

#todo – so keep an eye on if it ever happens that the order z needs to be in for every different thing isn’t possible.

 

 

make it so blocks don’t overlap so weirdly: 

PROBLEM: blocks overlap weirdly bc they’re all at the same z level, which means that the text overlaps with one of the colors behind it. It looks strange and isn’t useful.
SOLUTION: Make onsets a different z level (10) than middles (20), which should be a different z level than codas (30).

 

Render Check/Hide button when all 15 are in the box collider

For this one, I can use the same render script I used for the answer text inside the Check/Hide button itself.

Okay, so now I need to access the Check/Hide button from the collider.  OR I could put the collider script on the Check/Hide button.

https://forum.unity3d.com/threads/cant-gameobject-find-on-ui-text.293008/

Okay I need the collider script on the collider bc of this:

    void OnTriggerEnter2D(Collider2D other)

So instead I’m going to use this:

http://answers.unity3d.com/questions/1203661/how-to-make-buttons-disappear-and-reappear-in-the.html

Noooo this is still for gameobjects, not for buttons.

Huh – why is the child of the button not getting enabled? I’ll just hack it and enable it specifically in the code.

 

Show/hide button

So now I’m thinking that I shouldn’t use z to have the text be behind the buttons, but instead have it be the mesh renderer be enabled or disabled depending on need, by tag, like I used to do in the other Show/Hide button.

https://docs.unity3d.com/ScriptReference/Renderer-enabled.html

I made the show/hide button work to render and not render the answers over the answer flashcards!

It requires that the answers be tagged as “Answer”, so the prefab will need to be updated for that. #todo

#todo – I would also like the text to look more child-friendly.

A cool thing is that in googling this rendering thing, I also found the function at the bottom, that toggles the rendering every second. I’d like to use that to remind users to hit buttons – or at least at the start, to hit the first answer button. #todo

There’s a chance I might be better off with a brief tutorial, but the flashing buttons could be a segue (or could be good in addition to it).

The next thing I want to do for the show/hide button is :

  • only have it appear when all of the box colliders for the answer slots are filled in (what if there has been a collision but it hasn’t *stayed* there)
  • and then have the name of the show button change to “hide” in context – and change the name to “check” instead of show
  • make the show/hide button look more attractive
  • make it flash when it shows up, and say “check your answers!”
  • after that, it’d be nice if there were a tally of how many correct slots you did – __/15.
  • but it’s unclear how much some of those goals matter in comparison to getting it massively expanded in terms of content

using UnityEngine;
using System.Collections;
using UnityEngine.UI;

public class Show : MonoBehaviour
{
    private Renderer rend;
    Button myButton;
    private GameObject[] AnswerTexts;

    void Start()
    {

        myButton = GetComponent<Button>(); // access button component 
        myButton.onClick.AddListener(() => ShowHide());
        AnswerTexts = GameObject.FindGameObjectsWithTag(Answer);
        Debug.Log (Answer);   

        foreach (GameObject answer in AnswerTexts) 
        {
            rend = answer.GetComponent<Renderer>();
            rend.enabled = true;

//                    r.enabled = false;
        }

    }
        

        void ShowHide()
        {
            
    //        GameObject[] consClusts = GameObject.FindGameObjectsWithTag(ConsCluster);
          
            foreach (GameObject answer in AnswerTexts)
            {
                
                if (answer.GetComponent<MeshRenderer>().enabled == true)
                {
                    answer.GetComponent<MeshRenderer>().enabled = false;
                    foreach (Renderer r in answer.GetComponentsInChildren<Renderer>())
                    {
                        r.enabled = false;
                    }
                }
    
                else if (answer.GetComponent<MeshRenderer>().enabled == false)
                    {
                    answer.GetComponent<MeshRenderer>().enabled = true;
                    foreach (Renderer r in answer.GetComponentsInChildren<Renderer>())
                        {
                            r.enabled = true;
                        }
    
                    }
            }
    
    
        }
    

//    // Toggle the Objects visibility each second.
//    void Update()
//    {
//        // Find out whether current second is odd or even
//        bool oddeven = Mathf.FloorToInt(Time.time) % 2 == 0;
//
//        // Enable renderer accordingly
//        rend.enabled = oddeven;
//    }
//}

}

 

 

 

 

Making better prefabs

Before, I did a thing that probably wasn’t the most advisable – have a mesh for the background of my buttons, with the color material added on, and then scaled it like crazy to make it the size I wanted. That was then embedded in my prefabs for each moveable letter.

Unsurprisingly, this got wonky in the following ways:

  • every time unity updates, it lost its link to the material, or to the prefab, and turned bright pink
  • it was scaled bonkers-like, making all other scaling around it really annoying (particularly since text, notoriously tricky to scale, is involved)
  • It just didn’t seem like the most elegant way to do this

So today I finally decided to fix this. I didn’t do it in the most elegant way, but I used Grab to get the color and shape out of it (I actually like the color and shape for a beginning draft, and it’s what I prototyped with and it worked, so no need to change it now). I checked the scale size on Unity to find out that it was approximately 4/3 x/y. Then I sized and resized it in GIMP, and brought each png back as a prefab and compared. Wound up being pretty perfect at GIMP’s canvas size 122 x 88 pixels at 144 ppi.

8-16-17

I believe that I can’t add in prefabs after the fact – is that true?

 

https://www.google.com/search?rlz=1C5CHFA_enUS757US757&q=how+to+make+text+mesh+appear+above+sprite&oq=how+to+make+text+mesh+appear+above+sprite&gs_l=psy-ab.3…615.615.0.3390.1.1.0.0.0.0.437.437.4-1.1.0….0…1.1.64.psy-ab..0.0.0.HlFg82oOUVE

I followed these instructions to get my textmesh to appear above my new 2D sprite. The textmesh is childed to the sprite. The sprite is Z=0, textmesh is Z= -1.

The sprite I’m using is from the png onset-block-updated-122-88.  I’m going to child that to an empty game object just named “1” so that my scripts work with the onsets.

With the textmesh childed to the sprite, the sprite is no longer involved in the scale shenanigans I’ve been using to make the font quality look nice. I’d like to return to this, and to try out TextMeshPro again, bc this is some buuuullshit that I have to do this wonky thing with the text and there HAS to be a better way, right?

Alright, now I have an empty gameobject parent (1), that has childed to it the sprite (onset-block-updated-122-88) [gotta name that better] and the text (Text).

It needs the following components:

  • Box Collider 2D [for Move Object Script]
  • Rigid Body 2D [for Move Object Script]
  • Move Object Script
  • Play Sound Child Script

This way, the children only have one component each. For the sprite, it’s just a sprite renderer. For the text, it’s just the textmesh.

Hopefully this will keep it simpler!

So on the one hand, my next goal could be:

Completing this for all of the prefabs inside this scene, so that everything looks beautiful. That includes:

  • middle block (same as onset but different color)
  • end block (same as onset but different color)
  • 3 answer slots
  • flashcard (this one is particularly inelegant, with the textmesh offscreen – I should probably just make the textmesh in the back, and I could consider having a button to press to show the answers (which should only be possible if all the answer slots are filled in)
    • This is an exciting idea, because it’s one step easier than checking the answers and giving feedback. It basically just gives *you* the answer, and then you can correct it. Not sure how this would work with kids, but there’s a chance it’d be good. It’s at least a thing to make and see how it works – maybe the feedback system isn’t even necessary and this is enough. But at the least it’d be a useful step as a comparison in prototyping.
    • This is also useful to think through because when I redo the flashcard, it should be with this in mind.
    • Also, how do kids know they’re supposed to press the flashcard? Wouldn’t that be nice if it was more obvious, or if there was a brief tutorial

Question for self – if I have the textmesh overlaying the sprites as *part* of the prefab, will that mean that when/if I change the prefab, I’ll have to change all of the text again? That feels unfair. And feels like it relates back to – I should have the text brought in automatically. Maybe I should go ahead and build it that way, and hope that I can do it well and it passes the app store. Cuz otherwise I’m going to spend an ungodly amount of time putting text in.

Hm. Nah. One thing at a time, Brittany. Let’s get this in the app store and build up features from there.

Next step – make a good prefab for the middle bits.

  • get png from the onset
  • get Grab of the middle block, to get the color
  • use GIMP to change the purple to orange
  • save as .xcf
  • export as .png
  • put in sprites

Then, make a duplicate of the onset prefab, rename to middle, and switch out the sprite. Everything else should be the same.

#todo – this is probably a great instance of a branching prefab. Or a linked prefab. I don’t know how to do those, so I’m just going to have them be entirely independent. Excited to someday make these link up.

As part of this, I should decide on some naming conventions and keep them stable. For instance “onset-block-updated-122-88” is not a great name. It should probably just be

  • onset-block-122-88

OR

  • OnsetBlock

Unsure if I should keep in it what size it is, bc it was actually a real pain to figure out the size. I think that means I keep it in. How about:

OnsetBlock-122×88

That feels optimally clear without looking too awful. Still looks kinda bad. Okay I’m gonna try that out with the middle blocks and see if it feels good.

Actually it looks like textmesh content doesn’t change with prefabs. This is GREAT news for me in this instance – I just realized my textmesh color was grey-ish, and that it was making the blocks look weird. I changed the onset prefab textmesh color to white (FFFFFFFF) and ALL of the onsets changed. Didn’t need to even press any buttons. YAY

Current question:

what should z be on gameobject

I dislike how when I zoom in on a gameobject, it disappears bc of where its z is. That’s a frustrating thing to happen in a 2D space, but I guess I get it. #todo – I’m unsure what to put my z objects at. It feels weird to put them artificially back (z = high positive number like 20) just so that I can zoom in, but it’s also annoying having them disappear when I zoom. I don’t really understand spacial relationships very well so this might be interacting with it.

Also somehow all my onset collider boxes are totally off. Gonna see if changing the prefab works. YAY – I couldn’t change the collider box *in* the prefab, but I made an instance of it in my scene, changed the collider box, and hit “Apply” and everything else changed. Crucially, the textmesh contents did NOT change (like before). This is very exciting.

So I need to change the sprite names, both under Onsets AND middle block. cuz they both wound up being wacky. Going to finish Ends first.

Curious, I’d never noticed before that the end blocks were a different size than the others. Or, I noticed, and didn’t care, cuz this was some pretty rapid prototyping that I’m leveling up!

Alright, this is good progress. Slow, but good. Gonna take a 30-min lunch break and set this laptop aside so I get out of work mode. And charge this laptop, too. Maybe it’d be good for me to switch locations after lunch.

Nevermind, the kitten’s asleep on my foot, so I’m never moving again. The only things in reach are popcorn, red wine, and my computer, so I think I’m all set! Time to get working again.

  • onset: purple, hex color : 8A3FE7FF
  • middle: orange, hex color : F85757FF (I think?)
  • coda: green, hex color : 3BCC36FF

I don’t *quite* know how to put that into GIMP, but it seems to be working to just use the grab method followed by color picker.

#todo – make kerning / vertical and horizontal centering consistent with fonts on these buttons. In the meantime, I’m going to just eyeball it.

Okay I just want to reiterate that now that I learned how to deploy prefabs better, they are AMAZING HOLY COW. This little “apply” button is the BEST THING EVER.

#todo – related to kerning, I might need to have different prefabs for different widths of texts, if I want this to be automatic. OR I can just do it manually for a while. It really doesn’t interfere with anything, and I believe that having automated feedback would be FAR more desired by teachers than having the kerning be perfect. So let’s keep to our priorities here!

Okay, so possibly instead of having just the answer block as prefab, I should maybe have the entire answer situation (3 colorful slots + block) as prefab. That way they’ll each look the same. This argument could also be made for onset, middle, and coda rows, but I’m not sure about it yet. It feels right-er for the answer portion, but I can’t pinpoint exactly why.

Ooh now that my z numbers aren’t bonkers, I can zoom in on everything. Was that actually just because they weren’t even, and it was messing with it? Can’t say for sure but whatever it is, this is nicer this way.

Okay, so when all the blanks are filled in, there can be a big “check your work” button. This avoids having kids try to press the button before finishing. It’s not ideal, because it may encourage them to hit it and get the answers – so something about the feedback system will eventually want to be encouraging them to do self-reflection.

#todo Plan for giving feedback: I’ll start just giving them the answers. Then I’ll move on to saying how many they got right on the first try, then the second try (and recording it somewhere, so that they’re encouraged to go back and check their work before pressing the button), then I’ll potentially move on to automated/guided feedback.

#todo Gosh I gotta fix the appearance of my menu. It’s needlessly html-looking.

I wonder if I should try to just get a single scene into the app store, or if I should try to get a small menu up and running. That might make more sense, and look less like a Beta version. Although if that doesn’t work, I can always go back to the single scene version.

#todo

Thing to fix – now that they’re all beautifully in the same z spot, they actually overlap each other in disturbing and distracting ways. Fix this soon.

#todo : make prefabs for quiet blocks that don’t have playsound script on them

wth is “graphic raycaster script” on the menu? Without it the buttons don’t work. Fascinating.

I removed “Canvas scaler” and it still works, but doesn’t get rid of the 2 yield signs “the rferenced script on this behavior is missing” and “the reerenced scirpt on this bheavior (Game Object “) is missing!

So I put canvas scaler back on cuz I think that has something to do with how the canvas appears on different pieces of technology.

Okay, so now I’ve got it reduced down to just 3 levels, and it’s mad at me for something about the buttons in the menu.

https://forum.unity3d.com/threads/solved-the-referenced-script-on-this-behaviour-is-missing.381611/

WOOOOO I FIGURED IT OUT it was something about the Menu button inside the levels. Basically when the scene loaded it seems to have noticed that the Menu button’s script was defunct, and then threw a warning. Odd that it didn’t show up when the level was loaded by itself (as opposed to through a button on the menu), but that’s okay – I feel pretty good about being able to find errors like that faster now.

That being said, there’s apparently this magic script that can go find them – but after about 30 seconds of trying to use it, I couldn’t figure out how to.

Finding Missing References in Unity

#todo – at some point I’d love to figure out how to use this as a tool. Wasn’t worth the rabbit hole this time tho.

Do I need to compress the audio and/or delete all the audio that’s not immediately relevant? That might be worth it, keep the size down.

Now I’m going to the backup copy to find out what words were in the other scenes, since I totally messed with these. Backups are important!

I’d like to go make mockups of everything, with the content in it, so that if smething happens iwth Unity, it just isn’t a big deal.

8/17 – So yesterday evening around 6:30PM I finished getting it set up pretty-like with 3 levels (2 difficulties each) and a single menu screen. No errors or warnings!

Today my goal is to start the process of getting it on the app store. This is going to be pretty painstaking so I’m going to keep careful logs of it and be patient with myself.

 

Make answer blocks buttons

Guys!!! OMG OMG OMG. I’m pretty psyched bc when I was thinking about some sort of app store preview, I realized that it would be better if the answer blocks were buttons and were shaded when you pressed them.

Sooo I quickly whipped that up in my app, used the prefab, and then made the necessary alterations!

  • made a button the size I wanted (155×53 in Unity width/height, but there’s some scaling stuff going on from being a child of other stuff … honestly I’m not super sure I understand this but I’m at least writing what I did)
  • used the source image AnswerBlock190x88 (unsure if this is necessary)
  • in Button Script, made the pressed color darker (A9A9A9FF)
  • The button is childed to each number instance under Answers. Text is a separate child (This may be wrong, but I wanted to keep using my textmesh script … should probably make this simpler at some point #todo)
  • Then, I put the entire Answers chunk under Canvas (it won’t show up unless you do that, since it’s UI entities)
  • Changed z numbers to the following:
    • Answers: 0
    • Button: -1 (as long as it’s a lower number than Text, it will hide the Text)
    • Text: 0

Xcode error fixing

  • does not have sandbox access for frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled

For this one, I unchecked and then rechecked each of the libraries on the right side bar. I believe that the error then went away, because I started at 348 and now I’m at 347.

Hmmm. I seem to have forgotten to clean my Xcode before building. Seeing if that helps.

Actually now the build failed, and there are 365 buildtime issues. Um.

Okay, so it turned out it had forgotten it had a link to a library. Went it checked and unchecked it, and now it’s happy. Still 355 issues.

Apparently these aren’t supposed to cause problems for app store reviewing ? (from 2014) …

https://forum.unity3d.com/threads/unity-ios-64-bit-support.287172/page-3

I’m getting some sort of memory leak …

https://spin.atomicobject.com/2016/01/25/ios-memory-leak-xcode/

Okay. I’m going to just try to upload it to iTunes connect and come back if there are more problems, because my build is succeeding

Update:

I apparently had gotten it all set on my apple developer page, but NOT in my iTunes Connect My Apps section of that app. It validated and found it nicely, then had a random, different error. Going to see if I can replicate it right now.

The other thing I’m looking at is the app preview. This website has a pretty easy way to do it:

https://developer.apple.com/support/app-previews/

It makes me wonder if I need to have the white flashcards make some sort of button behavior, like change color when they’re touched. Otherwise, it won’t show up in the app preview.

Okay, the upload was successful this time.

Oh! I didn’t realize this, but now it gets processed by Apple before I get to fiddle with it in my iTunes Connect. Okay, cool! First step done. Apparently I get an email from them when they’re done processing.

https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/UploadingBinariesforanApp.html

WOOOOOO okay this is silly but I’m going to memorialize this email:

Dear Brittany Mclaughlin,

The following build has completed processing:

Platform: iOS
App Name: Vowel Teams
Build Number: 0
Version Number: 1.0
App SKU: SU0817171
App Apple ID: 1272798152

You can now use this build for TestFlight testing or submit it to the App Store.

If you have any questions regarding your app, click Contact Us in iTunes Connect.

Regards,

The App Store team

Good job, me!

Do I need to handle the fact that it’s clearly designed for kids? Or can I say it’s an early reading app just for people in general.

Text I wrote for promo:

Do you work with early readers? Are they struggling with phonics concepts like vowel teams? Use this as a tool to help them build words with letters and sounds.

Text I wrote for description:

This is a tool for those helping people learning how to read practice tricky concepts about letters and sounds. It has been used successfully in reading programs with tutors.

First, choose the level and difficulty – start with Level 1, easy mode. This has all the sounds on each of the chunks. Show the early reader how to press all of the buttons, listen to the sounds, and repeat them. Then, start solving the puzzle – when pressed, the white block says a word. Build the word out of the letter chunks, matching the colorful blocks to the same color slot. Don’t correct them right away if they mix something up – this tool is designed for them to reflect on their own answers. Once they’ve filled in all the words in the level, help them sound out each word. As they sound it out, see if they find their own mistakes – if they don’t, ask broad questions like – is that the same sound you hear in the answer block (and press the answer block).

After the person you are tutoring is comfortable with easy mode, challenge them to hard mode! Here, the only blocks that make noise are the white answer blocks. Encourage them to sound out the colorful blocks while they select them, and correct them as they go if they are using the wrong sounds. If this level is too tricky or discouraging, repeat the easy levels and do word building exercises with similar letter and sound combinations outside of the app.

Remember, this is a tool to help you tutor! You’ll want to reinforce the skills practiced in this tool with outside reading (especially with related words), and other early reading activities.

 

Changed it to adults:

 

Promo:

Do you tutor adults learning how to read? Are they struggling with phonics concepts like vowel teams? Use this as a tool to help them build words with letters and sounds.

Description:

This is a tool for those helping adults learn how to read, where they can practice tricky concepts about letters and sounds. It has been used successfully in reading programs with tutors.

First, choose the level and difficulty – start with Level 1, easy mode. This has all the sounds on each of the chunks. Show the early reader how to press all of the buttons, listen to the sounds, and repeat them. Then, start solving the puzzle – when pressed, the white block says a word. Build the word out of the letter chunks, matching the colorful blocks to the same color slot. Don’t correct them right away if they mix something up – this tool is designed for them to reflect on their own answers. Once they’ve filled in all the words in the level, help them sound out each word. As they sound it out, see if they find their own mistakes – if they don’t, ask broad questions like – is that the same sound you hear in the answer block (and press the answer block).

After the person you are tutoring is comfortable with easy mode, challenge them to hard mode! Here, the only blocks that make noise are the white answer blocks. Encourage them to sound out the colorful blocks while they select them, and correct them as they go if they are using the wrong sounds. If this level is too tricky or discouraging, repeat the easy levels and do word building exercises with similar letter and sound combinations outside of the app.

Remember, this is a tool to help you tutor! You’ll want to reinforce the skills practiced in this tool with outside reading (especially with related words), and other early reading activities.

 

Alright. Now it’s “waiting for review”.

In the meantime, I should get a privacy policy for this app… right?

 

 

Building & Xcode

Yesterday I finished a MVP version of the vowel teams (3 levels, 2 difficulties each, one menu screen) with no errors or warnings in Unity.

Today my goal is to start the process of getting it on the app store. This is going to be pretty painstaking so I’m going to keep careful logs of it and be patient with myself.

This is a new computer, so first I think I have to just get Xcode set up, remember my logins as an apple developer, etc.

Ooh I’m going to add these into my Debug logs.

https://docs.unity3d.com/ScriptReference/Debug-isDebugBuild.html

Did that!

At some point, I might want to go clean up the comments in my scripts – they’re little notes to myself and aren’t always well done. #todo

I made a new cover for it (basic orange square with the words “Vowel Teams” centered on it), cover.png.

Now I’m going to figure out how to automatically sign my app.

https://docs.unity3d.com/ScriptReference/PlayerSettings.iOS-appleDeveloperTeamID.html

Cool, my team ID is under my membership account info.

https://developer.apple.com/account/#/membership

So, I already have an itunes connect thing.

https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/CreatingiTunesConnectRecord.html#//apple_ref/doc/uid/TP40011225-CH13-SW1

Logging into that.

https://developer.apple.com/library/content/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Chapters/SubmittingTheApp.html

Do I want to try this as a test build first? Think about this.

Test information draft: This app is a tool to help any early reader practice building words out of sounds and letters. It has been used in community-centered reading programs and has helped early readers improve their skills. It is often used in combination with a reading tutor to help check the answers. First, the user clicks on which level they want to practice. Then, they click on the white answer blocks to hear the words to build. To build the words, the user touches each of the colorful letter blocks, listens to the sounds, and compares them to the sounds in the white blocks. The user moves the letter blocks to the matching color slots next to the white answer blocks. Finally, if available, a tutor or friend helps the user listen to the sounds and check if the answers are correct.

 

https://unity3d.com/learn/tutorials/topics/interface-essentials/build-and-player-settings

 

I’m getting 3 warnings when I build my unity:

  1. Game scripts or other custom code contains OnMouse_ event handlers. Presence of such handlers might impact performance on handheld devices.
    UnityEditor.HostView:OnGUI()
  2. Microphone class is used but Microphone Usage Description is empty. App will not work on iOS 10+.
    UnityEditor.HostView:OnGUI()
  3. Splash screen images not provided: iPad Portrait, iPad Landscape, iPad Portrait/Retina, iPad Landscape/Retina
    UnityEditor.HostView:OnGUI()

Huh. Looks like this is a known bug, and can prevent the app store from accepting submission.

https://issuetracker.unity3d.com/issues/ios-webcamtexture-and-microphone-classes-are-used-in-empty-unity-projects

Hmph. I tried to get rid of #2 bc internet mentioned something about cameras, so I got rid of all of the “audio listener” components on all of my main cameras in each scene. To no avail, did another build and that error is still showing up.

I wonder if I should add those back in or not … 😉

https://forum.unity3d.com/threads/ios-10-0-and-xcode-8-compatibility.430103/

Okay this is what AudioListener is. I don’t think I need it, but let’s keep an eye on it. LOL nm “There are no audio listeners in the scene. Please ensure there is always one audio listener in the scene” adding them back in now.

https://docs.unity3d.com/Manual/class-AudioListener.html

Huh. The error message about microphones just went away on its own. Now I’m just left with OnMouse_event handlers and Splash screen images. (I thought I didn’t need splash screen images bc I’m not using Unity pro?)

Ah. So I just checked, and when I deleted the comment that “No microphones are used in the app”,  the microphone error came back. How interesting.

Alright I think I fixed the microphone issue. Using this. It’s in AV. I also turned off the camera thing. I might double up and also do the “No camera/location/microphone” is used in the Player Settings in Unity.

https://forum.unity3d.com/threads/ios-10-0-and-xcode-8-compatibility.430103/

Okay, so I fixed #3 (the splash screen error) by uploading images for ipad screens. Despite the fact that using unity personal doesn’t come with splash screens. Let’s see if that keeps it okay.

Now onto #1, because I think I’ve solved #2. #1 is the stuff about OnMouse even handlers.

There seem to be mixed ideas on whether or not this was actually a problem 3 years ago (http://answers.unity3d.com/questions/124198/onmousedown-alternative-for-mobile.html).

Let’s see if I can find something more recent.

Here’s an unpleasant way to do that someone posted recently (http://answers.unity3d.com/questions/1366245/what-shall-i-use-instead-of-onmouse-event-handlers.html), but links to 3 years ago again: it: http://wiki.unity3d.com/index.php/OnTouch

This one looks cleaner.

https://stackoverflow.com/questions/44583542/what-shall-i-use-instead-of-onmousexxx-event-handlers

Is there something I can do with an if statement so that it does MouseDown if it’s on the computer, by raycast if it’s mobile? Or am I just making this for IOS so it doesn’t matter.

Implementing Touch Controls in Unity 3D

sigh: http://answers.unity3d.com/questions/908834/onpointerdown-vs-onmousedown.html

“So the answer to that is that you use OnPointerDown on UI objects, while using OnMouseDown for in scene objects.”

 

This is what I’ve been using : “http://answers.unity3d.com/questions/566327/drag-object-relative-to-camera.html”

Going to give this a shot on my ipad – I haven’t tried this new version on an ipad yet (bc I didn’t have the dongle thing, eek!), but I’ll get this going on multiple sides if I do that too.

Cleaned in Xcode: I have no idea what this means but it looks like it reduced my warning signs by dozens upon dozens. I guess it can just automatically handle a lot of the stuff?

Red library: One of my libraries is showing up as red in the left sidebar in Xcode, which apparently is non-ideal. [https://sourceforge.net/p/zbar/discussion/1072195/thread/5f8be82d/#3388] says it might be because interlinked libraries depend on each other but may be in the wrong order.

So, I wound up clicking on the file where it came from (to the right), and the only thing it had available was a .tbd file by the same name, so I linked it to that one instead. After I quit and reloaded, the red was gone.

LaunchScreen weirdness

This is acting weird – do I even need it?  What happens if I delete it and its corresponding .png?

LaunchScreen-iPad.xib

https://www.google.com/search?q=purpose+of+LaunchScreen-iPad.xib&rlz=1C5CHFA_enUS757US757&oq=purpose+of+LaunchScreen-iPad.xib&aqs=chrome..69i57j0l5.2265j0j7&sourceid=chrome&ie=UTF-8

Removed references to them, and … it seems okay? It got Buildtime errors down to 0, but I haven’t actually built it on the ipad (annoyingly, waiting for the update on that one now, so …)

Updating iPad ios to 10.3.3  – seeing if this helps me make the right type of build. The problem is, a lot of iPads that community centers have won’t be able to work with this high an ios, so I need to go somewhere where I have access to older ios systems, too. Or simulate them? Unsure which one makes more sense. #todo

8/18:

I’m getting the following error when I open up Unity. As far as I know it’s new. The link below believes it’s a benign error due to updates. Putting it here to keep an eye on.

Error loading launcher://unity//Users/britts/Library/Unity/Packages/node_modules/unity-editor-home/dist/index.html?code=CYEA0W_h9FpWtn1Av8PPJg003f&locale=en&session_state=8600923c3b9541c337c4e10a78c884dc809a25d49afa747c48c2d3686eb466fa.ergTREDfc8PXm5X1NmCXLg002f#/login

https://forum.unity3d.com/threads/error-loading-launcher.486127/

Another odd error I’m getting:

Metal: Editor support disabled, skipping device initialization

Well that one seems to literally be about rendering metallic shading.

https://forum.unity3d.com/threads/mac-editor-metal.446365/

Alright, I’ve got 348 buildtime errors. Let’s see if I can get that to 300 today.

My .xctest is red, and doens’t appear to exist.

What is a storyboard? Main.storyboard?