GameSalad recycles instance when spawning
Buliam
Member, PRO Posts: 20
Hi,
I have an Actor A, that starts out on the scene at the beginning of the game as an instance. This instance is subject to being destroyed in the course of the game. Meanwhile, A other instances of A are also being spawned during the game.
The problem is, that once the original instance A, that started out on the screen, gets destroyed the next instance of that Actor being spawned will actually be that original instance, rather than a prototype instance. I know this, because the original actor A has slightly different behaviors and different values for some variables.
Is this supposed to be that way? Are instances that start out on the scene and then get destroyed supposed to be respawned?
Thanks
Vin
Comments
No. What you're describing is not typical behavior. When you spawn an actor, it should always take on the prototype rules and attribute values. Can you describe how you verified this? Are you using Display Text or Log statements to watch the value of certain attributes? Any chance you can post a copy of your project file (.zip it first)? This sounds hard to resolve without seeing the file as a whole.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Yes exactly. I am using Display Texts and Log Statements.
I will upload the project later when I'm back.
Ok, here it is. Click on the actor that says Spawn on the top right to spawn instances of the falling actor.
The instances are set, so that they will destroy themselves when they collide with another actor of type Instance. Upon spawning/destroying each instance writes "I am a spawned/destroyed prototype/instance" to the debugger.
In my debugger, the output will alternate between "I am a spawned/destroyed prototype" and "I am a spawned/destroyed instance", which as you (tatiang) say, should not be the case.
Another way to tell that GameSalad respawns my instances is the fact, that the font size of the display texts in the falling actors keeps changing. I set the font size of the prototype to 10 and that of the instance to 30.
One more thing that doesn't seem right is the fact, that when I create a new variable in the prototype, it will automatically also create that variable in the instance, even if the instance is unlocked and shouldn't reflect any changes in the prototype. I can't remove the variable from the instance, since it is greyed out in the actor tab.
In my example if you look at the actor tab of the prototype and then into that of the instance, you will find that the variable testInt=10 in the protype and testInt=0 in the instance, and yet displays as 10 in both the prototype and the instance once the game is started.
I am very confused and would appreciate some input from other people.
Thanks
Vin
Out of curiosity, are you using Mac Creator or PC Creator? And are you using the stable/standard version or the release candidate?
Yep, something's corrupt. I can't explain why that's happening. Even creating a new blank scene with those actors causes the problem to happen. You may want to submit a support ticket at http://support.gamesalad.com/support.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Oh boy, this is starting to get tedious. Thanks a lot for taking the time to look into this!
I am using the Windows Creator with the stable version (as far as I know Version: 10.4.1)
Just saw there's a version 10.5, I'll try that and see what happens.
Thanks again.
I wasn't sure because it looked like a PC project file but you posted in the Mac subforum. I'll move this thread for you.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User