Problem: eats the entire watermelon.

TJMNUTTJMNUT Member Posts: 236
edited November -1 in Working with GS (Mac)
I have it so that when actor collides with the watermelon it changes attribute game.watermelon hitpoint to watermelon hitpoint +1. When attribute game.watermelon hitpoint=1, change image. I also have it so when the ant collides with the watermelon, it destroys the ant. But this is what happens.
«1

Comments

  • old_kipperold_kipper Member Posts: 1,420
    your video is set to private so unable to view it...
  • Mcreator83Mcreator83 Member Posts: 120
    i could not see the video but i think i get what you mean. In My game Hungry Worms there is an apple in the center and worms come at it from all sides too eat it. at first all went well and one bite was taken every time a worm collided with it but then i added new spawners and that is when one worm ate the entire apple in one bite.

    at first i thought it was a bug or something but it actually is how the actors are placed on screen that made this happen. make sure you have all the spawners stacked together in the scene section next to "games" where the actors are. just drag them and place them over the watermelon and have the background under them all. hope that helps

    cheers!
  • TJMNUTTJMNUT Member Posts: 236
    I don't understand, but I un-privated the video now.
  • FloridaGamesFloridaGames Member Posts: 328
    we would be able to help alot more if we could see some of the coding. just for the watermelon and ant.
  • TJMNUTTJMNUT Member Posts: 236
    Mcreator83 said:
    i could not see the video but i think i get what you mean. In My game Hungry Worms there is an apple in the center and worms come at it from all sides too eat it. at first all went well and one bite was taken every time a worm collided with it but then i added new spawners and that is when one worm ate the entire apple in one bite.

    at first i thought it was a bug or something but it actually is how the actors are placed on screen that made this happen. make sure you have all the spawners stacked together in the scene section next to "games" where the actors are. just drag them and place them over the watermelon and have the background under them all. hope that helps

    cheers!

    I don't quite understand, can you please elaborate?
  • TJMNUTTJMNUT Member Posts: 236
    here ar the pictures. Watermelon/Users/tylermcclellan/Documents/Watermelon Rule 1.tiff/Users/tylermcclellan/Documents/Watermelon Rule 2.tiff/Users/tylermcclellan/Documents/Watermelon Rule 3.tiff Ant/Users/tylermcclellan/Documents/Ant 1.tiff/Users/tylermcclellan/Documents/Ant 2.tiff/Users/tylermcclellan/Documents/Ant 3.tiff/Users/tylermcclellan/Documents/Ant 4.tiff
  • TJMNUTTJMNUT Member Posts: 236
    oh wow i'm an idiot, how do you post pictures
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    http://gamesalad.com/forums/topic.php?id=33

    look at the 2nd last post in that thread
    Note: The url of image must be located on the web somewhere. Not just on your computer.
  • TJMNUTTJMNUT Member Posts: 236
    where can i post them
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    tinypic.com
  • TJMNUTTJMNUT Member Posts: 236
    do i choose image or url
  • TJMNUTTJMNUT Member Posts: 236
    I can't work it for some reason, can Mcreator83 please explain a little more please!
  • outasiteoutasite Member Posts: 417
    -To post images you need to use html.
    -Images need to have a URL. Use picasa, flicker, photobucket... what ever as long as you can get its URL

    Then just paste the code.

    #img src="IMAGE URL GOES HERE" /$

    Replace the # with < and $ with >

    Example:
    image

    As for the water melon, you can use TBS's video on custom font. But instead of showing numbers you can show water melon health.


    *To post videos just use the URL

    So for the water melon make 2 self attributes health & div
    -Rule: actor overlap colides with actor with tag "bug"
    Change: Health to health - 1

    Then use TSB's constrain attribute

    I hope I don't send you spiraling down hill...
    Michael

    Please note: Take everything I say with caution, there are usually better ways to do things. I always just go with the 1st thing that pops into my head.
  • TJMNUTTJMNUT Member Posts: 236
    I already have all the health set up, it's just that the whole thing gets eaten. Also, there are two different scenes, both the same scenes, but different spawners. But the whole watermelon only gets eaten in one of the scene, not the other.
  • outasiteoutasite Member Posts: 417
    how is you health set up? what rules do you have for the "eating" and changing pic?
    You might have a loop set up so its health goes from 10 to 0 instead of 10 to 9
  • TJMNUTTJMNUT Member Posts: 236
    I have an integer watermelon hitpoint. When overlaps or collides with ant change attribute game.watermelon hitpoint, to game.watermelon hitpoint+1. When attribute game.watermelon hitpoint=1 change image, so on and so forth
  • outasiteoutasite Member Posts: 417
    Might I ask why you went with + 1 instead of - 1?

    Also I would recommend Change Atribute: self.image to watermelon2.png instead of change image.
    Only because you are going to be loading ALOT of images it seems, and this will cut loading times down. GS recommends against this only because when they fix the loading issue, but until then this is the best way, and can easily be fixed when the update comes.

    You logic makes sense I don't under stand why this is happening. Are you sure that it is happening? Any way attributes are firing multiple times?
  • TJMNUTTJMNUT Member Posts: 236
    heres another demonstrations
  • outasiteoutasite Member Posts: 417
    In the video it seems as hough you've got it woking. How many "hit point" does the water melon have?
    Be warned that the ant actors are small, and I recommend testing on a device. It might be quite hard touching them.
  • TJMNUTTJMNUT Member Posts: 236
    4
  • TJMNUTTJMNUT Member Posts: 236
    well, the attribute is at 0, but when it=4, change attribute self.color.alpha to 0
  • TJMNUTTJMNUT Member Posts: 236
    hopefully this video might help, i actually talk in this one
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    It almost looks like to me that the destroy actor behavior in the ant actor is a little delayed so it's not getting destroyed fast enough. Consequently, the ant hits the watermelon, the watermelon's HP goes down and the image changes, but the ant keeps going and it hits the next image of the watermelon, and so on.

    One thing you could try is that instead of spawning/destroying the ant, you could just recycle the ant actor by moving it back to its starting position when it touches the watermelon. Perhaps this action will be faster than the destroying behavior and the watermelon will be properly eaten.

    Another thing you could try is deleting the ant actor in the scene and dragging in a new instance of it from the prototype. I have encountered issues in the past where I would be creating new instances of actors already in the scene via option-dragging and they would start acting all wonky. I discovered that dragging a new instance of the actor from the prototype instead of from another instance performed correctly.

    Anyway, that's some things to try. Good luck with the problem!

    - Jeff
  • TJMNUTTJMNUT Member Posts: 236
    but what i don't understand is why it works in easy and not medium.
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    That's what I'm saying about deleting the ant actor. You said you created the medium scene by copying the easy scene, right? Maybe the instance of the ant actor in the medium scene got corrupted during the copy process. Maybe deleting the instance of the ant actor in the medium scene and dragging in a new instance from the ant actor prototype will solve the problem.

    I've been working with all kinds of software long enough to have seen workarounds for bugs that are more like voodoo than they are about logic and reason. ;)

    - Jeff
  • TJMNUTTJMNUT Member Posts: 236
    Thanks a lot, but I'm not quite sure what you mean by dragging in the prototype.
  • JeffreyShimaneJeffreyShimane Member Posts: 372
    Dragging in the prototype is placing the ant actor into the scene. Delete the ant actor in the medium scene then drag the ant prototype from the actors window into the medium scene. This will create a new instance of the ant actor in the medium scene.

    - Jeff
  • TJMNUTTJMNUT Member Posts: 236
    I wonder, could this possibly work, if I had an ant easy ant medium an ant hard and an ant expert for all separate actors so it wouldn't have to compute the same actor over and over for different scenes.
  • Mcreator83Mcreator83 Member Posts: 120
    TJMNUT said:
    hopefully this video might help, i actually talk in this one

    hey again.

    yup i had the same problem with my apple. be sure to have all the spawning actor in the same layer.

    lets say i have this in my scene:

    antSpawner
    antSpawner
    antSpawner
    waterMelon
    chocolate
    antSpawner < wrong!
    chocolate
    Background

    the wrong is were the mistake is you need too put this one under the other antSpawners

    tell me if this helps

    cheers!
  • TJMNUTTJMNUT Member Posts: 236
    I only have one ant spawner per scene, and the different spawners all have different spawn rates.
Sign In or Register to comment.