Original Source
- Original title: Linked Switches
- Original author: Shaz
- Original date: November 27, 2013
- Source thread: https://forums.rpgmakerweb.com/threads/linked-switches.20349/
- Source forum path: Game Development Engines > Ruby Game System (RGSS) Scripts > RGSS3 Scripts (RMVX Ace)
Summary
Linked Switches 1.0 ShazIntroduction Partner to the Linked Variables script, this script allows you to 'link' a switch with some other element in your game, so when you refer to that switch to retrieve its value, it goes off to check the link and returns the appropriate value. It is the equivalent of doing a Control Switches to set a switch, and then using the result in a Conditional Branch, but removes the Control Switches step. By adding a link for the switch, you never need to do a Control...
Archived First Post
Shaz
Partner to the Linked Variables script, this script allows you to 'link' a switch with some other element in your game, so when you refer to that switch to retrieve its value, it goes off to check the link and returns the appropriate value. It is the equivalent of doing a Control Switches to set a switch, and then using the result in a Conditional Branch, but removes the Control Switches step.
By adding a link for the switch, you never need to do a Control Switches to set its value - it always does the check for you at the time you are referencing the switch (so it will always be completely up-to-date).
Versions
1.0 Nov 27 2013 Initial Release
Paste into a new script slot below Materials.
Edit the init_links method to add a new array element for each switch you what to link, along with a script command to eval whenever that switch is referenced.
Follow this format:
@links[variable_id] = 'eval_command'
Examples:
Make switch 1 ON when the leader’s HP is less than 50%:
@links[1] = '$game_party.leader.hp_rate < 0.5'
@links[2] = '$game_party.all_members.include?($game_actors[5]) && !$game_actors[5].battle_member?'
@links[3] = '[5, 8, 10].include?($game_map.map_id)'
Download Here
Known Issues
This is not reliable for using a switch as a condition on an event page, as the condition behind the link may change more often than event pages are polled to determine which one is active.
FAQ
Credit and Thanks
- Shaz
Author's Notes
I have added a check to ensure this still works with save files made prior to implementing this script.
If you add this script to a project that's half finished, you may go back and remove any commands that change the values in linked switches, but you do not have to - they will effectively be ignored.
Free to use in commercial games.
Give credit.
Downloads / Referenced Files
Log in, then follow the RPG Maker Developers Group to see these download links.
Log in to downloadLicense / Terms Note
Credit and Thanks - Shaz Author's Notes I have added a check to ensure this still works with save files made prior to implementing this script.
Creator Claims / Removal
If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.
Replies (0)
No replies yet.
Topic Summary
Loading summary...