Stamina System Error

Cristiander

Veteran
Veteran
Joined
Aug 13, 2015
Messages
41
Reaction score
1
First Language
Romanian
Primarily Uses
I've been testing my game and I keep having this error pop up:





It's from the script  Stamina Based Battle System - by Fomar0153


Link to script: Link


I don't understand what's going on with this error. It apears sometimes after an enemy dies, but it doesn't seem to come up in certain conditions, it seems to apear randomly. I don't even know where to start looking.


There is one condition in which the error always apears, and that's when an enemy dies because of a counter attack.


I really don't know what to do now. Any help is welcomed
 

FlipelyFlip

The Unown
Veteran
Joined
Mar 10, 2013
Messages
47
Reaction score
46
First Language
German
Primarily Uses
Do you use any scripts for Counters or are you using the default counter from the maker?
 

Cristiander

Veteran
Veteran
Joined
Aug 13, 2015
Messages
41
Reaction score
1
First Language
Romanian
Primarily Uses
Bump


I seems the program doesn't know the value stamina_cost in this code


def stamina_loss
if self.actor?
@stamina -= input.stamina_cost
else
@stamina -= @actions[0].stamina_cost
end
BattleManager.add_action
end


More specifically it's asking for


@actions[0].stamina_cost


What is @actions[0] ?


EDIT:


So I replaced the code


This is my code now


def stamina_loss
if self.actor?
@stamina -= input.stamina_cost
else
# @stamina -= @actions[0].stamina_cost how it was before
@stamina -= 1000 # what i changed
end
BattleManager.add_action
end


It seems to work fine ... but I feel like this isn't a good solution :(
 
Last edited by a moderator:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Profile Posts

I should realize that error was produced by a outdated version of MZ so that's why it pop up like that
Ami
i can't wait to drink some ice after struggling with my illness in 9 days. 9 days is really bad for me,i can't focus with my shop and even can't do something with my project
How many hours have you got in mz so far?

A bit of a "sparkle" update to the lower portion of the world map. :LZSexcite:
attack on titan final season is airing tomorrow, I'm excited and scared at the same time!

Forum statistics

Threads
105,882
Messages
1,017,230
Members
137,607
Latest member
Maddo
Top