RPG Maker Forums

I put together this note tag.


/<Index:[ ](.*), Copy:[ ](.*), Take:[ ](.*)>/i


Usage1: <Index: 5, Copy: 3, Take: 2>


Usage2: <Index: 2, Copy: 2, Take: 0>


Usage3: <Index: 3, Copy: 1,2,3, Take: 3,2>


The method which evaluates this note tag works something like this. (Don't take it too literally)


def method(id, index, copy, take)
index = index.scan(/(.*)/)[0][0].split(",")
take = take.scan(/(.*)/ )[0][0].split(",")
copy = copy.scan(/(.*)/ )[0][0].split(",")
return if index.compact.delete_if(&:empty?).empty?
unless copy.compact.delete_if(&:empty?).empty?
copy.each do |id|
next unless id.to_i > 0
/something happens/
end
end
unless take.compact.delete_if(&:empty?).empty?
take.each do |id|
next unless id.to_i > 0
/something happens/
end
end
/some more stuff happens/
end # method




What I want to know is; how do I make the 'copy' and 'take' input values optional for the note tag without making separate notes (and methods consequently)?


Like this: <Index: 2, Copy: 3,4,5>


Or this: <Index: 3, Take: 1, 2>


So that copy remains as $2, and take as $3 either way.


This isn't a necessity, but it would be a nice feature.

Latest Threads

Latest Profile Posts

Frostorm wrote on Featherbrain's profile.
Hey, so what species are your raptors? Any of these?
... so here's my main characters running around inside "Headspace", a place people use as a safe place away from anxious/panic related thinking.
Stream will be live shortly! I will be doing some music tonight! Feel free to drop by!
Made transition effects for going inside or outside using zoom, pixi filter, and a shutter effect
I have gathered enough feedback from a few selected people. But it is still available if you want to sign up https://forums.rpgmakerweb.com/index.php?threads/looking-for-testers-a-closed-tech-demo.130774/

Forum statistics

Threads
105,992
Messages
1,018,189
Members
137,771
Latest member
evoque
Top