sgn15's Forum Posts

  • yes, that is correct, but you are missing "for each (enemy family)". Without "for each", any bullet hitting any single enemy would damage or kill all enemies. "For Each" gives the specified object (or family object) independence from other instances of same object.

  • I'm not sure about the leaving transparent sections uncropped, but the origin points really change. It happens to me as well as everybody. Technically, the hotspots don't change their position at all. It's the image of the sprite that changes position when cropped that forces us to have to readjust the hotspots for every frame. I would suggest you find a software specifically for making animated GIFs (with transparent background) and animate/crop your sprites there and just import the animated GIF in C2 then set the hotspots just once, apply to all frames.

    edit: try clicking crop 2-3 times, or you might be referring to transparent sections that really can't be cropped (because C2 just crops your image to the smallest possible containing rectangle). If you make a diagonal line, it will leave a lot of transparent areas because C2 can't crop your image (diagonal line)

  • Are the cropped areas blank? I think C2 just checks which are transparent (no sprite in that area) and try to crop each frame to as smallest rectangle it can fit.

    I'm not sure about the question about 720p so I won't answer it.

  • eli0s

    All those past C Language programming classes with countless "for" loop lessons finally paid off for me

    ok thanks. i'll keep that in mind in case I need it. I'm still having problems right now regarding "connecting/relating" each lifebar to its boss.

    "Pick by comparison" only accepts number values so it prohibits me from using expressions involving text variables. This is my current problem.

    I tried using number (UID of boss stored in variables) but it doesn't work in pick by comparison so far.

    EDIT:

    problem fixed

  • Assume all these:

    • objects A,B,C,D are in a family
    • store the number of the Family objects using FAMILY_NAME.Count (store in global variable)
    • there is only 1 instance of each objects A,B,C,D
    • events should still work even if not all 4 object types have instances (meaning no instances)
    • the widths and heights are corresponding to the objects in their row, of course

    Example:

    situation 1:

    1 instance object A

    situation 2:

    1 instance object A

    1 instance object B

    situation 3:

    1 instance object A

    1 instance object B

    1 instance object C

    situation 4:

    1 instance object A

    1 instance object B

    1 instance object C

    1 instance object D

    or any other combination of the objects as long as there is each existing object only has 1 instance, no more than that.

    the events should work in any of the 4 situations using the family to code. The number of cells would adjust according to the number of objects.

    please help. thanks.

    and question, if I will use only a 2-dimensional array, should I set Z to 1 or 0?

  • dilk

    thanks. but can you help me in my new problem?

    basically a few posts above (the very long post). It's about a system that will create number of lifebars the same as number of bosses in any layout (with corresponding functioning individual lifebars as well).

    you might be able to fix my problem. thanks

    eli0s

    If I code it in a way that the boss objects themselves spawn their own lifebars, I would need to have each of the bosses take a number from 1 to n (total number of bosses).

    Do you have idea how I would give them distinct whole numbers starting from 1?

    EDIT:

    I FIXED IT!!! without using array too!!!!

    I found a way to loop through text variables!

    thank you eli0s for all your help here. very very very much appreciated!

  • eli0s

    hmm, I stored BossBoxes.Count to NumberOfBosses global var at start of layout. In my layout for testing, I have 2 different objects that both belong to BossBoxes family, and in my file, it did create 2 LifebarHolderAreaP2 instances (the formula for y position is the "height" of each instance).

    Now that you mentioned it, I tried the layout with only 1 of the 2 bosses at a time and it worked (only 1 lifebar when 1 boss only) for both occasions. The animation of the portrait is wrong yet so till now only the "equal number of lifebars and bosses" aspect is working perfectly.

    Did you try the "System: NumberOfBossesCOUNTER < NumberOfBosses" condition? that's the condition that makes it repeat until lifebars equal bosses.

    I'll give that part where I encircled another few minutes to try and if still no progress, I might try arrays. I have never used arrays in c2, although I know what arrays are.

  • eli0s

    thanks for your example. using your example file as a base, I got some aspects of my idea to work!

    The number of lifebars created are equal to number of bosses existing in layout. I detected the number of bosses using count and save it to a global variable and I have a counter for number of bosses so it makes sure the number of lifebars are equal to number of bosses.

    My problem is that it keeps on repeating on selecting the same 1st boss, so the other bosses are not selected. This is shown because the name of the boss is also the name of my portrait's animations.

    I need to be able to select all of them 1 by 1. Meaning, after selecting Boss A and entering the boss name into a var, I do the same for the other bosses until I enter all of their data.

    I cannot use your method because I am using this event sheet for many layouts/levels, so the intent is to make this possible regardless of layout or number of bosses.

    Here are my events

    http://oi62.tinypic.com/29dvfas.jpg

    Please look at the X part of my events. That's where the problem lies. My logic was something like: enter boss name into both BossName and then if not similar to value of BossNamePrevious, I go on entering it. I thought this logic would solve my problem. But it did not. Probably something wrong a bit with the logic. Can you help me?

    I can't check yet if the SourceUID are being set accordingly until after I fixed this problem.

    This is the setup of my lifebars just so you can understand.

    http://oi58.tinypic.com/xg61k.jpg

    The tutorial I used for the lifebar was this

    https://www.scirra.com/tutorials/182/ma ... cy-lifebar

    That formula works for my player lifebar (player has its own set of similar lifebar-related objects), but I have to add some conditions for boss lifebars since I am coding a universal system for any number of bosses.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • eli0s

    I'm sorry but I still can't access your site. I already turned off all antivirus/anti-spyware and similar programs

  • eli0s

    I'm sorry I wasn't specific enough. Is there a way to make different enemies (meaning different objects inside a family) have their own individual lifebar but automatically being created top to bottom of right side.

    Like I have this setup (for example):

    Family BOSSES:

    object Boss1

    object Boss2

    object Boss3

    object Boss4

    object Boss5

    object Boss6

    object Boss7

    so in Layout 1, Boss1, Boss2 and Boss3 are the boss characters.

    So I checked the count of the family BOSSES object that are already existing in the layout (can't create the bosses since they are specific), then I don't know the next steps how to determine which lifebar is for which boss.

    Do take note though that I added a text family variable "BossName" that I set to their individual names for each boss at start of layout. I'm sure I will use that in this problem but I don't know how.

    My game is a platform scroller beat em up game. So each level has specific bosses.

    I'll send you a pm about your site.

    edit:

    can't send you a PM because "The requested users to be added do not exist." I don't have a clue what that problem means.

    Anyway, here's my intended PM to you

    "I don't think I can't access your site because of my antivirus because there will be a small pop-up message from it if it is blocking any sites. None pops up when I go to your site.

    I'm from the Philippines, but I'm not a Filipino by blood.

    Thanks"

  • I think if you don't use any picking conditions and For Each, C2 automatically selects all instances

    edit:

    actually, if you use for each, it will still select all instances, but it also gives you (optionally) to choose to make each instance act independently from each other. So using For Each is ok (for your situation).

  • eli0s

    link doesn't work? can you attach it instead?

  • eli0s

    it's ok already. I just forgot that I clicked undo on the changes I made to layer's scale but I forgot to change it back to 0

    Can you teach me how to create multiple lifebars (for multiple bosses) ?

    So far, this is what I did.

    Start of Layout

    ->store the number of boss objects (using count) into a global variable

    Then using that value, I need to create that same number of lifebars for each of the multiple bosses (top down from right side of screen)

    The single lifebar at the left is for the player.

    How do I position them (without overlapping one another) and also how to differentiate which lifebar is for which boss?

    Please see attached pic for reference

  • exactly, you intend to make the value the same for all?

  • not sure how to do your ideas, guys. This problem arises in situations I have "stairs" kinds of floors, meaning I have different floor object instances at different heights. The changing of size happens in air, so as soon as enemy overlaps any floor object, it gets stuck there forever (since my events are supposed to work when the enemy falls on floor)