Yami's PCTB giving error message

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
I am using Yami's Predicted Charge Turn Battle script which can be found here.

Everything works as expected - unless an enemy is killed by a counter attack. The game then crashes with this error message.

pctb error message.PNG

This happens even in a New Game.

The line of script being referred to is here:
Code:
# alias method: execute_action
#--------------------------------------------------------------------------
alias scene_battle_execute_action_pctb execute_action
def execute_action
scene_battle_execute_action_pctb
unless BattleManager.action_forced?
@subject.last_obj = @subject.current_action.item unless @subject.last_obj
end
end
with the culprit line being
@subject.last_obj = @subject.current_action.item unless @subject.last_obj

This seems to indicate definitively that it is the fact that the enemy has died that is causing the problem, as it is the last object.

Can anyone see a solution to this?
Thank you.
 

TheoAllen

Self-proclaimed jack of all trades
Veteran
Joined
Mar 16, 2012
Messages
5,592
Reaction score
6,522
First Language
Indonesian
Primarily Uses
RMVXA
Without knowing the whole workflow, what if you change the line into something like this?
Code:
@subject.last_obj = @subject.current_action.item if @subject.current_action && !@subject.last_obj
 
  • Like
Reactions: Kes

Kes

Veteran
Veteran
Joined
Aug 3, 2012
Messages
22,299
Reaction score
11,712
First Language
English
Primarily Uses
RMVXA
@TheoAllen That appears to have solved it. The enemy died without causing a game crash. Thank you very much indeed. I am deeply grateful for your help.

I shall leave this thread open in case something emerges with a mor prolonged play test, but I am hopeful that all will be well.
 

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

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top