Shindoh's Forum Posts

  • Not quite Shindoh, I think he only wanted the attack to count when the enemy was at the end of a punch, and when it was going forward right ChromeGadget?But even then, if I understand You right, then he could also just check if the last frame of animation is playing, and if any enemy collides with it.

    Or if the enemy is colliding with the last frame.right side plus/minus offset to increase the area for hit detection.

    Or alternatively just create a hitbox sprite at the desired area; easily with an image point, while the last frame of animation is shown, or for every frame of animation at the fist area.

  • I'm a little confused. The way You do did it sounds so complicated. In theory all You had to do was make the sprite animation frame by frame. Then play that animation, and check if any enemy object overlaps it.

  • I think what You want is this: "Save" & 'numberVariable'

    For example if You want to name Your save file "Save 5", and 5 is inside the global variable numberVariable, then You write the name of the save file as: "Save " & global('numberVariable')

    EDIT:

    I just saw You want the number value from the .INI file.

    Then You would basically write it the same; just replace the global variable with the .INI file value: "Save " & INI.ItemValue(Group, Item)

  • tulamide I haven't used function alias' before so I did some tests and looked at the source to see what it does.

    Isolated/inline act the same as calling a function with forget/remember picking. Any picking done by the alias is forgotten when the alias returns (I initially thought that "inline" would change the SOL of the event that called the alias, but it's not the case).

    Example of use:

    + Function: On Alias "isValue"

    -> Sprite: Rotate 45 degrees clockwise

    //// all the sprites are rotated

    + Sprite: Pick one at random

    + Function: "isValue" (Isolated)

    ////only one is rotated

    + Sprite: Pick one at random

    + Function: "isValue" (Inline)

    Shindoh

    Here is another method using two conditions.

    + Sprite: Value 'test' Equal to 0

    + System: CountMatching(Sprite.OID) Equal to Sprite.Count

    Thanks for the great help, everyone.

    Rojohound, that is definetely what I was looking for. :)

  • How would I go about doing this? There must be a really easy way I can't think of right now. Check if at any moment the variable value of all instances of an object are equal to a certain value.

  • > Something like this:

    >

    > + If (Family) "Letters" Clicked:

    > > RecordLetterVar.Add: Letters.ObjectName

    >

    > Imagine Letters contains objects like A, B, C etc. .

    > It would be tedious to manually write an 'On Click' Event for every letter object separately.Yes, it would be tedious. Why not having a family pv and adding that to RecordLetterVar ?

    + MouseKeyboard: On Left Clicked on Blue

    -> System: Add Blue('name') to global variable 'letters'

    + System: Always (every tick)

    -> output: Set text to global('letters')

    'letters' here being a global text var and 'name' a family text var

    Thanks for Your help Tulamide.

    Yes, I thought about that too. That seems to be the only way. Then I would however still have to set every variable by hand to the respective objects name.

    Don't You think it would be more easy to have access to the object's name? I mean it seems like it would be such a simple thing.

    Anyway, it's not that much of a big deal. Just a small annoyance, I guess. lol

    By the way, it's nice to see You're still around. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • The purpose is being able to automatically write an object's name within a Family into a variable.

    Something like this:

    + If (Family) "Letters" Clicked:

    RecordLetterVar.Add: Letters.ObjectName

    Imagine Letters contains objects like A, B, C etc. .

    It would be tedious to manually write an 'On Click' Event for every letter object separately.

    Of course I know what You said Tulamide, lol; but thank You for being there. :)

  • Is it possible to access an object's name?

    Like in an expression Object.ObjectName.

    There doesn't seem to be a way.

    Thank You in advance.

  • That's not quite the actual problem here. The "on collision"-condition will select any two instances involved in a collision, not every instance. For example, if you have two sprites, "red" and "blue", and both sprites both have 10 instances, and you create the following event:

    + Blue: On collision between Blue and Red

    -> Red: Flash for 1 seconds with 0.1 seconds interval

    -> Blue: Flash for 1 seconds with 0.1 seconds interval

    then only those instances who are currently colliding, will flash. If only one blue instance collides with one red instance, only those two will flash.

    However, in event 21 of Thijsku's image you can see that not the snowman and the snowblock, but a third sprite and the snowblock are tested for collision, so only those two are picked and not a snowman. The right snowman instance has to be picked manually in addition. For example by using

    ++ Snowman: Pick closest to: Sightsnowpop.X, Sightsnowpop.Y

    --> (paste actions from event 21 here)

    but that depends on what purpose Sightsnowpop serves.

    Yeah, You're absolutely right. I forgot, that the collision event already filters the instances. But I also couldn't see the image he posted, again because almost every foreign image hoster is blocked here (China), unless I unblock them (on a side note, lol).

  • All You need to do is filter the "picked" instances of the snowman object.

    The "For Each Object" loop is very helpful here.

    It will check for each of the snowman objects individually and in its current check only apply to the current picked snowman instance in the loop.

    So if You did something like:

    + For Each Object("snowman")

    + Snowman: On Collision with ("snowblock"?:

    -> Do whatever You want that particular snowman, who is currently colliding to do.

    You need to remember, that the Events will filter the picked instances of any object.

    Then the Actions next to the Event will only be executed on the Objects/Instances filtered/mentioned by the Events.

  • Do You know, that You don't have to put the animations into sub-animation folders? Then You can just change the animation to Object.Animation("AnimationName"), depending on what Event You directly want to trigger it with.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually I already told You how to solve the problem, which has to do with the picking of the bullet instances, so the other bullets won't be affected, but only the one currently at Samus' imagepoint.

  • Okay to solve that, You just need to filter the "picked" instances of the Bullet Sprite.

    You could add an Event in the Always SUB-Event of Right Mouse Button Down:

    Bullet.Pick By Position = Samus.Image Point.

    OR

    Bullet.Pick By Closest To(Samus.ImagePoint or Position)

    Also note, that the Always Event I put is NOT in the same SUB-Event as the Trigger Once Event. It's a seperate SUB-Event of the "Right Mouse Button Down" Event.

    So it would be something like this:

    + Right Mouse Button Down:

    ++ [Trigger Once]:

    --> Create Bullet at Samus(ImagePoint)

    --> Set Bullet.Speed = 0

    ++ [Bullet.Pick By (Position = Samus.ImagePoint OR Closest to Samus.Pos) ++ Always]:

    --> Set Bullet.Position to Samus.ImagePoint

    --> Set Bullet.Angle to Samus.Angle

    + [Right Mouse Button Released: + Bullet.Pick By (Position = Samus.ImagePoint OR Closest To Samus.Pos)]:

    --> Set Bullet.Speed = 500

  • Without seeing the .cap, I'd say You're just missing this:

    Right Click pressed DOWN

    Trigger Once:

    ->Spawn Bullet samus (@Cannon Point)

    ->Set Bullet Speed 0 (Keeps bullet still)

    >>Always:

    ->Bullet: Set Position to another Object('Samus', 'CannonPoint')

    ->Bullet: Set Angle = Samus.Angle

  • There are two things I see up front.

    The first is, You add 1 to the 'Shields' variable, instead of setting it to 1, when 'Bookcount' = 66. And You only set the Frame to 2, if 'Shields' = 1.

    Why is this a problem? Well, if we think ahead. Then what will happen, if 'Shields' = 2? Which will happen, because You always add 1 to 'Shields' for each 66 Bookcounts. Of course right now nothing will happen if it's 2, but You never set back 'Shields' = 0.

    And You say if 'Shields' = 0 -> Set Frame to 1.

    Also the Sub-Event code for "Every 15000ms" will only run, if 'Shields' = 1.

    The next things is, the short flash You see. Why? Think about it again. When do You set Frame = 1? If 'Shields' = 1 AND "Every 15000ms".

    So this Tick let's assume 'Shields' = 1 AND "15000ms" have passed in this Tick. In this Tick Frame will be set back to 1. However the next Tick the 'Shields' = 1 Event will be checked again and what happens if 'Shields' = 1? Set Frame 2.

    It can be maddeningly frustrating at times, but stick to it and with time You will get the hang of it. You know, every beginning is hard and all good things take time. It's also important to keep a cool head and try to keep a good overview and memory in Your head of the processes going on at all times, that might be related to other.