Do SetToken() and SetTokenObject() work at all?
chimeric
Member Posts: 1,163
Do they?
0
Comments
SetToken may have better been named *replace token* while SetTokenObject does what it says.
Beamdog, how about a permanent CopyName() action? Would really go for a lot of things.
But I've been able to permanently copy a creature's name with SetTokenObject + SetName. My idea was that tokens aren't permanent, so there are going to be blanks and gaps. But recorded names of creatures should stay, if they were copied from another creature whose name is a fixed strref rather than something you insert on the fly and that will be empty on the next reload. Pull someone's name into the token, then set the name of the second one to read from the token, and after a reload there'll be no reason for that change to be unmade. I made two override scripts to put on creatures, identical, really, but they work in some very confusing way. I can't easily wrap my head around tokens, I'll be honest. I perceive them differently and I'm too tired right now. I'm going to publish the scripts and let anyone guess why they work as they do. I can't even understand what's affecting what here.
Script 1:
IF True() THEN RESPONSE #100 SetTokenObject("CRENAME",Nearest([0.0.OGRE])) SetName(34854) // <CRENAME> Wait(1) ChangeAIScript("",OVERRIDE) END
Script 2:
IF True() THEN RESPONSE #100 SetTokenObject("CRENAME",Nearest([PC])) SetName(34854) // <CRENAME> Wait(1) ChangeAIScript("",OVERRIDE) END
Again, I'm not in the right state of mind to figure this out, but one of the creatures, depending on how you put on these scripts, cross-wise and what-have-you, takes on the name of the other. And the name remains in the saved game. Whoever wants the honor of discovering just this works - because this could go a long way, e.g. if you want to summon invisible minions with the name of the summoner, for spells, cutscenes and such - should create some item with charges (I made a ring), charge two powers with effect 82 in them with these scripts, type in an ogre and try them every which way.