(SOLVED) how to disable camera pan at scene start and inventory scroll command set not working

  • #1, z fallacies_fallaciesWednesday, 28. December 2016, 01:07 hodinky 8 years ago
    Hey,

    I have a scene where the camera has to pan because the background image width is higher than the resolution. I made it like this on purpose because I wanted the scene to scroll as you move around, but at the beginning of the screen, the camera always starts at the left side and pans over to my character, who starts at the right side of the screen. I would rather it just start by focussing on the actve character. How can I do this?

    Also, for my inventory, I created an acton to set the command to "point" when the cursor goes over the "scroll up/forward" and "scroll down/backward" , but it doesn't seem to be working. It still becomes the active command image, but it's for the walk command, which I guess is because it's the standard command. I even tried switching the command properties of "point" to be a scrolling command but still nothing.

    Thanks in advance

    Bažant

    25 Posts


  • #2, z afrlmeThursday, 29. December 2016, 12:23 hodinky 8 years ago
    You could try creating an execute a script action part containing...
    game.ScrollPosition = {x = game.CurrentCharacter.CharacterPosition.x - (game.WindowResolution.x / 2), y = game.CurrentCharacter.CharacterPosition.y - (game.WindowResolution.y / 2)}

    ... something along the lines of that inside of an at begin of scene action.

    P.S: it should automatically focus on the characters position without panning. Create a new ved with the template thing so that it creates the start menu & first scene thing which happens to be wider than the default game resolution & the character starts off towards the right hand side of the scene. I don't have any panning in that when I press run. It just starts centered on the character.

    Have you turned off character centering & enabled it inside of an at begin of scene action or something?

    Imperátor

    7285 Posts

  • #3, z fallacies_fallaciesMonday, 02. January 2017, 20:36 hodinky 8 years ago
    Thanks, you helped me figure out what I was doing wrong. I had my character's start point set up using a "set character to position" action "at beginning of scene" instead of a simple a scene object start point. However, I'm still struggling to figure out how to make the proper command appear on my inventory scrolling arrow buttons. I'm going to keep fiddling around with it.

    Bažant

    25 Posts

  • #4, z afrlmeMonday, 02. January 2017, 20:54 hodinky 8 years ago
    No problem.

    What do you mean by a proper command? You mean the action text? Could you share some screenshots of how you've setup the scroll arrow things & commands/cursors in question please?

    Imperátor

    7285 Posts

  • #5, z fallacies_fallaciesMonday, 02. January 2017, 23:21 hodinky 8 years ago
    Actually I figured that out too but now I have another problem. My inventory is a brifcase that pops open when you hover over it (inactive image is a closed briefcase, active image is open.) I want the inventory items to appear only when the briefcase is open aka when the image is active Is there a way to do this?

    Bažant

    25 Posts

  • #6, z afrlmeMonday, 02. January 2017, 23:28 hodinky 8 years ago
    Actually I figured that out too but now I have another problem. My inventory is a brifcase that pops open when you hover over it (inactive image is a closed briefcase, active image is open.) I want the inventory items to appear only when the briefcase is open aka when the image is active Is there a way to do this?
    Yes. Use 2 interfaces.

    I had to create 2 interfaces for the A Little Less Desperation technical demo as we needed one to display the inventory button in the same place all the time & another interface for the inventory items & inventory background to be displayed on because we have the inventory interface offsetted initially so it's hidden & then it slides in when we click on the inventory icon or press "i" or rotate the mouse wheel up/down.

    Having 2 interfaces means you can offset, hide or make the inventory interface transparent until you want to show it.

    I'm sure you can figure out what you need to do from what I just said, so I'll not go into detail on the matter at the moment.

    Imperátor

    7285 Posts

  • #7, z fallacies_fallaciesTuesday, 03. January 2017, 02:50 hodinky 8 years ago
    I can't figure it out for the life of me. I can't get the interface to hide when I scroll over it. At one point I finally got it so the item was showing up only when the cursor was above it, but the active/inactive image was no longer working, so the briefcase wasn't opening. 

    Bažant

    25 Posts

  • #8, z afrlmeTuesday, 03. January 2017, 03:38 hodinky 8 years ago
    I can't figure it out for the life of me. I can't get the interface to hide when I scroll over it. At one point I finally got it so the item was showing up only when the cursor was above it, but the active/inactive image was no longer working, so the briefcase wasn't opening. 
    It's late here for me now, so I'm afraid my brain isn't in help mode, but if you could provide some screenshots of how you've set it all up, it will give me a better understanding of what you have done (wrong?). Anyway, I'll check back in the morrow. smile

    Imperátor

    7285 Posts

  • #9, z fallacies_fallaciesMonday, 09. January 2017, 00:27 hodinky 8 years ago
    Hey,

    I've been messing around with it a bunch and I still can't figure it out. I thought I had it when I added all the buttons to the second interface except for the items placement button, and set the above interfaceto hide when the mouse hovers over it, but then I realized the items weren't being selected on the inventory beneath it. I added the items placement to the above interface and now it basically works the same as having one interface. Right now the above interface is set to "miscellaneous" but I've tried every other type as well. Not sure if should use an active/inactive image for the above interface or just a background image, pretty sure I've tried it both ways. 

    I've attached all the screenshots but you'll probably just see them and think "wtf is this guy doing?"

    I just want an inventory icon of a briefcase on the screen at all times. When my character picks up an items, they go to the inventory (which you cycle through one item at a time). But I only want the item to be visible when the active image of an open briefcase is displayed by hovering the mouse over the inventory aka closed briefcase.

    Bažant

    25 Posts

  • #10, z afrlmeMonday, 09. January 2017, 01:34 hodinky 8 years ago
    Aisus! That's a shit ton & a half of screenshots you have posted there mate....

    I believe you are just over-complicating matters.

    ----

    1. create an interface & name it something along the lines of inventory_bg. Set this interface class as misc under the interface properties tab.

    2. create a blank (fully transparent) png or webp file that is the same height & width of the open briefcase image & add that as the background.

    3. create a new interface button, set the button type to action area & now assign the briefcase open & closed images to the inactive & active image tabs. inactive for closed, active for open.

    4. create a new interface & name it inventory. Create 3 buttons. 1 should assigned as a placeholder for items, & the other 2 should be scroll inventory items forwards/backwards respectively. Don't forget to create & assign both active & inactive arrow image states for both of the scroll button types.

    5. set the interface class as inventory under the interface properties tab.

    6a. go back to the inventory_bg interface you created & now create some on cursor enter/leave actions on the button you created that contains the briefcase active/inactive images. Also don't forget to create a interaction polygon (object area).

    6b. inside of the on cursor enter action, add some actions along the lines of... set active image of whatever you named the button that contains the briefcase images. Then add a pause, let's say 250ms, then another action part that shows interface "inventory".

    6c. For the on mouse leaves, you just want to do the opposite basically, hide the inventory interface & set the inactive image.

    I think this should be enough to set you on the right path. You can get more fancy if you like by controlling the opacity (transparency) of the inventory interface to have the item slot/arrows fade in/out rather than snap hiding/showing.

    P.S: don't forget to give each button/interface a unique name. also you don't have to use inactive/active images if you don't want to as you could use animations instead if you prefer & just play/stop them as needed. Also don't forget you need to assign interfaces to your active characters for them to be visible. Also you need to hide interfaces in game launch action under game properties that shouldn't be visible from game launch. There's probably something I'm missing, but it's late & my heads not 100% in the game right now.

    Imperátor

    7285 Posts

  • #11, z fallacies_fallaciesMonday, 09. January 2017, 03:42 hodinky 8 years ago
    lol yeah sorry I wanted to be detailed so you could what i was going for. Your way definitely makes sense and I was overcomplicating it, but I'm still having the same problem.

    Even though the object becomes visible when the cursor goes over the briefcase, it's not interactable. So the object text doesn't appear, the assigned commands don't appear, and even the arrow buttons will show up like they should but they don't work. I think maybe the action to make the interface show just makes it visible, but the buttons won't function. 

    Another problem is, for some reason, the object will show up on top of the closed briefcase and it's not until after the first time I hover over it that it has the desired effect of disappearing when the briefcase is closed. This only seems to happen most of the time but randomly sometimes it works the way it's supposed to.

    p.s. I'm assuming the inventory_bg should be below the main inventory interface. Should I be creating an interface area for the buttons or just an object area?

    Bažant

    25 Posts