Duplicating Enemies

For questions about using Classic.

Post » Wed Oct 03, 2012 11:41 am

So I have this little critter:



And I have this event list for his movement/attacks:



Which works fine when there's just one spider in the game. But as soon as I insert a second one, they just mimic each other. So when one is attacking, the other is attacking too even if he isn't in range. Slapping a "For each Spider" command in front of the events doesn't help

Is this a bad way to create events for enemies? Am I supposed to create a different sprite set and event list for each one, naming them Spider1, Spider2, Spider3 etc? That could work, but the VRAM overhead would be pretty huge, especially for my Stag enemies which have a lot of animation frames.

Thanks for reading
B
15
S
7
G
7
Posts: 255
Reputation: 5,313

Post » Wed Oct 03, 2012 3:23 pm

Else was always buggy in Cc. I would guess that's what the issue is.
Edit:
Just noticed the call for the family. Might be an issue as well.newt2012-10-03 15:26:09
Image Image
B
164
S
49
G
125
Posts: 7,800
Reputation: 85,054

Post » Wed Oct 03, 2012 4:59 pm

I like your spider sprite.

I probably can't help because it makes sense to me what you've done! Do you think perhaps you have to give each spider some sort of unique identifier, like maybe set a private variable for the one that triggers the animation?

It seems like as soon as one spider triggers that attack animation maybe it triggers it for all of them. The fact that the "For Each" event doesn't seem to help also kind of supports that.
B
7
S
2
Posts: 123
Reputation: 1,061

Post » Wed Oct 03, 2012 7:15 pm

I'd try adding a "for each" condition to the end of event 220. If that doesn't work it's likely the else's that are causing all of them to be picked. In this case you can easily fix it by removing the elses and putting the inverted conditions of events 221 and 222 into event 223.
B
85
S
27
G
78
Posts: 5,013
Reputation: 54,260

Post » Thu Oct 04, 2012 4:04 am

[QUOTE=newt] Else was always buggy in Cc. I would guess that's what the issue is.[/QUOTE]

Was that a pun?
B
36
S
10
G
6
Posts: 960
Reputation: 11,125

Post » Thu Oct 04, 2012 9:01 am

[QUOTE=newt] Else was always buggy in Cc. I would guess that's what the issue is.[/QUOTE] "Else" never was buggy in CC! It just doesn't work with human logic but computer logic. The greatest difference in that logic is that "else" doesn't pick. Which causes most of the problems CC developers have using "else".
Image
B
24
S
8
G
10
Posts: 1,821
Reputation: 8,279

Post » Thu Oct 04, 2012 9:42 am

I love you guys. Rojo nailed it: "you can easily fix it by removing the elses and putting the inverted conditions of events 221 and 222 into event 223."

Thanks for all the replies, and thanks for the explanation behind the Else command Tulamide
B
15
S
7
G
7
Posts: 255
Reputation: 5,313


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 2 guests