lukezero's Recent Forum Activity

  • These presentations work as sub-goals and I have to manage the priority tasks. I like to program (and learn programming logic), but I often run out of time to stop everything and research. This community speeds up a lot with precise resolutions. :)

  • Really, how so if I may ask?

    Because I'm very busy with my game (I produce it myself) and I have to show an improved version tomorrow. I have to take care of the graphics and mechanics improvements by programming in time.

  • I won't be available to craft an example for the moment, meanwhile I recommend you to check C2 manual about system conditions : scirra.com/manual/124/system-conditions

    There are also a lot of existing topics about the question, a google search should do the job;

    I'm not able to do this. :(

    But, hey, thanks!

  • Good, using this boolean you can pick which NPC is currently talking or interacted with (system event "Pick by comparison"), and then create the HUD sprite next to the NPC, and in the same action set the HUD frame/animation based on the NPC variable, for example if variable = Happy, HUD : set animation to NPC.(your variable), and when exiting the dialog, destroy the HUD object

    Tomycase

    I never used this "Pick by comparision" function before... :(

    If it's not asking too much and/or take your time, you can make an example to me that working?

  • You will still be able to define a different state in this variable for different NPC sprites.

    Thanks, man! I'll try here. I didn't know that.

  • Actually a variable given to a family becomes an individual variable for all the object it contains, you can select an object with that variable inside the family, but also outside it, if you check the object variables in an event you'll see that it shares the variables of the family, it's better than creating a variable for each individual object;

    I didn't know that! He thought that a family variable would determine the same state for everyone, excluding individuality.

    Back to your mockup, do your NPCs have a variable that define if the player is talking to them? Like a boolean that would be on if talked to, and off if not

    Yeah! I created a Instance Variable now to this action. :)

  • You mean the instance variable is defined on each object, not on the family? You need to move it the family. See this tutorial on how to simplify this task:

    https://www.construct.net/en/tutorials/upgrade-object-family-319

    If a use a Family Instance Variable, it won't work as an individual state.

    Each NPC has its emotional state. It isn't a collective behavior.

  • So what exactly is the problem? All NPC are in the family, and these instance variables are defined on the family, right?

    When you create the HUD sprite, set its animation to NPC.Variable

    No. Although all NPCs are in the same family, each has its own instance variable (which has the same name and function).

    I will try this alternative! :D

  • Hi , below is the mockup you requested:

  • Hi, can you make a mockup of the result you want to achieve? That could help us to figure the best solution for you

    Hi!

    All NPCs have the same HUD that appears on his left side when the player presses "up" and shows his emotional state. This emotional state is determined by an instance variable (which each has, with identical names) and expressed by an animation (three in total, associated with each instance variable).

    Thanks! :D

  • If you have lots of NPCs but only one HUD can be on the screen at a time, then it's probably better to use one instance of HUD - spawn and destroy, or to keep it off-screen and re-show when needed.

    With not so many NPCs you can do what's easier for you, for example you may create a HUD for each instance, pin it and keep it invisible.

    Okay, man.

    What I'm trying to say here is that I'm sharing the same HUD object for all NPCs, for facilitating programming when I think it's the easiest method. Each NPC has its own instance variable that determines a specific animation of the same HUD object independently from the other NPCs.

    The most laborious (and conscious) way would be to create X identical HUD objects and program them individually, creating dozens of event lines. I'm trying to optimize this, I just don't know how. :(

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hi everyone!

    In my game, a general HUD object is the same for all NPCs. However, this object has 3 different animations/frames and each NPC has its own instance variable (with the same function) to be associated with these animations. This variable and object expresses the NPC's relationship with the player and, as a state, will vary throughout the game.

    To be practical, it is currently programmed as follows:

    - All NPCs are in the same family

    - There is a single HUD object for all NPCs, which only appears when the player presses UP on the NPC

    - Each NPC has its own variable associated with the 3 animations of the HUD object

    Do you think that each NPC should have its own HUD object or is there a way to keep one for everyone, discriminating in the programming in some way?

    Follow the images of the events below for you to understand better:

    Thanks! :D

lukezero's avatar

lukezero

Member since 4 Oct, 2014

None one is following lukezero yet!

Trophy Case

  • 10-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

14/44
How to earn trophies