Bug: Removing Behavior from Objects in a family

For questions about using Classic.

Post » Sun Nov 29, 2009 1:52 pm

I am saddened to say that it seems that my project just died :(
I had a family called "Ships". That family contained two sprites: "Fighter" and "Bomber".
Both sprites were also part of the family "Selectable Objects".
During the development process, I experimented with behaviors a little bit to see what could be achieved, so both sprites had the "RTS", "Turret" and "Line of Sight" behaviors.
When I selected my Fighter-Sprite and removed the "Turret" and "LOS" behaviors, because I didn't need them anymore, my project wouldn't run anymore.
When trying to preview it, it would tell me: "Behavior name: 'Turret' not found".

Now, I know that some might think that the problem lies in my event sheets buried somewhere, but my code is very well organized. Everything is stored and ordered into certain groups. Even deactivating all groups but "Setup", where he sets the screen resolution, would give me that error.
I tried moving families around, I tried adding the behaviors again (when adding just "Turret" but not "LOS", it would tell me he couldn't find the behavior "RTS", which is CLEARLY a bug, so I had to re-add "LOS" too).
When "Turret" and "LOS" were added again, my project would run, but all private variables for the families affected were "Read Only", meaning I could read them out in my debug console, but couldn't change them anymore, even though I checked during runtime that the correct events were triggered. This means for example:

Pick all Ships where 'status' = "Idle"
Set Ships('status') = "Roaming"
Debug.Text = Debug & "Status should have been set here"

And yes, I got the text on my debug console. However, the ships were still set to idle.
I guess there is no hope but to start from scratch now? :(
Posts: 14
Reputation: 1,053

Post » Sun Nov 29, 2009 3:54 pm

Can you reproduce it in a new .cap and post a bug to the tracker?
Scirra Founder
Posts: 24,118
Reputation: 190,444

Post » Sun Nov 29, 2009 4:51 pm

I tried to reproduce it in a fresh project, but it doesn't give me the same problems. However, there is either something wrong, or I just don't know how to work this.
What I did is this:

I created two sprites - a red ball and a blue one. Red one is called "Fighter", blue one is "Bomber".
I added them to the families "Ships" and "Selectables".
I added RTS, LOS and Turret behaviour. I opened the event editor and added these events:

Ships[LOS] -> On Object in LOS (Selectables)
Ships[Turret] -> Acquire Target

Ships[Turret] -> has target
Start Flashing

Ships[RTS] -> not moving
Ships[RTS] -> Move to Position (Random(DisplayWidth), Random(DisplayHeight)

That worked as intended.
When I removed LOS and Turret behavior from the fighter, they automatically got removed from the families, which is as it should be.
However, the last event stopped working - it's still there and it hasn't changed at all, but both sprites don't move as they did before.
I re-added the events for the turret and for LOS, but instead of "Ships" I just used "Bomber", as it still has those behaviors. Nothing. Complete standstill.
Maybe I am doing something wrong, maybe I'm just tired, I don't know.
Anyway, here it is.


Should I still submit it?
Posts: 14
Reputation: 1,053

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests