Is it okay to combine scripts? By that I mean scripts of similar function but different outcomes that do not satisfy the intended result, but combining them gets the right results.
Not including scripts where they have snippets/fixes/compatibility fix from other scripters (not from the creator), but taking a portion of the script and putting it in another (im not intending to share it without prior permission from the creators, rather for my own use in my games)
in most cases, i'd say your fine as long as the credit is given. But a few scripters have a no modification line in their terms
Hey guys~ I can't seem to recall the call that checks if an event is already on a specific tile, or the call that returns the ID of the event on a specific tile.
Any help would be great!
This code will allow you to use the call on-tile?(x,y) for all characters, such as events..
class Game_Character def on_tile?(x,y) self.x == y && self.y == y end end
You could then use something like this...
$game_map.events.find { |ev| ev.on_tile?(1,2) }Which will return the item it finds, or nil if it cant find any event on the tile in co-ords x=1,y=2.
Not sure if i made that sound more complex than required ^_^
Aaah thanks for the quick reply! I found it right before I saw this x____x
It was in game_interpreter:
$game_map.event_id_xy(x, y)
Thanks again though really appreciate it~
lol tis all good ^_^
I didnt even think to check for a default method lol
Is there a way via a Ruby command to add a feature to an actor once a game has started? If so, how?
Not via a command, because it'd be reset as soon as you closed the game and reopened.
Look for my Dynamic Features script.
seita already pointed that out 😉
Is there a more concise way to write this conditional statement?
if @room[1] == 2 && @room[2] == 2 && @room[3] == 2 && @room[4] == 2For example, something like:
if @room[1..4] == 2would be nice if it worked.
(1..4).to_ary.any? {|id| @room[id] == 2}
would probably do it. But I'm not really familiar with using ranges, so there might be a neater way.
Number.between?(1, 100)
is the native ruby way 🙂
Another way to do it would be to use:
if @room.include?(2)
What this does is it checks to see if any id's in the array are equal to the value two.
Edit: Just realized you want to check if all those id's values are equal to two. In that case my method won't work. :/
You can't .to_ary a range.