Ruby Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesRuby Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old March 30th, 2008, 10:35 PM
aschx aschx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 aschx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 33 sec
Reputation Power: 0
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!!!!

Reply With Quote
  #2  
Old March 31st, 2008, 06:21 AM
L7Sqr L7Sqr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Constant Limbo
Posts: 591 L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 13 h 59 m 46 sec
Reputation Power: 100
Send a message via AIM to L7Sqr
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>
How are you assigning time
__________________
-- 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.

Reply With Quote
  #3  
Old March 31st, 2008, 10:55 AM
aschx aschx is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2008
Posts: 2 aschx User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 m 33 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old March 31st, 2008, 12:08 PM
L7Sqr L7Sqr is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jan 2004
Location: Constant Limbo
Posts: 591 L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level)L7Sqr User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 13 h 59 m 46 sec
Reputation Power: 100
Send a message via AIM to L7Sqr
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).

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesRuby Programming > RPG Maker script probelm... HELP!!!!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway