RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Called events from skills fail in battle?

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
I've got some common events that modify character attributes called through a skill, but the stats only change when the skill is activated outside of combat. If I activate the skill inside battle, the special effects work, but the stats don't change.

What's happening?

********
Furry Philosopher
Rep:
Level 94
Rawr?
2013 Best RPG Maker User (Creativity)Randomizer - GIAW 11Gold - GIAW 11 (Hard)Secret Santa 2013 ParticipantFor frequently finding and reporting spam and spam bots2012 Best RPG Maker User (Programming)2012 Best RPG Maker User (Mapping)Secret Santa 2012 ParticipantGold - GIAW 9Project of the Month winner for September 2008For taking a crack at the RMRK Wiki2011 Best RPG Maker User (Programming)2011 Kindest Member2011 Best Veteran2010 Most Deserving Of A Promotion2010 Best RPG Maker User (Technical)
Is this a temporary stat change or a more permanent one?

If it's temporary, you can just use a state change skill instead of that.




***
Rep:
Level 82
We learn by living...
Is this a temporary stat change or a more permanent one?

If it's temporary, you can just use a state change skill instead of that.

state changes cap at +100%, which isn't sufficient to go from 100 to 600+, so I was using a semi permanent change - it's permanent until a conditional branch turns it off. PDEF/MDEF modifiers for a forcefield through script. I recently noticed some effects in a common event script will wait until after combat is over, like some aspects are paused. I believe this "delay effect" is probably the culprit, or related, but don't know yet how to address it.

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Common event:

@>Force action: Actor No. 1, Attack, Random, Execute Now.
@>Change Parameters: [Alexus], STR + 500
@>Force action: Actor No. 1, Attack, Random, Execute Now.

Attack 1 returned 200.
Attack 2 returned 2000.

Seems to work for me... Am I missing something?

***
Rep:
Level 82
We learn by living...
I have no idea. Only that my forcefield does not do anything but make pretty lights when used in battle. When I turn it on before battle, it works fine. I just tested it:

damage suffered after turning it on DURING battle: 3077
damage suffered after turning it on BEFORE battle: 0

It's clearly the script part that isn't working.
Code: [Select]
@>Control Variables: [0020: 1st actors sp] = [Zeno]'s SP
@>Conditional Branch: Variable [0020: 1st actors sp] >= 1
@>Conditional Branch: Switch [0128: Forcefield on] == ON
@>Control Variables:[0200: 1st actors Int] = [Zeno]'s INT
Show Animation: Player, [Forcefield]
@>Script:
$game_actors[1].mod_pdef = @game_variables[200]
$game_actors[1].mod_mdef = @game_variables[200]
@>Wait 15 frame(s)
@>Change SP: [Zeno], -2
@>
: Else
@>
: Branch End
@>

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Well, somethings wrong with your script, and that script should make a fatal NoMethodError. You should change @game_variables[200] to $game_variables[200]. Also, could you explain what that Switch 128 is supposed to do? I'm thinking that when your in a test battle, the switch isn't on, so it ignores the whole process. Because without that conditional branch, it works fine. Just my little hunch.


***
Rep:
Level 82
We learn by living...
ok i finally got it fixed.

Originally I had two common events, one called "cast forcefield", the other called "forcefield fx". This cast+fx pattern allows parallel events activated by skills to be turned on and off, and to auto quit when a condition is met, such as running out of mana.

The cast forcefield code was originally pretty simple, controlling the forcefield switch to be "on", as you might have guessed.

The problem is the "cast forcefield" is an instantaneous effect, and I had to put in a $game_temp.in_battle conditional script that would also add my $game_actors[1].mod_pdef... script to make it work for 'one round'. Once it is cast during combat, i followed up with a Control switch fx = on like normal, but also inside the "game_temp.in_battle..." conditional, so the off switches would be available after combat ended.

It was pretty messy to figure out initially because I had a "target on" interference switch designed to only keep one power active at a time, but then I remembered Magneto from the X-men had a forcefield up and was still able to attack. Previously the "target on" was turning off my "forcefield FX" switch, but not the bonuses, because those require you to hit the shift key, and that's internal to the forcefield FX, while the bonuses are external and not directly dependent on the FX to work. Rather than make the "target on" even more complicated, I decided to simply separate the two codes and make forcefield an independent effect.