well i generally only split notetags like this
.split(/\r\n+/) other than a map name script i wrote which splits each character ( split(//)I had never tried to split a string using .split(/./) i was just using it as an example, but if it doesnt work then thats that 😛
Well learning using regular expression is not so bad. Beside split, you can use scan and match (though in this situation, I think split and scan are much better).
"Hi Guys ~. Hello Everybody ~. Yo dawg!".scan(/[^. ]+[^.]*/)
would return => ["Hi Guys ~", "Hello Everybody ~", "Yo dawg!"]
scan is equal to =~ is it not ?
Also, what is it you are acctually scanning for ?
like what does /[^.]+[^.]*/ check for ?
interesting...
It seems Reg Exp is full of useful little things like that 😛
Ahh, i knew it was either scan or match that was equal to =~,
but match doesnt return the object data or something like that ? dunno, i use a case statement to check my notetags anyway, and its usually only notetags that i use RegExp for too 😛
Scan returns every match, while match returns the first one starting from the specified offset for the most part.
Scan is a String method, match is a Regexp method.
ahhh, ok. that explains things a little better 🙂
Edit:
Your like a little advice ninja... Just pop up and share your knowledge and wisdom then disappear 😀
Epic 😛
Somebody please tell me there's a self variable. I would love you if there was.
Thanks Shaz. If I were to use this script and use it solely for self variables, do you think it would adversely affect the gameplay, through lag or some other factor?
Also, just to make sure, when you call a self switch in a common event, it will use the event calling it's self switch correct? Would this script be similar in fashion?
@Shaz
Sorry, didn't know if it was a major enough issue to have it's own thread... on to the next step!
seita, I haven't used it, so I can't be sure. I can't see why it would cause lag or interfere with anything you already have in your game. It would only have an effect on things you TELL it to have an effect on after adding the script.
The Documentation.txt file shows you how to use it. Looks like you can just implement the scripts you're interested in - if you only want to add variables to events, then just use the Events (Self Data) script.
It LOOKS like, if you want to set Variable 1 to 15 on the current event, you'd just do Call Script: self_variable(1) = 15
So yes, if you called it from a common event that was called by a map event, it would put the variable on the map event.
The error is occurring because "bitmap" is nil. Somehow the update origin method (or update in general for the sprite) is being called when there is no bitmap to update. Not sure how that would happen, but you could prevent the crash at that moment by adding a "return if self.bitmap == nil" at the beginning of the method you posted, though I suspect it could possibly still crash elsewhere not to mention the underlying problem of a picture with no bitmap.
would this have anything to do with sprites, actual pictures, or animations?
Since it's the Sprite_Picture class, it should just be pictures with show picture/move picture by default. I don't know if any scripts out there use the class or not.