RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RESOLVED] batch control self switches

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 84
Above Characters
Hello. Its good to see all of you, great people of rmrk!)

Basically, i need a script similiar to this one:
http://rmrk.net/index.php?topic=32084.0
it allows to change self switches even if you're doing it from another event or location
What it cannot do, is set, for example, switches A, B, C, and D to false in events from 14 to 91 on map 3
I think its possible...
« Last Edit: January 23, 2011, 10:36:05 PM by 104251 »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
Code: [Select]
for i in 14...91
  control_self_switch (3, i, 'A', false)
  control_self_switch (3, i, 'B', false)
  control_self_switch (3, i, 'C', false)
  control_self_switch (3, i, 'D', false)
end

Put that in a call script. You can adapt it for whatever purposes you need to

**
Rep: +0/-0Level 82
Code: [Select]
for i in 14...91
  control_self_switch (3, i, 'A', false)
  control_self_switch (3, i, 'B', false)
  control_self_switch (3, i, 'C', false)
  control_self_switch (3, i, 'D', false)
end

Put that in a call script. You can adapt it for whatever purposes you need to
When you're doing this, make sure to set the range correctly
14...91 is from 14 to 91, but not 91
14..91 is from 14 to 91, including 91.

**
Rep: +0/-0Level 84
Above Characters
Yes! Thank you! I'll try that immediatly after i finish up my work!

----EDIT----

am i doing it right?

here goes the first one by TDS
Code: [Select]
def alter_self_switch(map_id, event_id, self_switch, value)
key = [map_id, event_id, self_switch]
$game_self_switches[key] = value
$game_map.refresh
  end
and then
Code: [Select]
def reset_shaft
for i in [4,10,12..17,20,21,23..92]
 alter_self_switch (47, i, 'A', false)
 alter_self_switch (47, i, 'B', false)
 alter_self_switch (47, i, 'C', false) 
 alter_self_switch (47, i, 'D', false)
 alter_self_switch (47, i, 'E', false) 
 alter_self_switch (47, i, 'F', false)
 alter_self_switch (47, i, 'G', false)
 alter_self_switch (47, i, 'H', false)
 alter_self_switch (47, i, 'I', false) 
 alter_self_switch (47, i, 'O', false)
 alter_self_switch (47, i, 'P', false) 
 alter_self_switch (47, i, 'Q', false) 
end
end

(about those E, F, G etc. - i've used the 'extra control switches' script by mr. MA)

---edit---
please? help?
« Last Edit: January 18, 2011, 02:07:48 PM by 104251 »

**
Rep: +0/-0Level 82
I don't see why it wouldn't work.

**
Rep: +0/-0Level 84
Above Characters
Thank you Jaffer!
it is [RESOLVED]