tarek2's Forum Posts

  • Maverick1912 Sure. Here it is.

    https://drive.google.com/drive/folders/15RvNpeaZzh4AHsZvXB7Ix_fXKlCaLrDM

    P.S: btw, it is my first ever game project, on any engine. So don't mind anything dumb you see on the project xD

    andreluizgollo The Link you shared its Looked needs your permission, make sure that the folder its public so anyone can access to it

  • I'd be willing to possibly pay somebody to convert Moveto to work with C3 runtime. (it's already converted for C3 itself, but not C3 runtime)

    Even though there's official tween behavior now, Moveto is too embedded in my project for me to want to do the work of changing all the things that use it.

    PM me how much and I will consider it. Might not have the money right away at the moment but my consideration is serious. :)

    Also, btw, if anybody isn't yet aware, Rex released the source code to his plugins: github.com/rexrainbow/C3Plugins

    If this doesn't work out I'm gonna have to definitely stick to C2 for sure I'm afraid.

    CureLovelyWarrior Check this Thread if you haven't seen it where there are two Links one for (MoveTo Ported to C3 RunTime with a few features Missing) and another Link To Vote for a Request to Include MoveTo as Official Behaviour

    https://www.construct.net/en/forum/construct-3/general-discussion-7/boomerang-effect-bug-c3-runtim-139994#forumPost958563

  • Hey tarek2, here I am again hahaha

    I got into a little problem with the timer again. It works perfectly with numbers below 10, but when it displays a timer of 10 or above, it shows only "10." and doesn't show the decimals... so I figured if I changed the "left(biggergaps_timer, 3)" to "left(biggergaps_timer, 4)" it would work, and it actually did. But now, when timer hits below 10, it shows 2 decimals... like 9.99 > 9.98 > 9.97 and so on. Any way to fix it?

    Hi andreluizgollo

    Try this and see if it works

    Replace the set txt to: left(Timer, 3)

    For this>>>> set Txt to: left(Timer, len(tokenat(Timer, 0, "."))+2)

    I haven't Test it fully but it should work, let me know how it goes

  • Adding a health bar is fine. I ment specifically in your example. You have the blocks in black and the green health bar attached. What if one of those black blocks had a higher health limit? Because the uid is linked, is it possible to increase the health of a chosen black block?

    Hi Freddy33

    That's the thing I was trying to explain to you in my last post, those Capx examples that I gave you it was meant to be just as for helping to explain the UIDs (Pick & Link) so the Health System it wasn't meant to be used as you can see the Health system is very basic and Limited so I was more looking to simplify the code to make it easier and friendly to understand the UIDs thing.

    The problem here is that I put the (Health Life Count and the Health Percentage Bar Display) all in one using the "Animation Frames" meaning they are Fusion together as a pack instead of creating an Instance Variable "Health" and then subtracting the Health amount each hit then updating the health bar percentage according to how much Health is left.

    So adding a variety of enemies with different Health Values you gonna have to count with the Max Health that an enemy can have to add all the Frames to display the percentage Bar.

    Example:

    Enemy1 = Health 10

    Enemy2 = Health 4

    Enemy3 = Health 7

    On the enemy (Health = 10) it will need at least 10 Frames to display the health bar percentage but the enemy with 4 just needs four frames and so on.

    So no it's not gonna work unfortunately unless you create all the Animation for all the possible starting Health separate which is not practical

    As I explained in my Last post you need to create an Instance Variable "Health" so you can have enemies with different Health values, then when you substract the values from health you need to have a Health Bar Percentage system to display the amount of the health still left for this they are many ways so you will have to find the one that you like or works well with your project.

    Here is one way of doing it:

    https://www.dropbox.com/s/pte9rg0hcewcf50/Health%20Bar.capx?dl=0

    If you like it then you will have the opportunity to practice the UIDs thing while you set up the system for all the Enemies.

    Regarding the pin. I found a solution. If I changed the ball to a circle collision polygone it worked, but because of physics the ball jumped around. I created a new ball and it worked fine :-). I downloaded the sprite and had somthing weird happen in the pass. No sure what causes it but only ever had a few "glitches" with this sprite!

    Cool glad you fixed man

    Thank you, You too have Grate New Year and a happy New fresh start on Game Development mate

  • However would this still work if one of the enemy's required more damage to get destroyed? Would you just add another instance variable?

    If you talking about just General "Health" without displaying the Health Animation Percentage then you could do it in many ways, the simplest one will be to create an Instance Variable "Health" then you can do.

    On collision With Object

    ====>>>>Susstract 1 from "Health"

    =========>>>>>>>Health <= 0: Destroy

    And if you need to display the Health bar Progress then I leave you for you to figure it out as they are many ways to do it, you will have to find the one that suits your needs, they are many Tutorials that you could use.

    ====================================

    I have tried loads with image points, but no joy. I think its because a ball perhaps? I tried replacing the ball with a stick man and it worked perfect.

    Set Position to Image Points it should work if you set up everything correctly unless is a bug.

    The Shape of the objects doesn't affect in any way, the two important Factors here are:

    When you set Object A Position to Object B ImagenPoint(X)

    Object A:

    Check the Imagen Point = 0

    As this is the Default Coordinates of any Object that Constructs use to Position the objects on the Grid

    ===============

    Object B:

    Check ImagenPoint(X) if the Image Point its placed in the right Location where Object A you need it to be

    And then when you compare Both Image Points you will easily see if they gonna be positioned like you need to be and if not adjust the image Points as you need.

    However, If you think that both have the Image Points in the Right Places, then without seeing a simple capx example will be hard for anyone to help you as it could be many things:

    I would start from checking if Both Objects are in the same Layer or if they are on different Layers make sure that both have the same Parallax as if you place one of them in another Layer that has Example (Parallax = 0 ) you will have to translate the Coordinates from Layer To Layer

  • > Hi Tarek.

    >

    > Thanks very much for such a detailed example. I appreciate it.

    >

    > Even though im still very much a beginner, your example made sense straight away. The way its laid out for sure. Its a really good example. Im just sussing out why it all works together with the events. I do understand somewhat though. I think its the expressions within the events that confuse me the most.

    >

    > I learnt not only about uids, but pinning as well. I knew how to pin, but never used the position on a pinbox like this.

    >

    >

    >

    > Just going to study this so I know the ins and outs.

    >

    > Thanks dude.

    You're Welcome

    I'm just sussing out why it all works together with the events

    If you mean how the UID gets created and saved and then Picked when need it.

    I gave you two different examples;

    1-One for when you create the all the objects on the RunTime is the "On Creation:" Example

    Here as the two Objects (Enemy and Health) are created Together you can save directly the "Health.UID" to the Enemy Instance Variable = "Health_UID"

    Then whenever you need to Pick the Health Linked to the Enemy you use the "Enemy.Health.UID" where is the UID of the Health that we saved on the Start Of layout

    2-The second example is when you have all the objects already created before the Run Time which is the "By Comparing Instance Variables" Example, so you need to link somehow the Two Objects Enemy & Health so we can Pick them and save the UID to the "Enemy.Health.UID" On the start of Layout like we did on Option 1

    But the difference here is that we have to Loop throughout all the Health Instances to see who is Linked to Who.

    This Option requires more To Do as you have to link them by instance Variable and has to be done on the Editor before Run Time.

    If you look at the Enemy Instance Variables you will see "Health_N" and if you look at Health objects Instances Variables you will see "Enemy_N" so these two variables are the one we use to Link them together at the start of the layout so we can save the UID.

    If you look at the editor and check all the Objects Variables you will see this:

    Health_N = 0 ---- Vs -----Enemy_N = 0

    Health_N = 1 ---- Vs -----Enemy_N = 1

    Health_N = 2 ---- Vs -----Enemy_N = 2

    Health_N = 3 ---- Vs -----Enemy_N = 3

    Etc......

    Although you could do this with containers to avoid all extra work is good to know because sometimes depends on the situation you cannot use containers but don't worry you will learn as you go

    Image Points:

    Here is very simple once you do it once.

    Do you know how to Add Image Points right?

    Just in case: Open enemy Object on the Animation Editor Like on Picture

    -Press on number One 1

    -On number 2 I added an Imagen Point with the + Sign and this image point is the second one so it becomes as Index = 1 as you can see on the Picture

    -Now while you are still on that image point Move the Position to where you like it to be, see Number 3

    And that's all, then when you need to reference any image Point you just enter the Number of the Index of the Image Point.

    You can also reference Imagen Points by Name

    Example:

    Instead of set position to image Point =1

    You could do

    set position to image Point = "Health"

    Where "Health" is the name That I give to that Image Point

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No Problem mate, Glad it helped you

    For some reason using the operator < doesn't work but having a = does. I think that was part of my mistake.

    I can't see your events but if you have something similar to the Picture of your Events from your first Post here are a few things to take into consideration:

    -Any Empty Tile will have (ID = -1) so when you comparing using just "<=" Less or equal (2) it will include all the Empty Tiles as they are less than (2)

    you could fix this by a second condition

    (=> 0)

    or

    = -1 <<<<<<<Inverted Negative (Meaning not equal) -1

    ==================================

    -The second thing is the order of the Events it's Very Important as you can see on your Picture you Delete the Tiles before you make the comparison to add the Points and as Result Every single Tile before Rich the Event where you compare the Points will be (ID = -1) so deleting it should happen after you update the Points

    If any of these Two things don't Fixe it I'm not sure what it could be

  • Hey Freddy33

    No Problem mate I'm Glad that helped you

    Before anything, I would like to point out that the Post got deviated and that we are talking about how to store UID and Pick them in general so what I'm about to write it has nothing to do with your original problem which it got fixed already as you didn't need to Pick by UID, I say this just in case because I don't wanna confuse you, so now we are strictly talking about how to Store UIDs & Pick them in General.

    Although I am unsure on how to go about creating an instance variable with a uid so this dosent happen?

    Would be easier if you give any Example of any situation that you need to store UIDs so you can easily relate to it other ways its impossible to give an example as the range for Picking are endless and it varies depends on the situation or Mechanics that you are doing.

    There are many Types of Picking as an example you got

    -Pick By (IID or UID)

    -Pick By "Comparison"

    De difference between (IID or UID) Vs "Comparison" is that Picking by (IID or UID) Picks directly the object or Instance without looping through all the Objects or Instances as Opposite of Picking by "Comparison" which has to loop through all the Instances of the Object to filter who match the "Condition" therefor adding them to the "Picking List" which means they are automatically Picked so any Actions that you have on that Event they will Apply to all the Instances Picked on the Picked List

    So if you have a lot of Instances of an object the best results you can get its to pick by "UID" whenever is Posible to avoid unnecessaries Loops. But if you don't have many Instances Picking by "Comparison" its fine

    As you can see Picking By (IID or UID) have only Two Possibilities but Picking By "Comparison" has a huge range of possibilities that you can use to give some examples:

    You can use them To Pick or you can use them to filter the already Picked List

    Example:

    -Is "Attack" Animation Playing?

    Any Instances that matches the Condition is Picked so any Actions from this event will apply to all the Picked instances that are Playing "Attack" Animation

    -Is Frame = "5"

    The same as above any Instances that have (Frame =5) are Picked

    Some Times it's not enough with one condition to filter the ones you need to Pick so you can add as much as conditions as you need

    Example Two Conditions:

    -Is "Attack" Animation Playing?

    Is Frame = "5"

    So here unless the Instances are Playing Animation "Attack" & the Frame =5 they will be not be Picked but any instances that match both conditions it will be Picked

    ====================================

    So basically Anything that you can use as a reference to Pick the ones you need its good, this will vary depends on the many situations you will encounter, there is no specific method to Pick, the method will be based on the circumstances, example someTimes you will Pick by

    -Instance Variables

    or

    -Booleans

    or

    -Positions

    or

    -Behaviours

    Etc.... etc...

    And finally just to give a random example as to how to store and Pick by UID most probably has nothing to do with your Project but it is just to have an overview. Although you could do this with containers without the Need of UIDs it is just for training purposes

    On Creation:

    https://www.dropbox.com/s/bsziylubzheuqxb/1-Pick%20By%20UID.capx?dl=0

    By Comparing Instance Variables

    https://www.dropbox.com/s/llf5bcub30h1pny/2-Pick%20By%20UID.capx?dl=0

    I hope you get an idea and that I didn't confuse you

  • KSLR I'm not sure if I understood correctly if it's not what you looking for let me know

    https://www.dropbox.com/s/omvg3lelnl5gxxc/TileMap%20Erase%20Zone%20%26%20Add%201%20To%20Points.capx?dl=0

    They are two Tiles = 0

    And Two Tiles = 1

    So The Points Variable it should be equal = 4 by the end of the Loop

    ===================================

    And if for example, you need to check a bunch of numbers that you not able to use the expressions (< OR >) "lower or Less" for example Tiles (0,1,12)

    you can do something like this:

    https://www.dropbox.com/s/0qgfkwv3wphl1rs/TileMap%20Erase%20Zone%20%26%20Add%201%20To%20Points2.capx?dl=0

  • andreluizgollo

    Haah Righ, I'm glad I asked then :) for one moment I thought you referring to (shortening or converting) the Number so it looks nice and centred

    Example:

    100.000 To 100K

    1.000.000 To 1M

    I see that you got plenty of helpful Answers cool

  • Hi andreluizgollo is not very clear what you are trying to do, you say centred but on both Pictures they look centred on the same position basically they look the same, are you referring to something else?

  • Freddy33

    Right, you using the Editor I see now, I wouldn't recommend you to rely on the Editor though, the best thing is to get used to saving the UIDs that you need on a Variable at the start of the Layout. To have more control and freedom.

    Example when you work on the Games you are constantly changing things Testing, updating and deleting sprites events etc... so what I'm trying to say you don't wanna get your Events to lock to one concrete UID from the Editor, instead what you could do is to Lock them to one "Variable" so at the start of the Game you set that variable to the UID you need. This way you don't have to be worry if you delete the specific UID that your Events where targetting because they could change if you are not careful by deleting them by accident and creating new sprites on the editor making you hunt and change all the events that where Referencing the UID, and this only if you are lucky to be aware that you deleted the UID that you were targeting as it could happen that you delete it and you not aware that it was the one with that specific UID that you were referencing on your Events.

    I think it would be easier if I give you a simple example because I don't want to bore you with a long post jeje

    So here is my capx: https://www.dropbox.com/s/jgnyzrkenrc0y1x/Pick%20by%20UID%20From%20Editor.capx?dl=0

    -As you can see I'm targeting (UID =8) before the Games starts so far good

    -Now on the editor delete the green sprite with UID = 8

    -And now create another instance of the blue sprite3

    -Now let's bring back the instance that I delete from the Green sprite so make another instance of the Green sprite

    -As you can see there is no more Green Sprite with UID =8, in fact, you can create as much as you like of the green sprites and you would not get any with (UID =8) that's why I say be careful with doing these types of events referencing UID from the editor as it wouldn't be practical in the long-term as you can easily forget deleting and creating while testing etc... but obviously it's your Game you decide, I hope I didn't bore you with the long post.

    Anyway I'm glad that you fixed your problem

  • Freddy33

    I see two problems here:

    1-How could you possibly know it will exist a (Snowball with UID = 150) Before the Game starts? I see it could be done by Picking by IID if they were 151 snowballs but I cannot see this working by UID if you wanna target a Fix "Instance Number"

    2-On the collision Event construct (Picks or adds) the snowballs that are involved in the collision so you don't need the extra Pick by UID unless you wanna apply all the Actions to a different snowball that it wasn't involved on the Collision which in this case to use the Pick by UID you will need to reset the Picking.

    You can Reset the Picking by example most common three ways:

    -System >>> Pick All>>Chose "Snowball">>>Then you can use Pick by UID from any snowball

    -You can Add the snowball to a "Family" and then use the Pick by UID but choosing via the Family

    -You can Call a Function and o the Function Pick by UID

  • tarek2

    2.211111 * 10 = 22.11111

    floor(22.11111) = 22

    22/10 = 2.2

    therefore floor(timer.time*10)/10

    By choosing this method OP decides if they want to run to the lowest, highest or in the middle with their number

    That is exactly what I did on my first comment

    I'm not sure if I understood correctly but is something like this what are you trying to do?

    I use Timers

    https://www.dropbox.com/s/v0gk35eq578h8cf/Timers%20PowerUp.capx?dl=0

    But then as I mentioned earlier there is another problem doing that: I Quote

    Do you know if there is any way that the timer display the whole numbers with ".0"? Like... right now it goes 4.2 > 4.1 > 4 > 3.9... It kinda bothers me xD

    it's cool :)

    I was more checking that you may you have a different way of doing what the OP needed but with the (Round, floor, etc..) as you mentioned so I could learn it as I couldn't find the way

  • > here is one way of doing that Timer = 0 I'm not sure if this is what you looking for

    >

    > dropbox.com/s/qe14e79f72wnmxp/Timers%20PowerUp2.capx

    tarek2 Perfect again, dude! Thanks a lot!

    sizcoz Thanks to you too :)

    Your welcome :)