Problems with color-changeable objects

Status
Not open for further replies.

742mph

My work is never done yet
For some reason, objects with MF_TRANSLATION, the flag that makes objects color-changeable, refuse to activate A_ChangeColorAbsolute or any other color-changing actions upon entering their SpawnState as they first appear. Is there any way to define the object's color via flags or something else that tells the object what color to appear as upon spawning?
 
For some reason, objects with MF_TRANSLATION, the flag that makes objects color-changeable, refuse to activate A_ChangeColorAbsolute or any other color-changing actions upon entering their SpawnState as they first appear. Is there any way to define the object's color via flags or something else that tells the object what color to appear as upon spawning?
You misunderstood me on IRC; MF_TRANSLATION is not what "allows" something to use A_ChangeColorAbsolute; anything can use it. MF_TRANSLATION was formerly the means by which objects stored what color they currently had, and in previous versions of SRB2(2.0.4 and earlier) could be used to define the color an object spawned as via the infotable. Due to changes in how color is handled, this is no longer possible in 2.0.6

As for performing the action on spawn, the object needs to have MF_RunSpawnFunc added to the flags value(2147483648) in order to perform this, or any other action when spawned.

Additionally, it should be noted that the conventional wisdom is that actions cannot be performed at map load even with MF_RunSpawnFunc, but I've become aware of what may be some exceptions to that rule, which could include A_ChangeColorAbsolute. However, the conditions under which this is possible are not yet clear, and I still need to do more testing on the matter, though you could give running A_ChangeColorAbsolute at spawn another shot if you think it might work here.

Failing that however, your best bet is to use a helper object to make your object call A_ChangeColorAbsolute after map load via A_RemoteAction(because a boss must remain in its spawn state to run its thinker, and return to it to stop flashing), and to manually recolor one of the boss's sprites so that it will appear correct for the short period before it has changed color.
 
I did some testing before I saw your answer, found MF_RunSpawnFunc on the list of object flags, added it to the boss's flags, and it worked. The boss did turn its correct color immediately upon spawning, without a helper object. A_ChangeColorAbsolute seems to be one of the actions that can be performed at map load. Thanks for the help, anyways.
 
Status
Not open for further replies.

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top