Can I use "this" in the text processor

Been playing around with some clones today and came across an oddity, or at least something i've not stumbled on before, using a shrink ray that sets a flag "shrunk"

Now since I have it set up that each clone could be a different species/age/wearing separate clothing, ectera) I'd like to have it done simply that when shot by the ray gun they description would change just a bit rather than worrying about rewriting it for every disposable npcs, so i tried out this code.

{if this.shrunk:But is now a very small one}

added to the clone prototype description but doesn't seem to register.. I thought that "This" was the code to reference for the object with whatever code was to execute on.

(Another aside, looking for an old post about cloning where you could set quest to pick a random choice once and keep it for the whole game, [red|blue|green] whatever, it works fine in the text processor but when i put it within a script as a msg it fails)


K.V.

Yes, but you have to add this bit just before it in the same script:

game.text_processor_this = this
msg("{if this.shrunk:But is now a very small one}")

image


Still think that seems a little awkward.

Would it be sane for some scripts (like the default look/get/etc commands) to set text_processor_this to the object being looked at, got, etc before displaying a message? Then you could use this in text processor commands in a description or look message, without having to make a script every time.

Though looking at how "this" is implemented in the text processor, that could lead to some very awkward bugs.


This topic is now closed. Topics are closed after 60 days of inactivity.

Support

Forums