Forum rules - please read before posting.

Tutorial GUI offscreen

edited November 2017 in Technical Q&A
Hi guys, first of all "hello" to everyone, i'm really new to unity and adventure creator and i'm trying to understand the logic via 2d tutorial. I've made my previous game with ags and i'm feeling a little confused with everything, so i'm stuck cause at certain point the menu button and the inventory window went offscreen like this https://imgur.com/lb9zh6P and i don't know what to do. Thanks

Comments

  • Welcome to the community, @rmonic79.

    The Scale value of your Game window is set to 0.73, which is causing it to be zoomed in so that the edges and corners are out of view.  This is set by the slider at the top, left of the Maximize On Play button.

    This isn't an AC feature but a Unity one, but I daresay you're not the first to be confused by it!
  • Ok thanks Chris it works fine. i really appreciate the logic of the tool. One question (Tell me if i have to do another one thread). I behave until now with a global script that control the common features of the game and room and other scripts belows it, there's something like this in AC or i have to work always room by room (scene by scene sorry) another things that comes into my mind is if it's possible to access dialogues in script mode and not visual. 
    Thanks for your patience.
  • edited November 2017
    Game logic is not limited to being placed in scenes by any means - ActionList assets can be created that can be run from any scene.  Indeed, these are necessary for things like inventory item responses and menu logic, which can be used at any time.

    Section 5.9 of the Manual covers ActionList assets, as does this part of the 2D Tutorial (which I recommend you go through all of if you're new to both AC and Unity).

    Your Hotspots, Conversations, and scene-based ActionLists such as Cutscenes and Triggers can all be set to rely on asset files by changing their Actions source field to Asset File.  An asset can also be run at any time within another ActionList via the ActionList: Run Action.

    So far as building your game goes: while it's certainly more geared towards visual scripting, it is possible to do it through code.  All the provided Actions are simply running code that you can also place in a custom script and run instead, but they offer a large convenience as they allow you to do without the need for incorporating coroutines or Update checks to have your game "wait" for certain commands to finish.

    A tutorial on writing an Interaction entirely through script can be found here.  It is also possible to write custom Actions, if you prefer to run custom code as part of an ActionList.

    The "Interaction scripting" and "Custom scripting" chapters of the Manual go over the principles when it comes to writing code in general, and the online Scripting Guide provides a resource of all public functions and variables availablle.  For example, a dialogue can be written through script with:

    AC.KickStarter.dialog.StartDialog (myCharacter, "My speech text");
  • Great Chris, i’m starting the second tutorial right now. I will look forward into your answer here as soon as i’ll become more skilled. Have a good day.
  • During tutorial i'm making some try to port my ags game just to see if i learned something, i had this strange behave on player sprite in some frames, a line appears near head and on foot, the sprites are set as sprite and  with no filter, pivot bottom.  https://imgur.com/ErgaQwZ
  • AC doesn't do any rendering of its own - it just makes use of Unity's own render system.  Any graphical glitch like that will be down to Unity or the way the sprite is being imported.  It looks like the frames in the lower-left don't have transparency, which is something you should enable.

    Do the lines appear if you drag an offending sprite into an empty scene without any other components, AC or otherwise?
  • edited November 2017
    They appears and desappears connected to how i zoom the view scene, the sprite have all alpha channel and are 48x48, the original game is 320x200 so it's all very small, maybe it's a problem with not perfect square pixel? By the way in the video you can see also that player seems to slide and that idle animation not looping when he's stand 
    edit: and also in walk he do animation one time  and then continues sliding still.
    here's the link:


  • What size is your Player compared with the 2D Demo's player, Brain?  Try dragging one of Brain's sprites into the scene - is he much larger than your own?

    Unity assumes a scale of 1 meter = 1 Unity unit, so your game should try to match that.  Brain is closer to this scale, so it's helpful to try to have your character match up with him.  You can change how large or small your own sprites are via the Pixels Per Unit setting in their Inspectors.

    If your sprites (and so your game in general) is of a much smaller size than the 2D Demo, then you can increase the Destination accuracy slider in the Settings Manager (under "Movement settings") to compensate, but I recommend you instead re-build things if you're still at an early stage.  To be clear: this is something that all Unity projects, not just AC, have to contend with.

    Having your sprite scales closer to this should also help with the line issue, but playing around with your sprite's Fliter Mode may also help.

    To loop your idle animation, select it in the Project window and check Loop Time in its Inspector.
  • edited November 2017
    ahahah


    I searched loop everywhere and it was on the file inspector itself... by the way i had to put it also on walking movement to avoid sliding stuff. I'm playing with speed animation and speed inside player setting and inspector. Maybe i have to do like you said, takes all sprite and multiply x4 or x8 to match a little your size, the camera follow character also is not smooth on this resolution. The game is a really 320x200 and it seems that that doesn't match unity at all.
  • ah and it seems that the lines are solved changing repeat to clamp even if i don't know at all what them do :)
  • The game's resolution is independent of the size of your graphics in Unity units.  Just increase your Pixels Per Unit values and you should find much better behaviour.
  • Thanks Chris i already try a x4 sprite and i realized a “without logic” prototype that match very close the original, now i try also pixel per units to see if it’s better.
    i was thinking about walk behind stuff, in 2d demo the sorting map work flawlessly with an object placed and i’m wondering if it’s also possible to create a complex mask (in my case i can export from my previous game where i have already did it) and put a baseline to have the player go behind background
    only where mask is designed.
  • edited November 2017
    i'm always havin a little problem to what should be in front, i put 0 for every character how i can have front and rear reagards character position?
    Edit: i solved using i multiple area sorting maps, but a doubt comes in my mind, how it work when some npc walk around?

  • I was a user of AGS for many years, so I know the masking feature you're referring to.  However, when working in Unity it becomes much more appropriate to separate "walk-behinds" into separate images instead.

    In order to get correct ordering of NPCs with overlapping the Player, they too must be given Follow Sorting Map components.
  • edited November 2017
    yes, i made overlapping images also in ags in advanced production of the game, but for first scenarios i was a newbie and didn’t make stuff in layers. Yesterday, like edit, i made a sorting maps and works fine except for two doubts,
    1) Is it possible to use sorting maps only for scaling without interfere with objects sorting
    2) further in game npc walk around, randomly sometimes, how can i procede in this case?
  • edited November 2017
    1. A Sorting Map will always set a character's sorting order or layer name, but if you give all of its areas the same value, then the character's sorting order / layer name will remain the same.

    2. I'm afraid I'm going to need more detail.  You're saying that he's walking around on his own accord?  Check that "Keep out of player's way?" isn't enabled in the NPC Inspector.
  • about npcs walk around my doubt was still about how sorting map works to avoid strange overlap, but maybe when i’ll meet this point i could be more specific.
    Thnks for your time Chris.
  • If they're all on the same sorting map, it should be automatic - provided that their pivot points are correctly at their feet.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.