Skip to content

Local tokens, please

chimericchimeric Member Posts: 1,163
edited June 2017 in Feature Requests
Tokens could be very useful, even though they don't get saved. But they are game-wide: if you set < ONE_THING> to something, then everybody with, say, a name using < ONE_THING> is going to be named that way, and should you change the value of the token, they will all get renamed. This is useful sometimes, but at other times you just want to alter the name of *this* creature to some placeholder - and how? You can't possibly create a token for every creature, if this is some kind of broad operation, and you wouldn't necessarily know which token would be be used by whom. Then you'd dearly like some way to either restrict SetToken and SetTokenObject to just one creature so it would be using an instance of that token, so to speak, or for the token not to apply retroactively - so everybody already renamed could get to keep their names.

Actual example: I'm in need of renaming all creatures after they get brought back from the grave with my Animate Dead spell. I would like them to have the "Death" prefix before their names, so - Death Worg, Death Tasloi, Death Amnian Soldier and so on. The natural reaction is to want to use a token for that: create a custom string that says "Death < MONSTER>", and then let each creature fit that token to itself with SetTokenObject("MONSTER",Myself). Another, reverse way to do it would be to quote a creature's name somehow in a string with "Death < MONSTER>". But neither works, because < MONSTER> has a game-wide value. You set it to the name of one creature, the names of everyone else get converted to that new name, retroactively.

Not good!

Comments

  • DeeDee Member Posts: 10,447
    edited June 2017
    What about “(DEATH)Monster”? Might be more work on the front end, but then you can display “Death “ or not depending on the creature’s status.
  • chimericchimeric Member Posts: 1,163
    I would need a tlk entry for each monster still. I'd have to give the creature a strref for SetName(), and what would it be? It can't be called "monster," so it would have to be "Ogre," "Tasloi" etc. Even with the second token would also apply the current value game-wide.

    And while I'm at it, I might as well complain that the engine doesn't let me do hardly anything with strings. Seriously, is this so insurmountable? Two things in particular would be, eh, game-changers: storing strings in global variables (and not just integers) and combining strings - to form phrases. Tokens can be used to sort of do the latter, but the problems are all too obvious.
Sign In or Register to comment.