argent77 Posted January 27, 2022 Share Posted January 27, 2022 SetToken() makes only sense for static strings. For your use case SetTokenGlobal() is probably the better choice. It assigns the value of a variable to the token and frees you of the hassle of defining and assigning lots of custom strrefs. This is an example script how to determine the STR value of a creature. It requires two script passes before the token is successfully set: // Called by the second script pass to set the token IF Global("D5STRSET","GLOBAL",1) THEN RESPONSE #100 SetGlobal("D5STRSET","GLOBAL",2) SetTokenGlobal("D5STRVALUE","GLOBAL","d5_cur_str") Continue() END // Called by the first script pass IF Global("D5STRSET","GLOBAL",0) CheckStat(LastSummonerOf(Myself),1,STR) THEN RESPONSE #100 SetGlobal("D5STRVALUE","GLOBAL",1) Continue() END IF Global("D5STRSET","GLOBAL",0) CheckStat(LastSummonerOf(Myself),2,STR) THEN RESPONSE #100 SetGlobal("D5STRVALUE","GLOBAL",2) Continue() END // ... repeat for STR 3..25 // Finalize the first script pass IF Global("D5STRSET","GLOBAL",0) THEN RESPONSE #100 SetGlobal("D5STRSET","GLOBAL",1) Continue() END Afterwards (when variable D5STRSET is set to 2) you can start the dialog with the token set to the right value. Quote Link to comment
subtledoctor Posted January 27, 2022 Author Share Posted January 27, 2022 Thanks that has helped a lot! Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.