Beginning 3D Game Development with Unity

Discussion in 'Teaching' started by 3D Junkie, Jun 20, 2011.

  1. Newbquest

    Newbquest

    New Member

    Joined:
    Apr 2, 2012
    Messages:
    24
    hey guys,

    I started a page at my site where I will collect as many bugs between the book and Unity 3.5 as possible. I am only up to Chapter 4 and am trying to replicate stuff on my end before I add it to the page but if you want to send me known stuff to newbquest a t g mail d o t com (goofy spelling for spambots) or add them as comments on that page I'll be happy to add them.

    http://newbquest.com/bugs-and-fixes...nt-with-unity-by-sue-blackman-with-unity-3-5/

    I know for us as learners our first impulse is to think its our fault so these kind of things can be especially challenging. I will also mention these in my on going chapter by chapter review of the book at my site. I'm up to Chapter 3 in the reviews.

    http://newbquest.com/category/begin...ith-unity-by-sue-blackman-epic-review-series/

    Good luck everyone!
  2. MichaelHarte

    MichaelHarte

    New Member

    Joined:
    Nov 28, 2011
    Messages:
    8
    Hi Sue

    I am at chapter 14, where I loaded the structures. I notice the cavern is not visible from above when the structure is lowered to ground level. Is this correct. ?. is there some mesh import problem ?. There are two structures prefabs available..one called structures prefab, and the other is simply called structures. Also page 729 doesn't show animations in the interactor..I got an index array error, before I added lid open, and closed animations.

    Best regards,

    Michael.
  3. joedgrant

    joedgrant

    New Member

    Joined:
    Mar 16, 2010
    Messages:
    23
    An odd bug I've been getting. I finished the tutorials in the book..great book.
    But when it runs animations made in unity, on mesh objects, the collision animates but not the mesh. Is there anything I could have set odd that could cause this?
  4. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi Joe,

    I've never seen that- very weird
    does the mesh animate when the Animation view is open?
    is it a regular transform, or a skinned mesh/bone system?
    is it only one particular mesh? if so, which one?
    can you post a very tiny sample? maybe just a package of the animated object?

    hi Michael,
    the top of the cavern in my terrain was a little bit above ground, so it may be deactivated - otherwise if you bake lights you'll get a strange shadowed area
    also, you are looking into the cavern from the outside, so you won't see the outside faces- they are only drawn on the inside of the cavern

    the "Structures" object is the imported asset, the "Structures Prefab" is the version where I've fixed the Scale Factor and fixed all the materials on the imported objects, and then saved the new version as a prefab
    when I save the Structures Prefab as a UnityPackage, it also needs to save the original Structures imported asset because that's what has all of the mesh information and textures

    assuming 729 is the Stone Lid, good catch! Yes, that should be "stone chest close" in element 0 and "stone lid open" in element 1 for the Stone Chest Lid's Interactor script
  5. hdfreema

    hdfreema

    New Member

    Joined:
    May 2, 2012
    Messages:
    5
    Hi Sue,
    First, thanks so much for writing this book, it's been great!
    Like a lot of others, I'm also starting with Unity 3.4 and have hit a wall in Chapter 10. I think you mentioned earlier in the thread that you'll be working on new downloadable assets of the finished code, is that right?
    I'm thinking about adopting this text for a course for art students interested in plunging into game creation, but since they'll all certainly be using 3.4 (or later whenever we get around to finalizing the class content), I'd want to hold off on adopting it until the downloadable resources are up-to-date...
    Okay, so long preamble for a short question:
    Any sense of an ETA for revisions for 3.4/3.5?
  6. MichaelHarte

    MichaelHarte

    New Member

    Joined:
    Nov 28, 2011
    Messages:
    8
    Hi Sue,

    Have reached the end of chapter 15 finally. Have a couple of questions. The golden sleeve in the bowl is too high to be picked. Did I miss something here ? Do I have to construct a ramp in the corridor or is there access from somewhere at the rear perhaps. ?
    The cavern water, steli Topi, volume light, and spotlight have to be positioned well above the terrain to be in correct position inside the cavern in play mode. should the cavern be visible from above ..in my case it is not.
    My tree of life is very plain, and the leaves are rectangles. Doesn't seem to want to take any textures.he
    The trigger group for access down are intermittant.. the terrain drops but oftentimes I still can't go down the ramp to the temple lower level.

    Many thanks,

    Michael Harte.
  7. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi Heather,
    can you be more specific about "hit a wall"? ;)

    the two biggest differences are:

    to use "internal" instead of "private" for the vars
    private prevents other scripts and outside applications from accessing the variables
    internal only prevents outside apps, so that's the one to use now

    and
    remove #pragma strict from the top of the scripts
    when authoring for mobile variables must by typed
    but Javascript was designed to figure out the type for you if you skip that part
    problem comes with arrays- regular javascript arrays apparently don't store the type for their contents- it's dynamically typed as needed- which is what gets flagged with #pragma strict
    Unity arrays must be typed, but there's lots of normal array things they can't do- that I've used in the book...

    if you are serious about using the book for a course, PM me and I'll make sure you get the scripts stuff needed to move forward

    Sue
  8. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi Michael,

    golden sleeve:
    opposite the door that leads down to the cavern is the door that leads up to the balcony- Door Upper- where you can get the golden sleeve
    I think I have you open it 78 degrees? so maybe that's what you missed?

    cavern stuff:
    yes, they may be above the terrain, that's one of the reasons we turn them off until you are inside the temple
    if they are on, you probably won't see them from the top because the faces for the cavern are on the inside
    but, if you baked the light with the cavern on, the trees and the terrain would get the shadow!

    tree:
    use the leaf material BigTree_Leaves and BigTree_Branches, you will need to load it into the leaf groups/nodes
    I do remember it not loading the material occasionally, but it comes in with the TreeGenerator package so you should be able to find it

    trigger group:
    make sure the fpc is triggering the colliders and that they are all set to is trigger
    if the terrain drops, there should be nothing left to block you
    maybe try deactivating it during the game to see if the terrain or something else is the problem

    hope that helps-

    Sue
  9. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Hi Sue

    I'm enjoying your book and have got as far as Chapter 10. Here I have a problem!
    function LookUpState(object : GameObject, currentState : int, picker : String)
    {
    var element : int = 0; // Variable to track the element number for a match
    // Check the passed in cursor texture to see if it is the default cursor; rename it if so
    if (picker == gamePointer.GetComponent (CustomCursor).defaultCursor.name)
    var matchCursor : String = "default";
    else
    matchCursor = picker;
    print ("Object: " + object.name);
    print ("State: " + currentState);
    print ("Picker: " + picker);
    for (var contents : String in stateArray [currentState])
    {print ("Contents " + contents);
    // Split the contents into a temporary array
    var readString : String[] = contents.Split (",".Chars[0]);
    // If there is a match for the cursor...
    if (readString[0] == matchCursor)
    {
    print ("We have a match with cursor: " + matchCursor + " on " + object.name);
    //print (replyArray [currentState][element]); // Print reply that corresponds to the matched stateArray
    // Send the correct text message off to the GameManager
    var actionMsg : String = replyArray [currentState][element];
    print (actionMsg);
    controlCenter.GetComponent(GameManager).actionMsg = actionMsg;//replyArray [currentState][element];
    // Change the object's state to the new state by calling its ProcessObject function
    var nextState : int = parseInt (readString [1]); // Convert the string to an integer
    object.SendMessage ("ProcessObject", nextState); // Send the new state to the object
    }
    else
    print ("No match for the " + object.name);
    element ++; // Increment the element counter by one
    } // End for loop

    }

    This extract is from the ObjectLookup script. I have checked it against your code and it matches it OK as does also the GameManager script. The problem is at the "controlCenter.GetComponent(GameManager).actionMsg = actionMsg; //replyArray [currentState][element];", which gives a run time Null Reference Exception error. Try as I might I cannot sort this out; can you help?

    I have deleted the #Pragma strict code, as you suggest, to get rid of the downcast warnings.

    I have now (15/5/12) tried to access other components in GameManager, but continue to get the runtime error message. I cannot access GameManager from ObjectLookUp, and don't know why.
    Last edited: May 15, 2012
  10. MichaelHarte

    MichaelHarte

    New Member

    Joined:
    Nov 28, 2011
    Messages:
    8
    thanks Sue, it is odd about the trigger group.. I can see the terrain dropping but sometimes I am still prevented going down.. I will study this to see where the invisible block is coming from keeping me at main floor level..ground 0. There are a load of errors arising in the game manager script when pragama strict is added..they mainly refer to currentInventoryObject[x] = assignments. I think I read in postings that this directive should be commented out.

    page 779 I added animation clip to interactor.. Also added interactor and lookup script logic to the loose music glyph to place it in drawer as well as take it out again.(.a bonus, albeit worthless, game feature). The glyph that was in the drawer and the spare glyph, and activating the drawer logic took a while to sort out. Now at Menu chapter..(8 months later).

    many thanks and best regards,

    Michael.
  11. MichaelHarte

    MichaelHarte

    New Member

    Joined:
    Nov 28, 2011
    Messages:
    8
    Hi Sue

    In chapter 16, I am getting an index error for playerSettings[10], for the cursorColorChange value. I finally added an UpdateSettings() call at the start of LoadPlayerSettings() function. This has eliminated the error, which I am guessing puts suitable default values into each of the array elements. These will, no doubt, be replaced by proper values when the UpdateSettings is called by the script. I'm not sure if I have just hid an underlying mistake by doing this.
    There is some divergence between the element descriptions in the declarations, and the functions. element 9 becomes element 10 on page 847 for cursorColorChange. I may have missed, or overlooked something.

    Best Regards

    Michael
  12. rwp908

    rwp908

    New Member

    Joined:
    May 18, 2012
    Messages:
    1
    Hello Sue,

    Just purchase the book from Barnes and Noble and building Chapter 16 many errors are being displayed. Is there a corrected version for the book? My understand is the book was complied with Unity 3.3 and now 3.5 is out errors below show up. Or what steps will I need to proceed with correction? I have taken all the private statements out.

    -----EndCompilerOutput---------------

    - Finished compile Library/ScriptAssemblies/Assembly-UnityScript.dll
    Assets/Adventure Scripts/GameManager.js(104,45): BCE0120: 'Interactor.iElement' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/GameManager.js Line: 104)

    Assets/Adventure Scripts/GameManager.js(116,40): BCE0120: 'Interactor.soundFXVolume' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/GameManager.js Line: 116)

    Assets/Adventure Scripts/GameManager.js(240,41): BCE0120: 'Interactor.iElement' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/GameManager.js Line: 240)

    Assets/Adventure Scripts/GameManager.js(264,56): BCE0120: 'Interactor.iElement' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/GameManager.js Line: 264)

    Assets/Adventure Scripts/MenuManager.js(589,40): BCE0120: 'Interactor.soundFXVolume' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/MenuManager.js Line: 589)

    Assets/Adventure Scripts/ObjectLookup.js(178,99): BCE0120: 'Interactor.iElement' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/ObjectLookup.js Line: 178)

    Assets/Adventure Scripts/ObjectLookup.js(198,39): BCE0120: 'Interactor.processing' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/ObjectLookup.js Line: 198)

    Assets/Adventure Scripts/ObjectLookup.js(288,60): BCE0120: 'Interactor.soundFXVolume' is inaccessible due to its protection level.

    (Filename: Assets/Adventure Scripts/ObjectLookup.js Line: 288)
  13. joedgrant

    joedgrant

    New Member

    Joined:
    Mar 16, 2010
    Messages:
    23
    Hi Sue,
    Finished the book (While ago actually) and integrated a third person camera and animation system (Currently adding a 'play on player' list of animations for contextual use and pickup animations).
    http://cgcookie.com/blender/images/gil/ (My third person character.)

    Thanks again for this... It's given me a starting point for a game I've wanted to make since I started in the industry a decade ago. (Stuck making first person shooters... a genre I don't particularly enjoy.) Really, really enjoyed the book. :)
  14. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi rwp908,

    the " inaccessible due to its protection level" message is probably from the private vars still being in a few of the scripts- just replace private with internal

    also remove the #pragma strict from the scripts- it doesn't like JavaScript arrays which we are using for our inventory

    @ JoeDGrant,
    thanks so much for the update- while the first part of the book was more for anyone new to real-time in general, the last half was definitely about learning to think, plan problem solve with Unity, and it sounds like you're up running! I like the character, too , btw , thanks for the link

    @ tholland,
    not sure if this could be the prob, but ,
    "controlCenter.GetComponent(GameManager).actio nMsg = actionMsg; //replyArray [currentState][element];"
    has a space at .actio nMsg
    null reference exception means it can't find something- and I assume that is the Control Center object- the object that holds the GameManager script

    in the Start function of the ObjectLookup script, you should have the line where it finds the Control Center
    controlCenter = gameObject.Find("Control Center");

    I would suggest copying the name straight out of the Hierarchy and pasting it in- you may have a trailing space character that doesn't show

    if the name is correct, the next thing I would do is add a line right after that to see if it really did fine the control Center
    print (controlCenter.name);

    and make sure you are using the same spelling all the way through - I spent enough years in the UK to spell center as centre occasionally ;)

    also, you can always make controlCenter a public var and drag the object into it from the Hierarchy, but you'd need to do that for every object with the ObjectLookup script - which is a good reason to use the Find method

    hope that helps

    Sue
  15. joedgrant

    joedgrant

    New Member

    Joined:
    Mar 16, 2010
    Messages:
    23
    Thanks. Been quite a while since I've done characters... been an environment/FX artist for years. I'll be posting screens when I've started actually putting levels together. I know... sci fi's a bit done, but every game I've worked on has been a contemporary shooter, so something a bit different for me artistically is proving to be really, really fun. (Modular tilesets ftw)
  16. mike274

    mike274

    New Member

    Joined:
    May 24, 2012
    Messages:
    16
    Sue, I love your book! It really is great and has really helped me. I've been working through it the past week and basically got to Chapter 14 with relatively few issues after downloading the Errata Doc in this thread.

    I'm using Unity 3.5 on a Mac. I have been having "Null Reference Exception" issues starting at Chapter 14. I even used the "Book Project Chapter 14 Start" project to work from there (after editing the private to internal changes that you've listed in the Errata).

    I went ahead to "Book Project Chapter 16 Finished" project and tried to play it and got many Null Reference Exceptions. I've attached an image of what I'm coming across. Any suggestions on how to fix this?

    [​IMG]
  17. Dricus

    Dricus

    New Member

    Joined:
    May 31, 2012
    Messages:
    1
    Hi Sue,

    I just received the book I ordered via Amazon yesterday, and I am looking forward to get started this coming weekend. But I was surprised it is not in colour as presented on Amazon. Is that correct or is it an illegal copy perhaps? I am suspicious because many pages have even faded text and images, so it is poor quality print. I didn't experience this with books from Apress before.
  18. mike274

    mike274

    New Member

    Joined:
    May 24, 2012
    Messages:
    16
    Dricus, I have heard other complaints of this as well. You're right, it is rather unusual of Apress. Not sure where the issue lies. I've seen comments about print quality on Amazon. I'm sure Sue can help you.
  19. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi guys,

    I too was disappointed at the poor printing quality- especially after all the time I spent with all the colored screen shots!
    but I heard the same complaint from another author/friend who went with a different publisher, so maybe it's just a sign of the times
    I thought I was doing well to get a colored screen shot for the cover rather than a piece of sliced fruit ;)

    @ mike274,
    I just tried updating my chapters 14 16 I'm not getting that error.
    it looks like maybe it's not "finding" the other objects
    I wonder if it's a mac thing? there shouldn't be any differences but you never know

    were you getting the " inaccessible due to its protection level" message before you changed the privates to internals?

    also, I noticed that sometimes the scripts refuse to update- saw that after I change a text string- had to rename the variable before it updated the string properly

    Sue
  20. mike274

    mike274

    New Member

    Joined:
    May 24, 2012
    Messages:
    16
    Sue, I'm not sure of the problem. I'm going to download the source files again. Maybe somehow it got corrupted? (Not likely, but who knows?) I was getting the " inaccessible due to its protection level" message but I made all the changes as per the Errata page.

    I really wouldn't think the mac thing would cause an issue. I'm stumped. I spent a few hours with it this afternoon, but I'm lost as to how to fix it.
  21. mike274

    mike274

    New Member

    Joined:
    May 24, 2012
    Messages:
    16
    I downloaded the source files again. Things seem much better this time. I was able to run Chapter 16 Finish without the NullReferenceExceptions, but I wasn't able to complete the Walkthrough as written on pages 409-411. I wasn't able to open the lid on the stone chest in the shrine. Action Messages just said it wouldn't budge.

    Am I doing something wrong?
  22. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    will it run at all? or does it give that "all errors must be fixed" message?

    and you got the same message in your project as in the downloaded project for that chapter?

    from the screen shot, I'd start by commenting out all but the Start functions in the scripts it's squawking about (starting with Interactor), then, also in the Start function, have it retrieve and print a variable from one of the objects it was supposed to find-
    print (controlCenter.GetComponent(GameManager).customSkin.name);
  23. mike274

    mike274

    New Member

    Joined:
    May 24, 2012
    Messages:
    16
    Sue, It seems to run fine. I was just trying to get through the game to make sure it all worked. How do you open the stone lid to get out the vial of elixir? It didn't seem to work.
  24. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    sorry- missed your latest message before my last reply...

    won't budge? :)

    if that's the version I think it is, you'll need a "key"
    that's one of the glyphs, with an o shaped centerpiece, I believe it's over near the waterfall in the ruins
    you'll need to put it into the depression on the front of the chest, then click on it to turn it and unblock the chest
    basically, it works pretty much like the wooden chest

    glad to hear re-downloading worked!
  25. MichaelHarte

    MichaelHarte

    New Member

    Joined:
    Nov 28, 2011
    Messages:
    8
    Hi Sue

    in chapter 14 regarding camera match script, there is mention of "returnPosition". In the Match() there is camRotx = fPCamera etc.
    where is camRotx used or picked up ? ..was the return position option ever exploited..I assume the idea is to return the fpc to the place from whence it came..is this correct ? Can you clarify this. There is a matchReturn flag that doesn't seem to do anything in my code.

    thanks

    Michael.
  26. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi Michael,

    You are correct, I blocked in part of the code, but did not use it- it was getting too complicated. The idea was to provide a way for the player to click on an object and be automatically positioned to watch the results of his interaction. For first person, the player can usually navigate back from the target position with no trouble, but I thought there could be situations where it would be better to return him.

    In looking at the code, to use the return, we would need to create a temporary variable for both the source and the target transforms, and use those in the update function. That way, when it was finished (+ the observationTime), we could reassign the temp target and source values and have it take the player back to where he started.

    Sue
  27. mariovermeulen

    mariovermeulen

    New Member

    Joined:
    Oct 1, 2010
    Messages:
    16
    Hi Sue,

    Just a quick message, love the book (on chapter 11 now), been a programmer for a long time (Corporate) and getting back to game building, it has been great reading your book, although some things have changed (in the scripts) with new versions coming, have you updated downloaded code to make it compatible with 3.5 / newer versions?

    Anyway loved the book so much my wife is even reading and working through it now! Wish you had been my teacher during my years at uni!

    thanks

    Mario
  28. zachty12

    zachty12

    New Member

    Joined:
    Jun 17, 2012
    Messages:
    1
    Hello all who may read this,
    I am a starting game developer as well as a sophomore in high school who wants to build games but has no idea how.
    Even though I started working with it last year I still know next to nothing about scripting.
    The problem is that all the tutorials are meant for people who have basic scripting knowledge and therefore none of them are any help whatsoever! If you can help please respond to this message in this thread.
  29. RyanSchurton

    RyanSchurton

    New Member

    Joined:
    Mar 2, 2012
    Messages:
    141
    WalkerboysStudio has great Programming tutorials

    http://www.walkerboystudio.com/html/unity_training___free__.html
    Scroll down to where it says javascript and Programming basics. This is a great place to start. Dont Give up making games is one of the most rewarding things i have ever done in my life.
  30. OmniverseProduct

    OmniverseProduct

    New Member

    Joined:
    Feb 26, 2012
    Messages:
    1,569
    I also suggest http://unity3d.com/support/online-training/
  31. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126

    Thanks Sue; I've now got as far as Chapter 13 and have come across another glitch on page 589. The compiler is throwing up an error at line 115 of the Interactor script

    115 currentVisibility = visibilityType[currentState]; unknown identifier visibilityType BCE0005

    I have recently installed Unity version 3.5.3f3; have there been changes; if so, what now replaces visibilityType?

    Best wishes

    Tony Holland
  32. krougeau

    krougeau

    Member

    Joined:
    Jul 1, 2012
    Messages:
    39
    Hi Sue everyone,

    I'm loving the book, but I've run into a bit of a snag in Chapter 10 that I just can't seem to figure out and fix... Namely, a couple of the AnimationObjects animations are misbehaving... It looks as though Gene (gposchman) was having similar issues in some earlier posts, but it doesn't look like he ever found or posted a solution.

    In short, the animations for the ChestLid and Rock ("chest open_copy" and "rock move_copy") are no longer animating correctly. They seemed to be working fine in previous chapters when we had them being called from the AniTrigger and AniTwoState scripts, but now that they're being called from the Interactor, the animated objects are moving differently. For instance, rather than hopping up and over a bit, the Rock now simply flips sort of sideways. The ChestLid, rather than opening upwards, slides over to the left. The ChestLid also does not close, even though the Interactor and Object Lookup sections appear to have all of the appropriate information.

    I don't recall having altered anything in the animations themselves, nor have I moved any of the individual objects within the AnimationObjects group (at least not knowingly!), so I was a bit taken aback when, in the course of the book, I re-enabled the objects animations only to find them all off-kilter.

    On a possibly related note, the Pedestal gives me an "Array index is out of range" error, even though I have it setup just as Sue's example specifies. I've found that changing the sizes in the Interactor from 1 to 2 seems to "fix" it, so that at least gives me an idea of where to start looking for typos, etc.

    If anyone has any advice as to where I should start looking for the root of the problem, I'd greatly appreciate it. In the meantime, I'm going to try and push forward without letting the animation glitch bother me too much (which is difficult because it's annoying me greatly haha).

    Also, if there's any additional information that I can provide, please let me know and I'll get back to you ASAP.

    Thanks!
    - Ken

    Update 1: I'm poking around at the Chapter 10 Finished version of the Interaction1 scene now to see if I can finangle a solution ;) Seems to work fine in Sue's version, at least once some of the private vars are switched to internal vars... Wish me luck!

    Update 2: Okay, so I'm still not certain where I went wrong, but I just tried using the Animation Clips that Sue included with the Chapter 10 Finished assets files, and they seem to work just fine. My ChestLid still isn't closing, but I'm willing to bet that I've just missed something simple there, so I'll go back over the last Chapter or two with a fine toothed comb and see if I can fix that too.

    Update 3: As I near the end of Chapter 10, I think I've got most of the kinks worked out. I've still no clue where I might have gone wrong, but after replacing the Animation Clips as stated above, I also commented out my existing Interactor script and added Sue's "finished" (Ch 10 wise) version and just followed along altering the other scripts (GameManager, ObjectLookup, etc) where necessary until they both met up and worked again... Whew... Anywho, it seems to all be functioning properly now, so thanks for letting me ramble to myself longwindedly here in the forums haha ;)

    Onward to the next chapter!
    Last edited: Jul 2, 2012
  33. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Update: Sorry Sue, it turned out to be a typo;:(
  34. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Hi Sue

    I've run into a problem in chapter 13 about page 607. The inventory is now showing 25 objects (all but one, duplicates) instead of the original 13. Any ideas?

    Best wishes

    Tony Holland
  35. krougeau

    krougeau

    Member

    Joined:
    Jul 1, 2012
    Messages:
    39
    Hello all!

    I've completed my first pass through the book in it's entirety and am now attempting to add the much needed NPC conversation aspect to the existing setup. I've had some minimal success myself through tinkering, but I'm having trouble making sense of Sue's Dialog Tree examples from the book. The examples (pg 915-920 or so) are either miswritten, or I'm just not grasping what it is I'm seeing...

    For example, on pg 915 below the first Dialog examples, Sue states that "A and C display replyBlue elements 1 and 2, respectively, of a reply array, then re-display conversation one." Looking at the examples above that line, however, shows:

    A- “Hi.” ➤ replyBlue[1],c[0]
    B- “Is there a way out of the valley?” ➤ replyBlue[2],c[1]
    C- “Lovely weather we’re having, isn’t it?” ➤ replyBlue[3],c[0]
    D- “Gotta go. See ya.” ➤ replyBlue[0](exit dialog mode)

    If I'm reading it correctly, A and B show elements 1 2, where A and C show elements 1 3... both do return to Conversation 1, which I assume is c[0], the first element in the Conversations array...

    The text then goes on to say that "C, however, displays a different topic list, conversation two, after playing or displaying its reply", which doesn't appear to be true since it's already been established that C goes back to Conversation 1... It looks like B goes on to a new topic, Conversation 2 or c[1]...

    In any case, I was struggling plenty with wrapping my head around the logistics of setting up such a system and the added confusion of the book text has left me spinning in circles...

    If anyone has already implemented a dialog system, or would like to back-and-forth with me to try and create a working example, I'd love to know. Any additional pointers are also greatly appreciated! In the meantime, I'll continue tinkering and see where I get. Wish me luck! :D
  36. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi krougeau,

    I'll have to take a look see what I was doing- the example was just to get people thinking about ways to implement one, but I should have the Unity project somewhere if you want to see what I did in code.

    If you PM me we can figure out how to get it to you.

    Sue
  37. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    Hi Tony,

    25, huh? won the lottery? ;)

    so what's in the Hierarchy view when you get 25 during run-time? are all 25 in there?
    are they all named the same, or are they all using the same texture?
    how many are there when you are not in play mode?

    re typo: np- I spent half a day trying to figure out why I couldn't access one of the tags or layers only to find when I copied pasted it, it had a trailing space...

    Sue
  38. krougeau

    krougeau

    Member

    Joined:
    Jul 1, 2012
    Messages:
    39
    Hi Sue,

    Thanks so much for your gracious offer. I really appreciate it!! I've PM'd you and will eagerly be looking forward to seeing your example code. In the interim, I've finally clued in to the big bold print that points me back to the ObjectLookup script as a good place to start, have backtracked to the appropriate section of the book (pg 427), and am going to use it as a template to try and work out something a bit more elegant than the mess I'd already made :)

    Have a wonderful day thanks again,
    - Ken

    Update:

    Working out the logistics here's how I'm aiming for it to work, at least roughly:

    -----Player triggers the conversation.
    ----------NPC dialog and appropriate wait time (length of animation, audio clip, set time amount, what have you).
    ---------------Conversation topics/choices are displayed, including a "Goodbye" option to quit.
    ---------------Conversation elements should remember where they are in case of Quit.
    --------------------Topic selected leads to NPC response (or other action) and appropriate pause.
    -------------------------The previously unselected topics are redisplayed.
    -------------------------The previously selected topic is replaced with it's first subtopic.
    ------------------------------When all subtopics have been cycled through, the original top level topic is redisplayed.
    Last edited: Jul 8, 2012
  39. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Hi Sue

    If only!

    There are 14 in the hierarchy view (including the crowbar with sleeve icon) during run time and also when not in play mode; in play mode duplicated icons have the same name.

    During run time the 25 icons are spread over three icon panels. The left hand of these has only 7 icons, the middle and right hand ones have 9 each. The right hand panel, which is the first to show up at run time, correctly has the first 9 icons listed in the currentInventoryObjects array, the other four icons appear in columns 2 and 3 of the left hand panel; the middle panel and column 1 of the left hand panel contain the duplicates. Another way to look at this is that column 3 of the middle panel and column 3 of the left hand panel contain the icons that should appear in column 1 and column 2 respectively of the panel that should be to the right of the right hand panel.

    I have checked the coding in chapters 11 and 12 and cannot see anything obviously wrong; I will carry on looking, but if you can suggest what I might most profitably examine it would be a great help

    Best wishes

    Tony Holland
  40. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    what about cameras? not sure what that would do, but it's worth a look-
    the objects should be in the Inventory Layer

    maybe your main camera is not set to ignore that layer?
    (though I would have thought they'd all draw in the same places)

    Sue
  41. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Sue, many thanks for your quick turn round. I've checked the cameras; Camera Inventory is set to the inventory layer and Camera Pointer to the pointer layer. The main camera is set to the default layer. So I don't think that's where my error lies.

    Tony
  42. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hi Tony,

    make sure the inventory objects are set to that layer as well (probably are, but worth a check)

    how about posting a screen shot- maybe that will provide clues

    and I'd have each print their names (and maybe some other info such as texture) to console when picked- that could provide clues

    also,
  43. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Thanks again Sue.

    I've decided to cut my losses and start again from the beginning of Chapter 11; I'll try to get it right this time!

    Tony
  44. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    I had finished Ch 11 for the second time and got half way through Ch 12 only for the same "error" to occur! And then the penny dropped; the arrows move the inventory one column at a time, not one panel at a time. So, all is well. Stupid or what?

    Best wishes

    Tony
  45. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    hahaha- I won't tell you how many times I had to scratch my head about which direction the arrows "moved" them or which side of the panel to put them...
  46. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    I've just worked my way through the Action Message Revisited section of chapter 13 and not only has the messaging system broken down completely but I cannot get the program to print diagnostic messages to the console. The main problem seems to be that the Interactor script isn't functioning. As a result, the cursor doesn't respond to either mouse overs or mouse picks. I have tried to print a message to confirm that the mouse down function is being accessed when I press the left button, but nothing appears in the console. Everything was working fine until I made the changes in the Action Revisited Section. Now, because I have deleted various texts from the scripts, I cannot back track to the point at which all was functioning OK. So, I'm stuck, again!

    Tony
    Last edited: Jul 19, 2012
  47. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Hi Sue

    I've got as far as the start of Chapter 14 (p 657), but I cannot get the crowbar to drop into the chest (nor the golden sleeve nor the sleeved crowbar). Everything checks out fine by the end of Chapter 13. Is there something missing from the text (I'm using the e-book version)
  48. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    Hi Tony,

    No idea about the e-version, but looking at the book now. I need to find an older version of the game to test, but I'll see if I can spot the culprit- because I don't see the functionality in the final version.

    Sue
  49. 3D Junkie

    3D Junkie

    Member

    Joined:
    Jun 14, 2011
    Messages:
    219
    OK, found the problem with mine- the LockPlate collider was too thick- it was extending into the inside of the chest, so when the chest checker popped up to check for contents [ of tag, ActionObject], it found that one and considered the chest to be full.

    As soon as I corrected its size, drop box functionality started working again.

    So check to make sure your ChestCkecker and LockPlate can't intersect

    hope that fixes the problem.

    oh, and according to the picture on pg 657, the object lookup data for Element 1 should be:
    Crowbar Icon,0,Crowbar,0

    on page 664, you'll change the data so the crowbar can't be dropped into the wooden chest.
    Last edited: Aug 10, 2012
  50. tholland

    tholland

    New Member

    Joined:
    May 28, 2009
    Messages:
    126
    Thanks Sue

    I haven't got quite as far ChestChecker. I've created the ChestInside object and set its metadata and lookup information as shown in Fig 14-2 (amended as your last note), changed the drop type for both the crowbar and the golden sleeve and tested the crowbar. All that happens is that it goes into inventory and when I try to drop it from there into the chest I simply get the message that "the crowbar doesn't quite fit into the chest". Sadly "the dropped object doesn't move nicely into the chest and the ChestInside object is deactivated" contrary to the expectations of item 6 on p657. So, am I missing something?