Chaos Project

RPG Maker => RPG Maker Scripts => Script Troubleshooting => Topic started by: igorlipemoreno on May 02, 2015, 09:52:01 pm

Title: Script Syntaxerror
Post by: igorlipemoreno on May 02, 2015, 09:52:01 pm
Can someone help me because the script ta Giving use Error only the blizz abs and toons
this script that ta giving error http://forum.chaos-project.com/index.php?topic=9983.new
module Xelias

   def self.ers_config(item)
   # weapon configuration
   if item.is_a?(RPG::Weapon)
     case item.id
     # START Weapon Configuration
     when 2 then return [100] <<< ERROR SYNTAX
     # END Weapon Configuration
     end
   elsif item.is_a?(RPG::Armor)
     case item.id
     # START Armor Configuration
     when 2 then return [100]
     # END Armor Configuration
     end
   end
   return [100]
 end

 def self.req_skill(id)
   case id
     # START Skill Configuration
     when 8 then return 101
   end
   return
 end
 
end
Title: Re: Script Syntaxerror
Post by: Sylphe on May 03, 2015, 02:14:06 am
I think it is  when 2 then return 100 ... and not [100]

Also...  def self.methodName   ??? WTF never saw that before xD
Title: Re: Script Syntaxerror
Post by: KK20 on May 03, 2015, 03:08:22 am
According to the script, it needs to be in an array. Don't know why it was written like that though--it could have easily just been a stand-alone number. It also doesn't make sense why that line would be giving a syntax error. I would have to see all the scripts in the project to draw a conclusion.

def self.<method> is syntax for defining Module methods. Classes use def <method>.
Modules are best used for configuration in scripts. While you could use a class to do the same thing, you would need to initialize an instance of the class every time you wanted to use a method from it. Meanwhile. modules can be accessed and used anywhere.
Title: Re: Script Syntaxerror
Post by: Sylphe on May 03, 2015, 01:21:48 pm
Oh ok I didn't know, maybe I saw that but didn't notice  ! xD

Also I think you should create the array then return the variable containing the array then see if the error still there.
something like :
array = [100]
...
when 1 then return array
Title: Re: Script Syntaxerror
Post by: ForeverZer0 on May 03, 2015, 09:38:33 pm
Why do you not just tell us which line is causing the syntax error? The cursor will take you there after the error occurs and you open the script editor.
Title: Re: Script Syntaxerror
Post by: igorlipemoreno on May 05, 2015, 04:38:34 am
thank people Discover the poblema as I am Brazilian I am using hum hum translator paragraph TALK WITH voces script I was doing Copying browser which I use Baidu If not THAT and Some Other browsers break the text line agora copied with internet explorer and fucionou Very obg perfectly the script and I 'm sorry Do you guys lose pace :^_^':
Title: Re: Script Syntaxerror
Post by: Sylphe on May 05, 2015, 05:07:08 pm
I am groot
Title: Re: Script Syntaxerror
Post by: ForeverZer0 on May 05, 2015, 05:19:39 pm
The translation just isn't working for me.
Title: Re: Script Syntaxerror
Post by: igorlipemoreno on May 06, 2015, 12:31:54 pm
Getting THAT USE as que features Error place as id Everything just right single thing I have to and Blizz abs toons and with activated equipament_requeriment
(http://imageshack.com/a/img540/8266/nddRdK.png)