Speeding things up

  • #1, by nmvhMonday, 23. May 2022, 05:29 2 years ago
    So I'm creating these semi-transparent circles that pop up over objects in the scene when the player hovers over them with the cursor.

    I find it a chore to add the same code to each and every object in the whole game. Is there a way to speed things up? Like, for example, a general setting somewhere?
    Or is there at least a way to reference the "current object"? That way I could at least copy-paste the same code to every object. Still takes some time, but preferable to what I have to do now.

    Newbie

    38 Posts


  • #2, by afrlmeMonday, 23. May 2022, 11:37 2 years ago
    Yes, via script & either via a mainLoop event or the mouseEventHandler, but I don't know how you intend on positioning this semi-transparent circle thing over the objects. Could you post a screenshot or two of ones you have already manually setup, so that I can get a better idea of what it is you are trying to do?

    Imperator

    7278 Posts

  • #3, by esmeraldaMonday, 23. May 2022, 13:47 2 years ago
    In case you want some kind of hotspot indication (usually done by pressing space), this is called snoop animation in VS.

    Key Killer

    513 Posts

  • #4, by nmvhMonday, 23. May 2022, 14:22 2 years ago
    Yes, a hotspot indication is what I want. I did not know that snoop animations had something to do with that. 

    Currently, when the player hovers over the hotspot, a semitransparent circle is discreetly summoned onto the screen, as indicated in the example image that I uploaded.

    To answer afrlme's question, the circle IS the image for the object in the case of this game, as I use photographs where the objects of interest are just part of the background image, obviously. 

    Newbie

    38 Posts

  • #5, by esmeraldaMonday, 23. May 2022, 14:53 2 years ago
    mh... the hotspot revealer / snoop animation works a bit different than what you want, I think. When you press a button or key you use the action part "fade snoop animation in/out" then all hotspots in the scene (you need to place them over the objects first) will be indicated.
    If you want just the object your cursor is hovering over to be highlighted then I guess scripting would be better. 
    But I am a little bit at a loss why you are doing it...? The player already found the hotspot. So the active cursor should be enough of an indicator, no?

    Key Killer

    513 Posts

  • #6, by nmvhMonday, 23. May 2022, 15:45 2 years ago
    You're right of course. I'm experimenting with different effects. 

    A plausible scenario for using this kind of setup: the user hovers over a menu item and the menu item morphs into something else. As in the example provided by afrlme in another thread.

    Newbie

    38 Posts

  • #7, by afrlmeMonday, 23. May 2022, 16:22 2 years ago
    You're right of course. I'm experimenting with different effects. 

    A plausible scenario for using this kind of setup: the user hovers over a menu item and the menu item morphs into something else. As in the example provided by afrlme in another thread.
    Morphs into another item? Which thread?

    I also call snoop animations hotspot indicators. I think a long  time ago that the VS dev time somehow came to the conclusion that they should call them snoop animations for some reason or another - VS is a German game engine by the way & all the devs that have worked on it have been German, so it's probably just a lost in translation name & no one has bothered to rename it.

    Anyway, I agree with Esmeralda, the semi-circle indicator is a waste of time as you already have inactive & active state mouse cursors to let the player know when they are hovering over something they can interact with, & you can use the snoop (hotspot) animation system if you want to provide the player visual aid on what they can interact with in each scene.

    Oh, before I forget... you could technically include the semi-transparent semi-circle inside of the active state of the cursor(s). The interaction position is defined by the animation center you specify, which means that if you were to set the position on the same pixel of the cursor for both inactive & active state cursors that they should be aligned correctly without shifting position when changing between states.

    Imperator

    7278 Posts

  • #8, by nmvhTuesday, 24. May 2022, 04:29 2 years ago
    "
    Morphs into another item? Which thread?
    "

    Okay, so "morphs into another item" was a poetic exaggeration. Borders are added above and below the menu item text. See added screenshots. The thread was "Newbie question about saving and loading games".

    I agree that there are more straight-forward ways to indicate hotspots than to add semitransparent circles to objects in the scene. But my original question in this thread was about how to quickly add this same behaviour to many objects/hotspots in the game. I can think of several scenarios where this is relevant. For example, suppose your scene (in a horror game) shows a closeup of a floor, with dead insects lying about. For effect, hovering over an insect could make its legs twitch. Or something like that. And there are 30 insects. You get the idea. 

    Newbie

    38 Posts

  • #9, by afrlmeTuesday, 24. May 2022, 11:09 2 years ago
    Why not just create them as an animation to begin with & have their legs twitch randomly to indicate them as a point of interest? There's lots of methods to draw the players eye to points of interest, if you don't want them to have to pixel hunt the hard way.

    Your example is a bit extreme too. I wouldn't create 30 separate bug/insect objects, I'd probably just create them all as one. Just in case you didn't know, you can draw multiple object area polygons in the same scene object.

    Imperator

    7278 Posts

  • #10, by nmvhTuesday, 24. May 2022, 14:10 2 years ago
    The jist of what you are saying is that it would be very rare indeed if one needed to affect several objects in a scene visually, when hovering over them. 

    And IF I would need it, I'd need to use scripting either via a mainLoop event or the mouseEventHandler.

    Okay, thanks a lot!

    Newbie

    38 Posts

  • #11, by afrlmeTuesday, 24. May 2022, 22:55 2 years ago
    I don't think that's what I said. I said you can draw multiple object interaction polygons for the same scene object, like in my screenshot.

    I wouldn't go to the lengths you are wanting to go to - maybe if it was something important like you had to mouse over something a bunch of times to pretend that the player is stroking/patting/cleaning something maybe as a sort of mini-game, but I wouldn't be doing that for regular scene objects. I'd just create them as animations to begin with & either have a first frame with a long duration or use script inside of the first two frames to add a dynamic delay between it playing the first frame & the rest of the animation.

    Imperator

    7278 Posts