PURPLE0'S PROFILE

Search

Cancelling "Move Picture" if there is no picture...

I started using VX Ace, and I've noticed a lot of my events giving me

Script 'Sprite_Picture' line 54: NoMethodError occured
undefined method 'width' for nil:NilClass

...and figured out that it happens when one of my events is trying to "Move Picture #x" after it has been erased. In most cases, it happens because a separate Parallel Process that Moves Picture of the cursor of a menu while another handles button pressed (Down/Up/Confirm/Cancel). Confirming, for example, erases the cursor's pictures but sometimes too quickly and the cursor's events still tries to move the cursor after it's been erased.
Obviously I can work around this with long waits after switching off the "move cursor's picture" event before erasing the picture...but I have quite a lot of those events by now, and not only cursors...

Isn't there a line I can add in the basic script? Something that tries to says, to paraphrase, "forget about moving the picture if the picture does not exist anymore"?

I didn't have this problem in VX...help please!!

Changing a variable depending on current position's tile type...

Hello,
I was wondering if there was any way to script something to change a certain variable depending on which type of tile the character is standing on. For example, if standing on the 17th tile which is dirt, change the value to 1, and if the hero is standing on tile 18th which is a lighter colored dirt (higher in terrain), change that value to 2 instead.

The point is to integrate a very basic platforming element in the game. My plan is to have a variable that indicates what is the height of the current position's tile, so that when the hero jumps (during which hero's height variable goes up then down) his height will stop at that of the tile's.

I would only need help with the first part. I suppose it would be simple, but I don't have much knowledge in the scripting, only with the general RPG maker functions. Can anybody please help me with this??
Pages: 1