DFORMS's Recent Forum Activity

  • Awesome, thank you Laura!

  • You do not have permission to view this post

  • I would like to know how others handle multiple NPC types. I started off with only one NPC, type A. When I was ready to start adding additional NPC types; obviously, I wasn’t going to just duplicate the lines for each individual NPC type. So I used local variables to configure and style the NPCs depending on their type, which works ok. I guess the only disadvantage in doing it this way is having to create separate sprites for equipment and apparel (img1). I thought creating different animations for each type would also be painful and confusing.

    The other thing I did was creating spawn points for the positioning of the NPCs with the aim of reducing the potential lag and perhaps eventually randomizing positions and types (img 2). The NPCs will spawn when Player X <= to each NPC spawn point. This way I don't have 30 NPC running at once all over the level.

    Anyways, how do you handle multiple NPC types in your games?

  • You do not have permission to view this post

  • I'm not sure if I understand the question right. Anyways, this is how I am display the items in my prototype at the moment (inventory menu).

    I'm using a loop to display the weapons/items and their stats.

    CurX: The current zero-based index for each dimension in a For each element loop.

    Arrays (Array expressions): construct.net/en/make-games/manuals/construct-3/plugin-reference/array

    Edit: I didn't make the sprites.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You're welcome. I hope it helps.

  • Start by adding an Array object to your project. Arrays are used to store multiple values in a single variable. They work like tables (rows and columns).

    In the properties set the Width and the Height. Example, if you only have one item, let's say an HP Potion, your array could be set to Width 1 (one row for one item) and Height 3 (three columns = name, hp, qty):

    Array object items [name][hp][qty] => ['HP Potion']['45']['2']

    If you have two items (HP Potion and MP Potion) the array could be set to Width 2 and Height 3:

    ['HP Potion']['45']['2']

    ['MP Potion']['25']['1']

    etc. etc. if you have more items.

    You can add as many rows and columns as you want depending on how many items you want to include in your game. Maybe use an array for your items and an array for your weapons if you have any.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/array

    youtu.be/Us6aTgpreQ4

  • I would use an array.

  • Pretty cool! gj

  • Wouldn't not using mirror on the NPC cause problems with the LOS?

  • Pretty cool, thanks dop2000!

  • Ok , I fixed it. It was a lot simpler than I thought. Took me forever, but it was such an easy fix... Anyways, I ended up not flipping the animations and leaving them as is. I got it working properly just by adding NPC_Soldier.X > Player.X (Idle_Left_Scanning) or if NPC_Soldier.X < Player.X (Idle_Right_Scanning).

    The issue was that the NPC of type C would mirror, but the gas mask and bag wouldn't if the player stayed next to the NPC. I have so many conditions that there must be a conflict somewhere idk. I'm planning on doing some more digging.

    I'm still new to Construct and I have much to learn. But overall, do you have any thoughts on how I built my project so far? I now it's not perfect. I've been learning as I build.

    Again, thank you for your help.

DFORMS's avatar

DFORMS

Member since 1 Feb, 2020

None one is following DFORMS yet!

Trophy Case

  • 4-Year Club
  • Email Verified

Progress

5/44
How to earn trophies