General attacking script issue

● ARCHIVED · READ-ONLY
Started by Raptorking6 7 posts View original ↗
  1. I am new to RPG maker and have been following the tutorials on the website. I got to the 7th tutorial with no problem however when it got to battle testing the character could not perform a basic attack and i get the error message: 

    Script 'Skill Set Effect' line 37: NoMethodError occurred.

    undefined method '[]' for nil:NilClass

    i have no idea what i have done wrong or how to fix this. Does anyone have any idea of what the issue is and what i need to do?

    Sorry if there is already a post about this but i couldn't find it
  2. That script "Skill set Effect" contains an error - and it is not part of the original engine, it is something you have added to your project.


    Where did you get that script?


    If you misnamed the script from the 3.5 tutorial (that one is called "skill self effects"), then it might be that you accidentally got an older version of the tutorial where a defective script was included. You can either search the forum for the correct version, or look the tutorial up on the blog in that case.


    Or you can simply delete that script - that method of applying effects to the user has been replaced by a better method using the damage formula without the need to add any script.
  3. OK thanks. How would i use the damage formula in this way? as well as how do i create the formulas? they confuse me a lot
  4. and yes i did name it wrong.oops
  5. Raptorking6, please avoid double posting, as it is against the forum rules. You can review our forum rules here. Thank you.

    Basically, a is the placeholder for the skill user and b the placeholder for the skill target. And the damage formula (the box in the skill tab of the database) can hold more than one command.

    For example

    a.add_state(7);a.atk * 4 - b.def * 2would add the state with ID=7 to the skill user before dealing regular damage to the target.There is a very big, multipage topic about the damage formula here on the forum, where you can see the many other commands possible there.

    But if you're new, take time to learn the basics - follow the link in my signature to see what else there is beyond the basic tutorials. Any time you spend learning the basics (which usually takes about two months depending on how much time you can spend) will speed up your later game development a lot.
  6. One of the tutorials has an error - I think the error is in the actual script the tutorial tells you to use.


    It HAS been corrected and updated, but I think there's still at least one place on the site that has the old version.


    So if you're using a demo, follow the link from the tutorial to the script instead, or vice versa.
  7. Thank you very much for the help. I've got it working now.