|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
RPG Maker script probelm... HELP!!!!!
Okay, I am getting this error:
"undefined method `*' for nil:NilCLass" this is the script it is pointing towards: $game_system.killed.push([sprite.character, time*40]) why is it saying this... and how can I fix it??? Please HELP!!!! |
|
#2
|
|||
|
|||
|
the time variable is nil. Trying to multiply that with 40 is giving you your error. Since we cant see where time is assigned (or, in this case, not assigned) we arent going to be able to provide you with much assistance.
Code:
irb(main):001:0> time = nil
=> nil
irb(main):002:0> time * 40
NoMethodError: undefined method `*' for nil:NilClass
from (irb):2
irb(main):003:0>
__________________
-- I'll provide you with reference points; if they dont work, refer to something else. If you process text, this might make your life a little easier. |
|
#3
|
|||
|
|||
|
I have the respawn time as 5... if that helps, here is the script using to assign time...
time = sprite.character.respawn_point.respawn_time |
|
#4
|
|||
|
|||
|
That call (respawn_time) is returning nil. That or time is being modified elsewhere before the error point. Either way, you should get a stack trace when things fail. That can be used to find the culprit. You can also try to catch the exception yourself and do something meaningful (be it look for a cause or simply provide default value to use in that case).
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Ruby Programming > RPG Maker script probelm... HELP!!!!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|