GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Single spawn call somehow spawns two actors?

MattSodenMattSoden Posts: 30Member
edited December 2014 in Working with GS (PC)

I have noticed recently that a single 'Spawn Actor' behaviour can spawn, what appears to be, two actors exactly aligned on top of one another.

I have created a simple scene to test this, with only two actors. One is a 'Spawner' which is visible on the left-hand edge of the screen and has one rule that says:

Timer: Every 3 seconds Spawn Actor 'Mover' in front of actor with all 0's for location and direction - all relative to the actor.

The second actor is the 'Mover' which has two backstage elements:

Move: Direction 0 relative to scene at Speed 100

Rule: If self.position.x is off the screen [ >500 in this case] Destroy this actor

I only noticed this bug/issue because I was using a png image with some simple transparency and every so often the transparencey would look too dark.

The alpha value of the above 'Mover' is set to 50% and every 2-3 spawns the colour of the mover is twice as dense as the previously spawned actors - this says to me that there are actually two actors being spawned exactly on top of one another.

Has anyone else seen this? PC issue only?

Comments

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

    These kinds of issues are almost always due to an unlocked "instance" of an actor that has different rules from the "prototype" actor. To check for this, double-click on the Spawner actor in the scene and see if a lock symbol appears. If not, you will see a "Revert to Prototype" button at the top of the rule list. If it's locked, then the problem is elsewhere. You can also just delete the actor from the scene and add it again which forces it to be a prototype.

    Is it possible you have multiple Spawner actors in the scene? To check for that, look in the Scene tab under Layers and open each named layer.

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

  • MattSodenMattSoden Posts: 30Member

    Hi Tatiang,

    I don't think it's an 'unlocked instance' issue as even deleting and dragging a new actor to the scene still has that behaviour when previewed.

    I have uploaded a video to Youtube - please ignore the first 20secs or so as the video hot key was the same as one I used to launch CS suite... hence a strange appearance from the launcher.

    So, from 20secs on, I show the two elements, place a new 'Spawner' and show the 'Mover' setings, then preview the scene and you can see the differing colour densities for the 'Mover' actor.

    youtu.be/MZNrAOyu0gs

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

    The video shows a single actor on the scene that should spawn a single actor. So what you're showing looks like a bug to me. Can you upload a link to download your project file so I can take a look (.zip it first)? I use Mac Creator but at least I could confirm for you if it's happening on another machine.

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

  • MattSodenMattSoden Posts: 30Member

    Thanks tatiang,

    Hopefully this is what you need.

    https://dropbox.com/s/mdg4bjhsqmz0cig/DoubleSpawnMac.zip?dl=0

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

    I added a Log Debugging Statement that logs game.Time and it shows that a single actor is being spawned every three seconds:

    Log(Actor: Spawner): spawner
    Log(Actor: Mover): 3.017694541
    Log(Actor: Mover): 6.016946387
    Log(Actor: Mover): 9.017651133
    Log(Actor: Mover): 12.016965247
    Log(Actor: Mover): 15.017318715
    Log(Actor: Mover): 18.016776345
    Log(Actor: Mover): 21.017023501
    Log(Actor: Mover): 24.017737693
    Log(Actor: Mover): 27.017434145
    Log(Actor: Mover): 30.017478384

    I'm not seeing the issue you're describing. Sorry, I don't have a PC to test it on.

    Have you tried creating a new blank project file and re-creating the rules to see if it's just a corrupt file? What values do you see for game.Time?

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

  • MattSodenMattSoden Posts: 30Member

    Thanks again tatiang,

    I've seen it happen in a few projects I've messed about with - all have images/actors with areas of transparency that appear 'denser' that others.

    I activated the Debugger Console and added a 'Log Debugging Statement' to the 'Mover's' rule to see if the debugger could identify if more than one 'Destroy' happened when I think the overlayed actor is destroyed - there should be 2 simultaneous deaths if there are actually 2 actors overlapping.

    Sadly the Debug Console didn't seem to be getting any statements and stayed empty.

    My Log Debug Statement equation was: "Mover Died: "..game.time

    Is my equation's syntax correct?

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

    As long as you are selecting game.Time from the attribute browser and not just typing it in, that should work.

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

  • MattSodenMattSoden Posts: 30Member

    Hmmm, looks like another PC Gamesalad issue that the Debugger isn't working (on my PC at least).

    I checked the log with a 'dragged' cursor just in case there was white text on a white background, but there's definitely nothing there...

    ah well, hopefully it's just an oddity on my PC and not on other PCs or Macs.

    Thanks anyway.

    I wonder if it's more of a rendering issue with the transparency not rendering consistently rather than a double-spawned actor?

Sign In or Register to comment.