wakiki31's Forum Posts

  • 12 posts
  • did you make it solid? i mean the wall? then in pathfinding make it custom i think the name. just make it custom solid like that

    Tried it but it still gets stuck on corners.

  • Save your game as a single file CAPX instead of a project and provide that link and I will look at it. Sounds like a problem with your collision boxes hanging up the movement.

    drive.google.com/file/d/0B_2dhssETpaVRk10eWMtclJSdnM/view

    just click the download button and it'll be downloaded as a single .capx file. Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I think you need a specific destination. I mean put invisible sprite where your object target

    already tried it, but it has someting to do with the collision cells. xD most of the time, the moving object can pass through the first wall, but after that, it gets stucked on the 2nd wall and will not move.

  • drive.google.com/file/d/0B_2dhssETpaVb3pJV1JGeUtpMlk/view

    guys, my problem here is that the pathfinding behavior is not moving precisely. I want my 32x32 object to move... How do i fix this and why is this happening??

  • Mine is not working in google chrome but it works on FF, thankfully. i'm using r221, which i suppose is the latest stable release right now.

    [XMLHttpRequest cannot load file:///C:/Users/baconawa/Desktop/thesis/data.js. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.d.ys @ c2runtime.js:90]

    [c2runtime.js:5 Error requesting data.js:ga @ c2runtime.js:5]

    [c2runtime.js:5 XMLHttpRequestProgressEventga @ c2runtime.js:5]

    [index.html:110 Uncaught (in promise) DOMException: Failed to register a ServiceWorker: The URL protocol of the current origin ('null') is not supported. index.html:110]

    I pressed F12, and found these errors on chrome. xD

  • system >> on start of layout > function call "spawning" ()

    system >> for each spawnedSprite

    -> spawnedSprite [INVERTED][is overlapping block1"or" block2"or" spawnedSprite at offset(0,0)]>>spawnedSprite>>set position to int(self.x/32) * 32 +16, int(self.y/32) * 32 +16

    system >> else

    ->spawnedSprite is overlapping block1"or" block2"or" spawnedSprite at offset(0,0) >> spawnedSprite>>set position to random(0,480), random(480,0)

    [GROUP] SPAWNER

    function On "spawning"

    -> system >> repeat 20 times >> system >> create obj spawnedSprite on layer at random(0,480),random(480,0))

    so explaining my code again....

    I removed "on create" command since it is redundant with my "for each" loop... so as to how i understand my code, what's happening here is first i create 20 instances of spawnedSprite, then once finished, the for loop will test each of spawned sprite whether it is overlapping any object or not. If it does not overlap any object then it'll place the spawnedSprite on the center of the square that it occupied. If it overlaps another object, then it'll find another space and it'll get tested again in the for loop until it does not overlap any object. Once the spawnedSprite does not overlap any blocks, it'll get centered on the square it is occupying and the for loop will go to the next spawnedSprite and it'll repeat the process until all spawnedSprite are not overlapping any blocks or itself. OR ITSELF... im sorry i forgot about that. I also took the precautionary measure as to whether it might overlap itself, so there you have it. I hope that you learned something.

    thanks to skymania, he gave me some ideas on his snake like game.

    PS it's been fun typing here, I'd just like to tell the other devs out there that has problems of their own that if nobody helped you then there's always yourself whom you can count on... also, don't blame others if they don't help you, just think that if you overcome your present problem, then there's another that needs to be solved all by yourself... AHAHAHAHA!! i suppose you get it.

  • Nice one! Bob Marley said on one of his live music and I too will say nice one for i have solved my problem. happy reading. i also noticed that i should type it more clearly since the editor will remove any useless space. xD

  • hello again... so i made another adjustment to my event sheet... here it is..

    sprite 2 >> on created >> spawnedSprite >> set position to int(self.x/32) * 32 +16, int(self.y/32) * 32 +16

    system >> on start of layout > function call "spawning" ()

    system >> for each spawnedSprite

    -> spawnedSprite is overlapping block1at offset(0,0) >> set position to random(0,480), random(480,0)

    "or" >> set position to int(self.x/32) * 32 +16, int(self.y/32) * 32 +16

    block2 at offset(0,0)

    "or"

    spawnedSprite at offset(0,0)

    [GROUP] SPAWNER

    function On "spawning"

    -> system >> repeat 20 times >> system >> create obj spawnedSprite on layer at random(0,480),random(480,0))

    so now, it's somehow working but it's still not 100% so this is still a very bad event sheet. xD Sometimes it spawn all 20 without overlapping any objects but sometimes, it does not spawn all 20 spawnedSprite... so pls help me find as to what is wrong with this... or just read this as it might help you. ;D happy reading.

  • Hello, my problem is how to spawn exact amount of sprites without overlapping another object.... I tried to reposition the spawned sprite if it is overlapping another object.... For example, I have to spawn 5 sprites anywhere, but 1 of the sprites spawned on top of another object. The problem is how will I reposition that object so that it won't be overlapping another object?? Pls help. thanks a lot...

    PS I've seen skymania's thread... it was helpful. it gave me some idea but I still can't solve the problem wherein i must spawn the exact amount of sprites

    PPS I found another way of solving my problem, by destroying the object that got overlapped by the spawned sprites, but that's not what i want to happen. xD so if anyone out there can help me, i'd be very thankful. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

    PPS I posted my problem in Game Dev., Design and Ideas but i think it was wrong so im deleting my post there. HAHAHA!! Sorry moderator.

    PPPS I'll be posting my "new" code because i've been trying to solve this problem.. xD

    https://www.dropbox.com/s/w1ytmnbtoflaa ... t.png?dl=0 >>>> event sheet

    https://www.dropbox.com/s/zii3b7iu2nbcu ... s.png?dl=0 >>>>> output

    https://www.dropbox.com/s/8u07ezz3jopss ... T.png?dl=0 >>> NewOutput

    https://www.dropbox.com/s/siqi1n08wog1w ... E.png?dl=0 >>>>newEventSheet

    https://www.dropbox.com/s/8u07ezz3jopss ... T.png?dl=0

    So as you can see there... I'm still not good at using the function and the for loops. xD I still don't know what I'm doing.... I'm just using any commands in Construct2 as long as it runs. xD

    By the way, credits to Kyatric, i used his idea on centering the spawned sprite on a single square.

    I tried the while(but it doesn't load, and im getting errors xD), the compare instance variable too just so if anyone will ask... but maybe I wasn't able to utilize it. hahaha!! so please help me here. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

    xD okay, so another problem here. xD The link that I posted cannot be viewed and I dont know why. so I'just write my code here.

    system > on start of layout > function call "spawning" ()

    [GROUP] SPAWNER

    function On "spawning"

    -> system >> for "spawn" from 1 to spawnedSprite.limit >> system >> create obj spawnedSprite on layer at

    random(0,480),random(480,0))

    sprite 2 >> on created >> spawnedSprite >> set position to int(self.x/32) * 32 +16, int(self.y/32) * 32 +16

    first thing first, i created a map wherein there are lots of blocks everywhere, I also created a sprite called "spawnedSprite" that has an instance variable of "limit". i used that "limit" as my end index in my for loop...So what's happening here in my code is that it spawn the 20 instance of my created sprite anywhere in the map... My problem is that I don't want my sprites to be overlapping any blocks....

    so I modified my event sheet... here's the new one

    global number maxval = 1

    on start of layout > function call "spawning" ()

    [GROUP] SPAWNER

    function On "spawning"

    -> system >> for "spawn" from maxval to spawnedSprite.limit >> system >> create obj spawnedSprite on layer at

    (random(0,480),random(480,0))

    >> add 1 to maxval

    -> spawnedSprite is overlapping at offset block1 >> spawnedSprite > destroy

    or

    spawnedSprite is overlapping at offset block2

    sprite 2 >> on created >> spawnedSprite >> set position to int(self.x/32) * 32 +16, int(self.y/32) * 32 +16

    So, on my revised event sheet, i created a global variable "maxval". I used it as my counter to be used in for loop(i still don't understand how the for loop works but i gave it a try and how I understand the for loop is like it'll continue doing its function as soon as the condition is achieved)... so everytime i spawn a sprite, i add 1 to "maxval"... i also added another condition to check whether the spawned sprite is overlapping any blocks, and if it overlaps any block, it will get deleted automatically and will subtract 1 to "maxval"(i added a subtract 1 to maxval because, according to my understanding of the for loop, it will subtract 1 to maxval and it's like it'll keep on resetting until the spawned sprite is in a satisfying condition, only that tym the max val will get increase ).... i thought it'll solve the problem but still doesn't. xD what actually happend is that it only deletes the spawned sprites that are overlapping and as a result, it does not reach 20. xD help me pls.

  • Message: wakiki31 can only post plain text URLS until they have 500 rep. 4 URLS modified.

    The URLS can not be viewed

    xD I don't know what's happening either. xD guess I'll just have to write my event sheet. xD

  • Hello, my problem is how to spawn exact amount of sprites without overlapping another object.... I tried to reposition the spawned sprite if it is overlapping another object.... For example, I have to spawn 5 sprites anywhere, but 1 of the sprites spawned on top of another object. The problem is how will I reposition that object so that it won't be overlapping another object?? Pls help. thanks a lot...

    PS I've seen skymania's thread... it was helpful. it gave me some idea but I still can't solve the problem wherein i must spawn the exact amount of sprites

    PPS I found another way of solving my problem, by destroying the object that got overlapped by the spawned sprites, but that's not what i want to happen. xD so if anyone out there can help me, i'd be very thankful. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

    PPS I posted my problem in Game Dev., Design and Ideas but i think it was wrong so im deleting my post there. HAHAHA!! Sorry moderator.

    PPPS I'll be posting my "new" code because i've been trying to solve this problem.. xD

    dropbox.com/s/w1ytmnbtoflaa ... t.png?dl=0 >>>> event sheet

    dropbox.com/s/zii3b7iu2nbcu ... s.png?dl=0 >>>>> output

    dropbox.com/s/8u07ezz3jopss ... T.png?dl=0 >>> NewOutput

    dropbox.com/s/siqi1n08wog1w ... E.png?dl=0 >>>>newEventSheet

    dropbox.com/s/8u07ezz3jopss ... T.png?dl=0

    So as you can see there... I'm still not good at using the function and the for loops. xD I still don't know what I'm doing.... I'm just using any commands in Construct2 as long as it runs. xD

    By the way, credits to Kyatric, i used his idea on centering the spawned sprite on a single square.

    I tried the while(but it doesn't load, and im getting errors xD), the compare instance variable too just so if anyone will ask... but maybe I wasn't able to utilize it. hahaha!! so please help me here. <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy" />

  • skymania

    can u upload the .capx for your example? or a screenshot maybe? i have the same problem as yours but a little different. tsk! Like your problem, i have to spawn a sprite anywhere on the screen, but the sprite that i needed to spawn is at least 20, without overlapping any object... i tried destroying the sprite if it overlaps any object but i noticed that it's not a good idea... I am now trying to just find another position for my sprite once it overlaps an object. but then a new problem arise, it's not "snapped to grid"... i suppose you can imagine that. So, again if you could upload the screenshot of your event sheet or the .capx, it would be of great help to me. thanks to your "overlapping at offset" idea too. it helped, but still right after doing that, I had a new problem right away. xD

  • 12 posts