Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

NodeBB

  1. Home
  2. Archives
  3. Immortal Archive
  4. Requests
  5. Token Discussion

Token Discussion

Scheduled Pinned Locked Moved Requests
17 Posts 5 Posters 95 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • NibelungN Offline
    NibelungN Offline
    Nibelung
    registered
    wrote on last edited by
    #8

    Could you add an optional number argument to the set, settimer and adjust commands?

    Example:

    token set $n 12345 0 100 200

    The effect would be to set value 0 with a random number from 100 to 200



    Also, do the same for tokenvalue:

    if tokenvalue $n 12345 0 > 100 200

    The extra number would make it do a random number from 100 to 200. A better example would be:

    if tokenvalue $n 12345 0 > 0 99

    That would be something akin to a skills test. :D

    1 Reply Last reply
    0
    • TieryoT Offline
      TieryoT Offline
      Tieryo
      wrote on last edited by
      #9
      tgive/tjunk <character></character> 
      

      Gives (or junks) the specified token vnum.

      tadjust <character> <vnum> <value# or="" timer=""> <operator> <value></value></operator></value#></vnum></character>
      

      Adjusts the specified value or timer of a given token. Arguments are the same as 'token adjust' in the token documentation.

      Both of these would be good for testing purposes.

      The pig go.

      1 Reply Last reply
      0
      • SynS Offline
        SynS Offline
        Syn
        retired
        wrote on last edited by
        #10

        Note to self: implement a "score quests" display page where it shows all of your quest tokens, possibly with a description.

        Perhaps also add skill tokens to display in "skills", although this might have to wait a little while.

        1 Reply Last reply
        0
        • NibelungN Offline
          NibelungN Offline
          Nibelung
          registered
          wrote on last edited by
          #11

          Omni-delays w/ TIMERS (translation: OMG!DELAYS!!1!1!!!eleventy-one!)

          Have a minimum delay such that the token doesn't accidentally expire (unless something horrible goes wrong such as the holder of the token can't check it), like 2. When the timer value is 2 or less, RESET the timer to whatever value you wish.

          If you want to delay for about 20 ticks (as it will be either 19 or 20, depending on WHEN you set it) and wish to check it at three points, set the timer to 20 + 3 + 2, or 25. When the timer hits the appropriate TIMER values, adjust it by subtracting 1. When it hits 2, you can either zero it or reset it to whatever.

          The general formula for this is TICKS + STEPS + MINTICK, where TICKS is your total duration, STEPS is the number of steps you wish to check, and MINTICK is the minimum timer value. Keep in mind that the MINTICK value can serve as a step if desired.

          The values can be used as flags/states/indicators/parameters/whatever in the scripts for refining what to check, when to check and what to do when it checks.

          This all hinges on the ability to check the TIMER value on a token.

          [area=Setup:]if hastoken $i 12345

          else

          token give $i 12345

          endif

          token adjust $i 12345 timer = 45

          say Ok! Timer is now 45![/area]

          [area=100% Random:]if tokenvalue $i 12345 timer > 0

          if tokenvalue $i 12345 timer <= 2

          token adjust $i 12345 timer = 0

          mob echo Done!

          break

          endif

          if tokenvalue $i 12345 timer == 13

          token adjust $i 12345 timer - 1

          mob echo Stage 3! Timer is now 12!

          break

          endif

          if tokenvalue $i 12345 timer == 24

          token adjust $i 12345 timer - 1

          mob echo Stage 2! Timer is now 23!

          break

          endif

          if tokenvalue $i 12345 timer == 35

          token adjust $i 12345 timer - 1

          mob echo Stage 1! Timer is now 34!

          break

          endif

          endif[/area]

          1 Reply Last reply
          0
          • NibelungN Offline
            NibelungN Offline
            Nibelung
            registered
            wrote on last edited by
            #12

            post….

            Here's how to do a delay-wait type system, which PAUSES the timer so that it has to be reset once the desired action has been completed.

            [area=Setup:]if tokenvalue $i 12345 2 > 0

            break

            endif

            if hastoken $i 12345

            else

            token give $i 12345

            endif

            token adjust $i 12345 timer = 12 <- really ~ 10 ticks total, 5 ticks to the pause

            token adjust $i 12345 0 = 0

            token adjust $i 12345 1 = 0

            token adjust $i 12345 2 = 3 <– set what the heck you're doing this for!

            say Ok! Timer is now 45![/area]

            [area=100% Random:]if tokenvalue $i 12345 timer == 0

            break

            endif

            if tokenvalue $i 12345 timer <= 2

            token adjust $i 12345 timer = 0

            mob echo Done!

            break

            endif

            if tokenvalue $i 12345 timer == 7

            token adjust $i 12345 0 = 1

            token adjust $i 12345 1 = $[[tokenvalue $i 12345 timer]]

            token adjust $i 12345 timer = 0

            mob echo Enable! Timer is now 7!

            endif[/area]

            [area=Some other script:]if hastoken $i 12345

            and tokenvalue $i 12345 0 == 1 <– this is waiting to do it

            and tokenvalue $i 12345 2 == 3 <– Match to what you're setting it for!

            token adjust $i 12345 timer = $[[tokenvalue $i 12345 1]]

            token adjust $i 12345 0 = 0

            token adjust $i 12345 1 = 0

            token adjust $i 12345 2 = 0 <– you're done, so clear that out

            mob echo I did it!!! <– or something useful!

            endif[/area]

            1 Reply Last reply
            0
            • NibelungN Offline
              NibelungN Offline
              Nibelung
              registered
              wrote on last edited by
              #13

              New Token Type: global

              Global? What is Global?! It means that it is a global token. Only ONE copy of it will ever exist. But, what about referencing it? Simple, reference it as you would any other token. The key would be in the code: if the token type is global, it will use the global copy. (When referenced the FIRST time, the token is created.) This type of token would not exist on anything, so whenever tokens get any scripts on them, this type of token would have a LIMITED command set as well as triggers that would fire it. Why? These would have no environment, so they cannot do anything that would mess with realm itself (no loading, no goto, not even targeting anything!). Also, all global tokens are saved and reloaded the next boot, creating a persistant state mechanism.

              So how do I use the Global Token?

              if tokenvalue $* <vnum><value><op><min>[ <max>] (you can do that... the target is irrevelant)
              
              token adjust $* <vnum><value><op><min>[ <max>] (same as the ifcheck)
              
              token junk?  (nope, can't do that)
              
              token give? (give what? it's global!)
              
              if hastoken $* <vnum>(that makes no sense, always false for these tokens)</vnum></max></min></op></value></vnum></max></min></op></value></vnum> 
              


              So what all can you do with them?
              <list type="decimal">4. Create interscript (even interTYPE) communication.

              1. As mentioned, save a state across boots.

              2. ???

              3. PROFIT!!!</list>



              In short, you can use this, coupled with various other scripting additions, to create persistant scenarios.

              What this can't do:
              <list>* Store information on any given entities. That's what having saving features on THOSE are for, such as tokens on players saving to their pfiles.

              • Do scripts on a global scale. Well, maybe if the commands are done to account for them. But for the most part, these tokens would not be associated with any environment, hence them being GLOBAL.</list>
              1 Reply Last reply
              0
              • NibelungN Offline
                NibelungN Offline
                Nibelung
                registered
                wrote on last edited by
                #14

                token save <global token="" vnum="">This command is used to save a GLOBAL token… and ONLY global tokens. Since it takes no target entity, this can only reference a global token. This is used to ensure the token's values are saved.</global>

                1 Reply Last reply
                0
                • NibelungN Offline
                  NibelungN Offline
                  Nibelung
                  registered
                  wrote on last edited by
                  #15

                  token find <target><vnum>[ <count>[ <timer>[ <v0>[ <v1>[ <v2>[<v3>]]]]]]

                  This will find a token on the target that matches the vnum and specifications. Negative values for the timer or any of the values will omit that field. The count is used to iterate through copies of the same token. The code $@ is set by this command. If the token was not found, any checks or commands done on this code are false/ignored. This command is used when multiple copies of the same vnum are able to be on the same target, thus having a command to find a particular one is needed.

                  When using the $@ code, the syntax of the commands/ifchecks would shorten. Instead of having <target><vnum>to get the token, one can just use $@ instead. For the hastoken ifcheck, this will check to see if the $@ is valid or not. The vnum argument would be ignored, thus can be omitted.



                  **Example - From the scenario I have for my attuning mechanism for a weapon. ***

                  Though mostly unrelated to the idea of this POST, it does utilize (and can be more) tokens in a significant way.



                  notation submitted by Areo. Tokens on objects as well as mobiles are needed for this example to work as well. The global token used will be saved where needed.

                  The definitions for tokens needed in the example. The global token is 12345 while the attuning token is 12346 for the sake of this example.

                  tedit create 12345
                  name global_attuning_counter
                  type global
                  valuename 0 ID1
                  value 0 0
                  valuename 1 ID2
                  value 1 0
                  
                  
                  tedit create 12346
                  name attuning_status
                  type general
                  valuename 0 ID1
                  value 0 0
                  valuename 1 ID2
                  value 1 0
                  valuename 2 ATTUNE
                  value 2 0
                  valuename 3 LOCKED
                  value 3 0
                  
                  

                  <list>* ID1-ID2 - Used as the ID counter. Each half can range from 0 to 999999999, creating a rather LARGE range.

                  • ATTUNE - The amount of attuning the particular token has. If the amount is 0, the ID can be changed when needed, this allows an object that hasn't been attuned or has been dominated to REMOVE the prior attuning to SWITCH owners. This is only used by the OBJECT.

                  • LOCKED - Indicates whether the attuning as reached a critical value and cannot switch owners under normal situations. (Optional)</list>

                  The following script is used to generate the ID for the weapon.

                  This works under the assumption that the weapon can be attuned more than once.

                  if tokenvalue $i 12346 2 == 0
                  token adjust $i 12345 0 + 1
                  if tokenvalue $i 12345 0 >= 1000000000
                  token adjust $i 12345 0 = 0
                  token adjust $i 12345 1 + 1
                  endif
                  token save 12345
                  token adjust $i 12346 0 = $[[tokenvalue $i 12345 0]]
                  token adjust $i 12346 1 = $[[tokenvalue $i 12345 1]]
                  token adjust $i 12346 2 = 1
                  endif
                  
                  

                  This script, unlike the previous one, allows ID setting UNTIL it has been LOCKED.

                  if tokenvalue $i 12346 2 == 0
                  and tokenvalue $i 12346 3 == 0
                  token adjust $i 12345 0 + 1
                  if tokenvalue $i 12345 0 >= 1000000000
                  token adjust $i 12345 0 = 0
                  token adjust $i 12345 1 + 1
                  endif
                  token adjust $i 12346 0 = $[[tokenvalue $i 12345 0]]
                  token adjust $i 12346 1 = $[[tokenvalue $i 12345 1]]
                  token adjust $i 12346 2 = 1
                  endif
                  
                  

                  The following FIGHT script assumes the wielder is $t (see the topic about the Object FIGHT trigger) and the weapon has the token needed.

                  token find $t 12346 1 -1 $[[tokenvalue $i 12346 0]] $[[tokenvalue $i 12346 1]]
                  if hastoken $@
                  obj echo Do some stuff...
                  if tokenvalue $i 12346 2 < 1 1000
                  token adjust $i 12346 2 + 1 3
                  if tokenvalue $i 12346 2 > 1000
                  token adjust $i 12346 2 = 1000
                  endif
                  if tokenvalue $i 12346 3 == 0
                  and tokenvalue $i 12346 2 > 750 1000
                  token adjust $i 12346 3 = 1
                  endif
                  endif
                  else
                  if tokenvalue $i 12346 3 == 0
                  if tokenvalue $i 12346 2 == 0
                  obj call SET_ID $t
                  else
                  if tokenvalue $i 12346 2 <= 1 1000
                  and rand 25
                  token adjust $i 12346 2 - 1 
                  endif
                  endif
                  endif
                  endif
                  
                  

                  Explanation: (by line)
                  <list type="decimal">4. This uses the token find to search the wielder's token list for first (or any) token that has the given value 0 and value 1 parameters. In this case, it checks to see that the values match the OBJECT's token values (thus forming the link).

                  1. Checks to see if the particular token has been found

                  2. Whatever you wish to do with the object if they are the correct wielder.

                  3. Performs a random number check against the attuning level to see if it can increase.

                  4. Adds to the attuning level slowly (can be adjusted to suit your situation).

                  5. Puts a cap on the attuning level (so it doesn't exceed the limit).

                  6. Is the attuning still UNLOCKED?

                  7. And does it pass a random number check (the range can be adjusted)

                  8. Marks the attuning as being LOCKED.

                  9. End of script for this branch.

                  10. Start of the block where the wielder is not a match (from line 2)

                  11. Is the attuning still UNLOCKED?

                  12. Is the attuning level zero (free to have the ID set)

                  13. Call the script to set the ID (Goes to the end)

                  14. Nope, it's not zero (must be attuned to someone else already)

                  15. Performs a random number check against the attuning level to see if it can be diminished.

                  16. Add some more randomness to it

                  17. Decrease the attuning level (will never get below 0 this way)

                  18. End of script for this branch.</list>

                  If this is confusing, ask me for clarification!


                  __Attuning is the process by which an object aligns itself to a particular owner, whereby further powers can be uncovered/unlocked and unleashed. If the process gets far enough along, the object might lock to that owner permanently (or at least not without having significant actions to undo it).

                  Attuning doesn't have to be complete positive in nature. In fact, you can have a weapon that does ungodly things the more you wield it, but at the price of having it SUCK your lifeforce from you, maybe even KILL you.

                  Another sinister action could be to have a preremove trigger on the object that checks the attuning level and if it's high enough, they can't remove it! :D They wore it too long! >.>__</vnum></target></v3></v2></v1></v0></timer></count></vnum></target>

                  1 Reply Last reply
                  0
                  • P Offline
                    P Offline
                    pollution
                    retired
                    wrote on last edited by
                    #16

                    It would be handy if the timer value could be set in the same way as hit/mana dice are, have it accept dice values to introduce easy duration variation if desired.

                    ->timer 1 d 10 + 0

                    1 - 10 ticks

                    ->timer 1 d 1 + 9

                    Exactly 10 ticks.

                    1 Reply Last reply
                    0
                    • SynS Offline
                      SynS Offline
                      Syn
                      retired
                      wrote on last edited by
                      #17

                      <quote author="Pollution">@Pollution:

                      It would be handy if the timer value could be set in the same way as hit/mana dice are, have it accept dice values to introduce easy duration variation if desired.

                      ->timer 1 d 10 + 0

                      1 - 10 ticks

                      ->timer 1 d 1 + 9

                      Exactly 10 ticks.</quote>

                      This should be fairly easy. I will implement it when I get a chance.

                      1 Reply Last reply
                      0

                      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                      With your input, this post could be even better 💗

                      Register Login
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      Powered by NodeBB | Contributors
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups