ID:2084385
 
Applies to:Dream Maker
Status: Open

Issue hasn't been assigned a status value.
Text macros like \his currently throw a compile time error if there isn't a valid object in the string. Would it be possible to make this a runtime error?

The situation I found this in was whilst creating a datum based emote system. Each mob has a emotehandler datum which gives access to the emote datums that can be performed by that mob type. There is only one of each emote datum in existence, held in a global list. The emote handler passes in the mob that is using it.

The issue arose with the line mimeText = "clutches at \his throat desperately" - mimeText is an object variable of the emote datum, and is always user in the context of message = "[user] [mimeText]", so by the time it is used the \his always has a valid object to work with, but as things stand this will not compile, giving the error macro \his requires preceeding expression (btw, preceding shouldn't have that double e)

I can work around it, but it would be far nicer to have the error come up as a runtime and the compiler trust me to put a valid expression in
Bay (SS13) worked around this by having "gender datums";
// Standard BYOND way:
var/msg = "clutches at \his throat." // nope

// Working BYOND way:
var/msg = "[usr] clutches at \his throat." // annoying due to needing to put the mob in the message for \his to work

// Gender datums:
var/datum/gender/G = gender_datums[usr.gender]
var/msg = "clutches at [G.his] throat."