Actor won't be destroyed

JayReiterJayReiter TexasMember Posts: 88

I've got a side scrolling shoot-em-up. I want the player's laser fire to disappear when it collides with an enemy spaceship. It should be simple, right? I put a collision condition on the player's laser actor, and set it to collide with the enemy spaceship, then put a destroy behavior on it. Yet when I demo the game, the player's laser fire goes THROUGH the enemy spaceship and continues along the scene, taking out any other enemies behind the initial one it collided with. I don't get it. And the weird thing is I have the same condition/behavior on the enemy's laser fire (set to collide with the player) and the enemy laser fire disappears when it collides with the player just fine. Why is that??

Comments

  • SocksSocks London, UK.Member Posts: 12,822

    Can you grab a screen shot of your rules and post them in this thread . . . .

  • JayReiterJayReiter TexasMember Posts: 88

    And I guess I need to have my post approved for some reason...?? Sheesh.

  • JayReiterJayReiter TexasMember Posts: 88

    I've had my fill of computers for the night. Things just aren't going my way at the end of this evening. Lol. I did get some good work done but now I'm just getting frustrated. I'll check back here tomorrow. Thanks for the quick reply Socks. I appreciate it.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @JayReiter said:
    And I guess I need to have my post approved for some reason...?? Sheesh.

    No...

    We'll try again in the morning?

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • JayReiterJayReiter TexasMember Posts: 88
    edited April 2014

    @tatiang said:No...

    We'll try again in the morning?

    I tried posting some links to Photobucket pictures/screen captures last night. When I clicked "Post Comment" I got a screen that told me the post needed approval. It still didn't post today, so I'll try again here.

  • JayReiterJayReiter TexasMember Posts: 88

    imagephoto Screenshot3.png" alt="" title="" />

    Aha! Figured it out. :)

  • bjandthekatzbjandthekatz Orlando, FlMember Posts: 1,375

    The destroy condition doesn't look like its inside a rule.

  • JayReiterJayReiter TexasMember Posts: 88
    edited April 2014

    Hmm. I posted another comment with the other three or four screen shots to complete my behaviors, but it doesn't look like the post is showing. I'll wait a bit to see if it shows up. If it doesn't, I'll repost. The destroy actor within the timer from the first post is just to have the Energy Blast actor be destroyed once it scrolls outside the scene. The next few screen shots are the behaviors of destroying the enemy ships. There's three: Helicopter Blue, Space Ship Green, and Crescent Ship.

  • JayReiterJayReiter TexasMember Posts: 88

    imagephoto Screenshot4.png" alt="" title="" />

    Well, it looks like the post with several links didn't work. I'll just post each picture individually. That seems to work.

  • JayReiterJayReiter TexasMember Posts: 88

    imagephoto Screenshot5.png" alt="" title="" />

  • JayReiterJayReiter TexasMember Posts: 88

    imagephoto Screenshot6-1.png" alt="" title="" />

    That does it.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @JayReiter said:
    I tried posting some links to Photobucket pictures/screen captures last night. When I clicked "Post Comment" I got a screen that told me the post needed approval. It still didn't post today, so I'll try again here.

    Glad you were able to get the images working (at least one at a time). If you see the approval error message again, please send me a screenshot of it via Private Message. You can always upload it and send me the link instead of embedding it.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    From your rules, it looks like the energy blast actor should be destroyed when it collides with the Helicopter, space ship, or crescent ship actors. Does that happen? If not, make sure you don't have duplicate actors with the same name in the Actor's pane. Also try adding a Log Debugging Statement right before the Destroy Actor behavior in each case and then open the Debugger window to verify that the rules are true when you expect them to be true (i.e. right after a collision).

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • JayReiterJayReiter TexasMember Posts: 88

    @tatiang said:
    Glad you were able to get the images working (at least one at a time). If you see the approval error message again, please send me a screenshot of it via Private Message. You can always upload it and send me the link instead of embedding it.

    I will. Although the approval screen was when I used the URL Link icon (second from the last icon at the top). Today I used the Attach Image/File icon, which worked. Last night I was copy and pasting the URL from the Photobucket image into the Attach Image/File option, but I would only get a black box with an "X". Even if I right clicked and chose "Show Picture." So I just tried to copy and paste the URL into the URL Link icon, which gave me the approval screen. Today, when I seemingly have a bit more patience, I played around with the Photobucket site a bit (I rarely use it) and found an option that gives me a pop up screen with four different embed options. I found one that works with the Attach Image/File icon and away we go.

  • JayReiterJayReiter TexasMember Posts: 88
    edited April 2014

    @tatiang said:
    From your rules, it looks like the energy blast actor should be destroyed when it collides with the Helicopter, space ship, or crescent ship actors. Does that happen?

    That's exactly what should happen, but doesn't. The energy blast actor goes through the helicopter, space ship, and crescent ship actors (after destroying the helicopter, space ship, or crescent ship) and takes out any other of these actors that may be in its path as well. Hence the problem.

    @tatiang said:
    If not, make sure you don't have duplicate actors with the same name in the Actor's pane.

    I don't think I do. I'll double check here in a bit.

    @tatiang said:
    Also try adding a Log Debugging Statement right before the Destroy Actor behavior in each case and then open the Debugger window to verify that the rules are true when you expect them to be true (i.e. right after a collision).

    I've never used the Log Debugging Statement thing before. Not sure what it is or what it does. I'll see if I can track down a tutorial on the subject.

  • JayReiterJayReiter TexasMember Posts: 88
    edited April 2014

    Well, I just tried the same thing that got me the approval screen from last night, but it immediately embedded the URL (which is what it was supposed to do in the first place last night) instead. Looks like it's working properly today. Weird.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    If you like, you can send me a link to download your file (compress it as a .zip file and upload it to a file-sharing site first) and I'll take a look at your code.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • JayReiterJayReiter TexasMember Posts: 88

    Hey Socks. Here's what I have. There are five screen captures I'll post that encompass the rules for the Energy Blast actor (I know I called it player's laser fire in the above post - same thing). Let me know if you need me to post anything else.

    s24.photobucket.com/user/jayreiter/media/Screenshot2.png.html

    s24.photobucket.com/user/jayreiter/media/Screenshot3.png.html

    s24.photobucket.com/user/jayreiter/media/Screenshot4.png.html

    s24.photobucket.com/user/jayreiter/media/Screenshot5.png.html

    s24.photobucket.com/user/jayreiter/media/Screenshot6-1.png.html

    For some reason I can't use the "Attach image/file" option at the top of my thread here. When I paste the URL in the Attach image/file bar and preview the post, it only shows an "X" instead of the picture... I swear I'm not computer illiterate. :neutral_face:

  • JayReiterJayReiter TexasMember Posts: 88

    imagephoto Screenshot4.png" alt="" title="" />

    imagephoto Screenshot5.png" alt="" title="" />

    imagephoto Screenshot6-1.png" alt="" title="" />

  • JayReiterJayReiter TexasMember Posts: 88

    @tatiang Looks like the posts from last night finally appeared in duplicate here.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    Strange. I just deleted the duplicates.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • JayReiterJayReiter TexasMember Posts: 88

    Yeah, I thought so. The comment that starts with "Hey Socks" and ends with "I swear I'm not computer illiterate" is specifically the one that needed approval.

  • JayReiterJayReiter TexasMember Posts: 88

    Oh, and I PM'd you think link to download the zip file of my game. Let me know if the link doesn't work for whatever reason. I'm going to bed for the night. I'll check back in here tomorrow to see what you think of my game coding.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited April 2014

    Your collisions rules looks correct and when I play it in Mac Creator, it works fine. Maybe there's something about your installation of Windows Creator that isn't working properly. I sent you a video of the gameplay via PM.

    If you haven't checked this out yet, you might want to: http://forums.gamesalad.com/discussion/59247/windows-creator-first-stop-if-you-experience-unexpected-behaviours/p1.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • JayReiterJayReiter TexasMember Posts: 88

    @tatiang I have checked that link out, actually. As far as I can tell, my computer's set up to use the decimal instead of the comma.

  • joshiwujoshiwu Member Posts: 207

    try It with "run to completion" checked in on the destroy timer. =)

  • JayReiterJayReiter TexasMember Posts: 88

    Well, the bad news is I just deleted the old collision rules and inserted new collision rules for each individual ship I want the actor to destroy and no luck. :neutral_face: My logic was maybe it was buggy coding (er something) and re-introducing the same behaviors just as new coding might reset the actor and give me the desired effect. Again, no luck.

    BUT

    The good news is I created a new animated actor called 1Explosion. It's the explosion animation that each ship will cycle through upon destruction. Since every ship will go through the 1Explosion actor cycle upon death, and since the energy beam actor will always cause death, I just eliminated all the old collision rules and inserted a new one that destroys the actor upon collision with the 1Explosion actor. It works perfectly. Weird that it will work with the 1Explosion actor and not the individual ship actors. But on the super plus side not only did this solve my issue, it also created a much more efficient code since every ship will go through the 1Explosion actor cycle upon death. Now I don't need to go back into the energy beam actor and add a new collision rule with every new enemy I create. Yay, progress! :smiley:

  • JayReiterJayReiter TexasMember Posts: 88

    @joshiwu said:
    try It with "run to completion" checked in on the destroy timer. =)

    Thank you for the idea. I did end up finding a work around, but should I run into a similar problem, I'll be sure to follow your idea. :smile:

Sign In or Register to comment.