GUN's Forum Posts

  • Yeah. That's it. Thank you very much.

  • Sorry, wrong script. What I'm trying to say is, if 8 way behavior is disabled, it will stop flinching, but there are no collision with other solid objects, like a sphere or a solid blocks. But if the behavior is enabled ,it will collide with solid objects but will flinching.

    Is there a way to solve this?

  • Sorry , this is the right one. Please answer.

    s000.tinyupload.com

  • allright . Just kick the sphere to the green one.

    s000.tinyupload.com ... 4333172519

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have a sprite that has 8 way behavior. At the beginning, I turn the behavior off.

    The problem is, when the sprite being hit by other objects, it will activate the " built-in physics" and will make that sprite "flinching", that is, moving randmoly when being hit. I need the sprite to stay at where it was.

    How to prevent this problem? (in addition, I also used SOlid behavior, but I turned it off).

  • OK here it is.

    s000.tinyupload.com ... 5753272595

    A couple of hours ago, I tried to use pick UID to store the UID of "what would be kicked" sprites.

    I used dynamic text to debug this. And it shows that the UID actually stored in global variable for the first time, but it doesnt work for the second time ( when I move 4 ways and overlapping the "what would be kicked" sprites it shows the sprite UID/ like in UID 1or 2), but it doesnt show the UID for the second time it overlaps.

    I dont understand why this is happened.

  • I've asked about this in the forum a while ago. But I still cant figure out of this.

    I have a sprite that can be pushed all the way in a direction (up/down/left/right in a top down view).

    And it will be destroyed if hit a wall.

    I want the sprite to respawn in the previous position (if the sprite previously in x:40,y:50).

    After a sprite is destroyed or a sprite is pushed to a direction/ kicked, it will start respawn in the x:40 , y:50 position.

    I've tried using IID to store the sprite's IID to a global variable, which can be used to "Pick Nth instance" , so after the push, Nth instance will be the sprite's IID which have been pushed. I used IID because it is said that IID still intact even after a sprite is destroyed.

    This method works for the first respawning, but doesnt work in the second respawning.

    I really dont know the problem why this is happened.

    It is hard for me to explain this problem, so see the capx for yourself.

    This is the capx

    s000.tinyupload.com ... 5753272595

    Thanks anyway.

  • Sorry for the late answer.

    For some reason, The first CAPX you sent to me (KickEm) doesnt do the respawn at all. (But the script is all make sense)

    When the spheres kicked to wall, it seems like it will spawn another object, before the wall coordinate (presumably because the spawning position is the same with the ball movement, or the "thisX" or "thisY" coordinates counted not when the sphere being kicked, but AFTER it).

    Then I tried to modified the separated layout in many different manners, but it always doesnt do the respawn thing. (this is very strange ,and make me sratch my head many times because the script is almost the same with my first attempt ) . Next time I come back I will include the "working" CAPX.

    This maybe embarrassing, but the second CAPX you sent me (the compressed one) dont work at all. I've download the rex behavior MoveTo plugins, but no matter what I do, it always show error in plugins/ javasript.

    I've consult with my friend about this matter, and he suggested me to use the System : Wait.

    Basically it means that when a sphere is kicked, it will do the Wait (such as 5 secs) and then reposition the kicked sphere to starting position, WITHOUT DESTROYING it ( this actually make possible by turning off all of the collision trigger and turning off the visibility of the sphere, which is hypothetically effective because it uses the same UID and IID / not change the ID at all). But I guess it is not possible to do in my game , because the sphere can collides with other spheres and have to be destroyed when hitting certain objects).

    I did some research a while ago about UID and IID. I strongly believe that the most correct way of doing this respawning problem is to use IID.

    Given if IID will sort the multiple instances of an object (Ball) and always has consistent value even when any instances is being manipulated (destroyed/ changed) , I have an idea (but i dont know how to put it on code)

    Basically, it will do these things :

    1. Store an instance variable of IID in an instance (such as ,in any Sphere , put an "thisIID" instance variable)

    ,which have 2 alternative possibilities :

    a. Putting a value of -1 in "thisIID" of every instances onscreen , and fill the value at the Start of Layout with Self.IID

    (maybe using "For each")

    b. Putting value of "thisIID" with Self.IID

    2. Always compare / pick the IID of the Sphere that currently being kicked or starting respawn counter, with Self.IID

    (also, maybe using For Each), basically, it will perform the spawning if the IID of kicked sphere is the same as the IID in instance variable.

    Or maybe uses expressions like, Pick Nth instance....

    I might be gravely wrong about this, but I cant think of other possibilities. (the more I dwelve into IID explanations, I getting even more confused )

    I really need to overcome this matter, as it seems to be my last hurdle in completing my game.

    About your opinion that 100 event limitations is a blessing, somewhat I have to agree with you. I keep telling myself that in the older days , gaming peoples were struggling with cartridge sizes,RAM or stuffs like that . But I found that it is those things that make the classics great. Limitations drives people forward. Thats what I think.

    Thanks for your replies. If the game is finished, I'll let you know.

  • Grid move ? Do you mean locking a player's movement in 4 direction (when a player move upward, left and right direction are locked ?). I could do that but it will take over 25 events ( it is a 4 players game). The 100 events limitation is a hell. It takes over 50 events just for a perfect control.

  • All right, I'll post my capx.

    Press WASD to move ,and Z to push Spheres.

    s000.tinyupload.com

    I think It doesnt seem right to place the timer in the Player. As each instances / objects of Sphere has their own timer, which if any Sphere getting kicked, the corresponding Sphere will start the timer and respawn after 50 secs/ counts.

    It is a strange thing that I experienced that the kicked spheres dont respawn at all (my first try with the (-almost-) same script did the respawn stuff). And it seems that you cant trigger the respawning after a sphere is destroyed (the manual says that it will make the Construct to crash).

    It seems that the other viable options is:

    1. Using UID for each Spheres on screen (which I completely drawing blank about)

    2. Using Array / Dictionary / XML to store the coordinate of every spheres (which I have little experience with, and more awkward way to do in Construct)

    I am currently struggling with 100 events limitation, so I need to be very efficient at using every events.

    What is the best way to overcome this ?

    And should I repost this topic in a different title?

  • I'll try this. Thanks. (I apologize for long reply as I dont have my own internet connection)

  • I'll try explain again. The player character can kick an object (like a sphere), which has a coordinate of (40,100). After kick, the object will moving forward (and activating its bullet behavior). After the object hit something, like a wall.

    It will destroy the object, and start adding its Counter / TImer variable . After certain value (like 100), it will respawn the object in (40,100).

    I somehow succeeded in my first try ,by putting 2 instance variables (in the object, every individual object on screen)that store the value of coordinate : thisX (40) and thisY (100). Somehow it works, but the result makes the object multiplying themselves (like rapid fire shot in shmups games) and sometimes the object doesnt respawn anymore.

    I'm really stuck at this. Anyone can help me? Thanks in advance.

  • Thanks . But to clarifying things, overlap means if a sprite touch another sprite (even by difference of 1 px) , it will be accounted as triggering something, right ? SO, in order to prevent this, I must make some sprites smaller by 1 or 2 px, right ? (in a maze-like level design)

  • So I have a sprite that will move when activated. When being moved, the instance variable "Counter" will activate , and after certain value, will respawn the object at the previous coordinate.

    What is the best method of doing this ? I've tried to put 2 instance variables that store the value of the sprite coordinate, like "thisX" or "thisY" = coordinate.

    But it doesnt always work. I dont understand how to differentiate trigger of a specific /individual object with object instance (class). Anyone can help me ?