Main Menu
  • Welcome to The RPG Maker Resource Kit.

[RESOLVED] batch control self switches

Started by 104251, January 16, 2011, 05:19:18 PM

0 Members and 1 Guest are viewing this topic.

104251

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...

modern algebra


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

Jaffer

Quote from: modern algebra on January 16, 2011, 06:21:44 PM

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.

104251

#3
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
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
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?

Jaffer


104251