Unimaginitarian
Member
Hello. Enough chatter, let's get on to business.
In an old project I was using the DBS. I had it edited in a way so that when a character would perform a basic attack he/she/it would game a certain amount of MP based on their level. It did this by determining the "active_battler" and then calling a specific common event that corresponded with the character. It all worked perfectly.
Fast-forward until recent times and I have a project using cogwheel's RTAB, and I want in implement the same feature as previously mentioned. I found the spot in the script that was the exact same spot where it was in the DBS (Scene_Battle 4). But it doesn't work! I've gone through various measures to test if it is reading the "active_battler" correctly and if the common event calling is right. For example, I put an event on a map with a call script "$game_temp.common_event_id = 1" and it activates the common event correctly. Here is what my code currently looks like, starting at line 1720:
(The bold and red parts are the only things I added.)
I tested to see if the script was reading the "if battler == $game_actors[1]" part correctly by doing this:
and it works! But it won't call my common event, even though I tested if that code actually works.
I know a bunch of people will say it's easier just to put the whole thing into the script and not worry about the common events but I'm not a scripter. It would be nice if someone did that, but this isn't a request thread. I just want to know why the common event isn't being called from the script.
I think that's everything. Thanks in advance guys good luck!
In an old project I was using the DBS. I had it edited in a way so that when a character would perform a basic attack he/she/it would game a certain amount of MP based on their level. It did this by determining the "active_battler" and then calling a specific common event that corresponded with the character. It all worked perfectly.
Fast-forward until recent times and I have a project using cogwheel's RTAB, and I want in implement the same feature as previously mentioned. I found the spot in the script that was the exact same spot where it was in the DBS (Scene_Battle 4). But it doesn't work! I've gone through various measures to test if it is reading the "active_battler" correctly and if the common event calling is right. For example, I put an event on a map with a call script "$game_temp.common_event_id = 1" and it activates the common event correctly. Here is what my code currently looks like, starting at line 1720:
Code:
# Applying the effect of normality attack
for target in battler.target
target.attack_effect(battler)
end
[COLOR=Red][B] # BEGIN OP INCREASES
if battler == $game_actors[1]
$game_temp.common_event_id = 1
end
# END OP INCREASES[/B][/COLOR]
return
end
I tested to see if the script was reading the "if battler == $game_actors[1]" part correctly by doing this:
Code:
if battler == $game_actors[1]
$scene = Scene_Title.new
end
and it works! But it won't call my common event, even though I tested if that code actually works.
I know a bunch of people will say it's easier just to put the whole thing into the script and not worry about the common events but I'm not a scripter. It would be nice if someone did that, but this isn't a request thread. I just want to know why the common event isn't being called from the script.
I think that's everything. Thanks in advance guys good luck!