Extra2, how I loathe thee
Today's question/rant is brought to you by the letters 'E', 'x', 't', 'r' and 'a' and by the number 2.
Before I get into the main rant, does anyone know whether it is possible to combine extra2 values 1-5 (indicating colour weakness) with extra flags 1000-1200? (One would naively assume... well, (sigh) one could very naively assume a lot about this game, but we won't go there )
...Anyway... I am naively hoping it is a bit field, but assuming it probably isn't. After all, if it were even a measily 16 bit number, you have easily got room for the 200 extra2 flags (8bits worth with 56 values wasted). Then, even using individual bits for each of the 5 weapons (which would be much better way than the current system as you could then say exactly which colours do hurt the sprite), you still have 3 bits left we could use for my request for a solution to the below problem.
So - the problem:
I have some sprites and they are not solid I want them to disappear when somebody flicks a switch (or blows something up, if that has to be done, I don't care too much, but would rather it was a switch). Unfortunately, they don't because (as the manual clearly states), sprites with a solid state of 0 or 1 don't get removed when you trigger an extra2 link - instead they get made black (woo-hoo, they already are) and have their script removed (woo-hoo again, they already have no script).
I figured I could work round this by using solid type '2' which is still effectively not-solid for what I care about in this instance. The manual doesn't actually document what happens to those sprites when they have their extra2 links triggered.
The answer (as I'm sure you're all dying to hear) was rather unexpected. If you trigger by blowing something up, solid-type 2 behaves like 0 and 1 - i.e. turns black. Nothing fancy, but disappointing as I wanted it to behave like 3/4.
If triggered by a switch on the other hand, the entire level turns black, and everything on it becomes not-solid. I seem to remember reading about this somewhere else, though I forget whether it was someone trying to work out how it happened or had found out why. Ah well, if the former, here's why.
(Edit - misdiagnosis - I think I must have fallen into the "switch called 'Sprite' trap" whilst testing - it appears now that switch extra2 links don't do anything at all to any solid-type sprites as had previously been mentioned)
Does anyone know of a way to fake up what I want to happen? The only way I can think of to make it work is to have all the non-solid sprites by children of another 'enemy' sprite which itself has an extra2 link to something further away I can blow up. It works in theory too - but unfortunately, the area of the child sprites is too large, so they get culled when the parent goes off-screen
If not (question to the beta testers out there) - is there any reason why the game can't change extra2 links to player type objects to remove as if they were enemy/solid?
Or better (but more work) would be to add (shock, horror) another flag which if present, overrides the default behaviour concerning what happens to a sprite after its extra2 link is activated. Overriding is obviously important so that it doesn't break anything in existing maps. Again, see suggestion with extra2 above.
If you're still reading, thanks for putting up with my ranting
(edited for typos)
This post has been edited by Crono : 24 February 2007 - 12:25 PM