Javascript for a self switch value?

● ARCHIVED · READ-ONLY
Started by Woland 7 posts View original ↗
  1. I'm using the hidden choice plugin and it works great with switches, like

    hide_choice(5, "$gameSwitches.value(23) === false")

    but I would like to use self-switches too, to stop multiplying global switches. What would be the self switch equivalent of the bolded out piece?
  2. Same premise, just needs a bit more info -
    $gameSelfSwitches.value([mapId, eventId, A-D])

    So, you can check map 1, event 5, self switch B with -
    $gameSelfSwitches.value([1, 5, 'B'])

    Or, if you wanted to change the value through code -
    $gameSelfSwitches.setValue([1, 5, 'B'], true)
  3. Works like a charm, thank you!
  4. Hmm... found another one along these lines - what would be the javascript to check if the main character has a certain skill?
  5. You can find documentation on that here, just search for learned/skill.

    But this sounds like a totally different question than the title "Javascript for a self switch value?" right?
  6. True, my apologies.
  7. to checking the actor has a specific skill, you can use this expection. Return value will be a boolean (true/false)
    $gameActors.actor(actorId).hasSkill(skillId)

    for example, the 1st actor has the skill whith the id 11:
    $gameActors.actor(1).hasSkill(11)

    the actorId and the skillId can be found in the database