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

Seems like people have stopped looking both ways before crossing the road nowadays. Blindly walking out into a into a road only ends in disaster.
Just finished planning out the skeleton of the main quest line of my new game. I'm so excited for it!
Integrating Jason Perry's japan tile set while listening to Murray Atkinson's Heaven and Earth background music.
I forgot I had an account on rpgmakercentral lol
"What do you think the best place to visit on this cold days?" "Hell..."

Forum statistics

Threads
94,539
Messages
921,737
Members
124,406
Latest member
keyboardjockey
Top