Multi Timers

Discussion in 'JS Plugin Releases (RMMV)' started by Shaz, Nov 14, 2015.

  1. mads_in_zero

    mads_in_zero Villager Member

    Messages:
    9
    Likes Received:
    1
    First Language:
    English
    Primarily Uses:
    RMMV
    Ahh, okay! Thanks for the suggestions.

    However, even when I enter:

    Code:
    AddTimer SongLogic 12.409 \sets(1, true)
    (12.409 being the length of the first chunk), even with the change to the plugin file itself, fractions of a second don't seem to work, and the switch doesn't trigger.
     
    #81
  2. bazrat

    bazrat Veteran Veteran

    Messages:
    201
    Likes Received:
    127
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    Has anyone ever got yep_self-switch/var plugin to be able to use with the timer?

    Whenever I try the plugin command inside the event that the yep-self switch is being used it only turns off the actual switch (which is already off cause its being used as a self switch).

    It works on the normal self switches A-D so i have the right command. Just wondering if anyone has got this way to work?
     
    #82
  3. Shaz

    Shaz Veteran Veteran

    Messages:
    37,549
    Likes Received:
    11,258
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Please show the command you're using which works successfully, and the one which doesn't. Also a link to Yanfly's plugin to save us the trouble of searching for it.
     
    #83
  4. bazrat

    bazrat Veteran Veteran

    Messages:
    201
    Likes Received:
    127
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    Thanks for the reply Shaz.

    Here is the link to yep self switches/variables: http://yanfly.moe/2016/08/06/yep-113-self-switches-variables-rpg-maker-mv/

    Here is the command that works, by using a default self switch B:
    Code:
    addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'B'], true)
    Here is the command that doesn't work, trying to use yeps self switch which is switch 62 and labeled Self Switch 1:
    Code:
    addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'Self Switch 1'], true)
    I have also tried running it as a normal switch command, hoping it might recognized the ss version of switch 62:
    Code:
    addTimer yepss1 3 \sets(62, true)
    But it didn't, it just turns on the actual (global) switch. Just was trying all possibilities.

    Why can't I just use self switch A-D? That is a good question lol, we run ABS in our project and A+B self switches are taken up by event sensor plugins and the remaining for the ABS hit types. Your plugin works wonders with the way our enemies are programmed, but with the limitation to only the default A-D selfswitches its led me here to ask if it's possible to have yep SS be recognized.
     
    Last edited: May 24, 2019
    #84
  5. Shaz

    Shaz Veteran Veteran

    Messages:
    37,549
    Likes Received:
    11,258
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Yanfly's plugin uses the switch number, not the name/label (the label is just an easy way for you to indicate which ones are self switches, but that's the only thing they're used for). If you turn on switch 62, it will update the self switch [mapid, eventid, 'SELF SWITCH 62']

    Try this:
    Code:
    addTimer <thismap>.<thisevent>.yepss1 3 \setss([<thismap>, <thisevent>, 'SELF SWITCH 62'], true)
     
    #85
    Nilom and bazrat like this.
  6. bazrat

    bazrat Veteran Veteran

    Messages:
    201
    Likes Received:
    127
    Location:
    Washington State
    First Language:
    English
    Primarily Uses:
    RMMV
    Wow, it worked! Thank you!

    Edit: Ultra thanks to you @Shaz as this wording of the self switch also works with our ABS triggers xD 2 birds with 1 stone!
     
    Last edited: May 25, 2019
    #86
  7. Nilom

    Nilom Veteran Veteran

    Messages:
    178
    Likes Received:
    39
    First Language:
    German
    Primarily Uses:
    RMMV
    @Shaz

    Dear Shaz. Could you tell me how I can manipulate Self Variables from Yanfly's Self Switches and Variables?
    I see that you knew a solution for bazrat a month ago, regarding to self switches.

    The self variable is called "Self Var nodes setup" and I would like to set it to 0 after 30 minutes.

    Thank you in advance! :LZSsmile:
     
    #87
  8. Shaz

    Shaz Veteran Veteran

    Messages:
    37,549
    Likes Received:
    11,258
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    @Nilom as I mentioned above, the variable name has no meaning. It's the variable number that's important. What is your variable number?

    Fortunately Yanfly saves the self variables in the self switches object, not a new object, so you can use \setss to set a self variable (but not a regular variable).

    If you use variable # 65 for Self Var nodes setup, you could try this in a plugin command:

    AddTimer <thismap>.<thisevent>.SelfVar65 1800 \setss([<thismap>, <thisevent>, 'SELF VARIABLE 65'], 0)

    or this:

    AddTimer <thismap>.<thisevent>.NodesSetup 1800 \setss([<thismap>, <thisevent>, 'SELF VARIABLE 65'], 0)

    if you wanted something a little more recognizable.

    I suggest you try a much, much smaller number (like 10, or 30) for the timer, rather than 1800 - it'd be a shame to wait half an hour to find out the command isn't correct.y
     
    Last edited: Jul 1, 2019
    #88
    bazrat and Nilom like this.
  9. Nilom

    Nilom Veteran Veteran

    Messages:
    178
    Likes Received:
    39
    First Language:
    German
    Primarily Uses:
    RMMV
    Thank you this is amazing! I will check later if I can find the self variable number and if it worked. :kaoluv:
    Will it always be the same number as the variable ID? Or are 1-4 used by self switch A-D?
     
    #89
  10. Shaz

    Shaz Veteran Veteran

    Messages:
    37,549
    Likes Received:
    11,258
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Yes, it will always be the same number as the variable ID, because that's the way Yanfly's plugin works. Self switches A-D use the letters A-D. Variable 1, if you have defined it as a self variable, will be SELF VARIABLE 1. Switch 1, if you have defined it as a self switch, will be SELF SWITCH 1. So they will never get mixed up with each other.
     
    #90
    Nilom likes this.
  11. Nilom

    Nilom Veteran Veteran

    Messages:
    178
    Likes Received:
    39
    First Language:
    German
    Primarily Uses:
    RMMV
    Oh I see! That is pretty clever. Thank you again so much. :LZSsmile:

    Edit:
    @Shaz The timer seems to work perfectly fine!
    Would it be possible to change the opacity of an event when the timer is finisehd? Or to alternatively have two commands in the same timer? Change (Self Var and Self Switch). I know I could probably use two timers for this, but I don't know how performance heavy that would be to double the neccecairy timers.

    Edit 2:
    I noticed that if I set two timers for the same event then the command of the first timer will be overwritten.
    Code:
    AddTimer <thismap>.<thisevent>.NodesSetup 10 \setss([<thismap>, <thisevent>, 'SELF VARIABLE 2'], 0)
    AddTimer <thismap>.<thisevent>.NodesSetup 10 \setss([<thismap>, <thisevent>, 'A'], false)
    Only the second command got executed. Even if I sat different times (10 and 11).
     
    Last edited: Jul 2, 2019
    #91

Share This Page