Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Need Common Event help, to make skills that damage over time

I am pretty new with rmxp, so i dont know much at all about scripting and stuff, but I am trying to be able to have skills that are like the venom status but I can customize the damage they do each tick. (say a multiple of the actor's INT or STR.)

So far I have a way with a bunch of common events but it either freezes the game or gives an error message 'common event call limit exceeded'

my way that doesnt work.
skill 'Incinerate' adds state 'target' and calls common event 'Incinerate'



Common event 'Incinerate' : (supposed to go off when the actor does the move incinerate)
call common event: target (common event 'target' just sets variable 'target' to the enemy number with state 'target' on it. That part works fine.)
conditional branch: Variable [target] ==1 (I have a conditional branch for targets 1 through 8)
change enemy state [1. ] - [Incinerate] (in case it was on before, to renew the duration of 10 turns)
change enemy state [1. ] + [Incinerate]
change enemy state [1. ] + [incinerate effect] (a state with a 1 turn duration that I use to detect when 1 turn goes by)
control variables [incinerate 1] = 10 (incinerate 1 is meant to be a counter for how many turns left worth of incinerate are on enemy #1)
else: nothing
call common event: Incinerate 2

Common event Incinerate 2: (supposed to go off while the 10 turns are going by, monitoring whether the state
incinerate effect is on the target, and doing damage and replacing it if the 10 turns have not gone by yet.)
Conditional branch: Variable [incinerate 1] >= 1
Conditional Branch: enemy [1. ] is [incinerated] inflicted
Else,
Control variables [actor's int] = [actor]'s INT
control variables [actor's int]*3
change enemy [1. ]'s hp -variable:[actor's int]
branch end
else
branch end.
conditional branch: variable [incinerate 1]==0
Else
call common event: incinerate 2(to redo the damage so long as there is 1 or more turn left)

Can anyone show me how to fix it or tell me another way to have skills like this?
 

Zeriab

Sponsor

To understand why you get the 'common event call limit exceeded' error I suggest you take a look at my tutorial: viewtopic.php?t=60373

Using common events alone is not enough since parallel processing does not work in battles.
You have to use a combination of battle events and common events. You can get the idea from this demo: http://bb.xieke.com/files/Incinerate.rar (Only the first 10 troops in the database have been modified)
You cannot through the event commands figure out who is the caster nor who is the target(s). You can do what you want with events, but you need to be very explicit about it (outside of battles as well) and it will be very tedious.

I would suggest you request a script to deal with this since it is much simpler.

*hugs*
- Zeriab
 
It's a little hard to understand what you are saying, since it's not written like how an event types itself out. (Then again, I just tried copying and pasting from RMXP to here and it's and, yeah...I see how it's a pain. Thankfully mine isn't that long, as I'm learning myself.)

I can kinda help, but there is a problem with my solution as well. It seems to me that you are trying to put Parallel Process events in all maps where such battles can occur. The problem is not all event commands work in the field screen, (where you move your character) as well as the battle screen. For instance, "Force Action" refers to commands that would only work in the battle screen, so it wouldn't work in the field screen. "Set Move Route" refers to moving characters on the field screen around, so of course that wouldn't work in the battle screen.

First, make a state, mine is called Poison. Don't add any effects on it (unless you want to) but do add a release condition. Then make a common event to turn on a switch, in my case, Start Poison Effect. Then, make a skill that activates this common event.

This is what I have in my game for my own personal poison effect, in the Troops tab:

Condition: Swtich [0002: Start Posion Effect Test is ON]
Span: Turn

Conditional Branch: [1] is [Poison] inflicted.
Deal Damage: [1. Ghost], 30
Conditional Branch: [2] is [Poison] inflicted.
Deal Damage: [2. Ghost], 30


Repeat until you fill up all 8 slots for 8 possible enemies in any given battle. No error should happen (so far that I know) if it's checking for an enemy that isn't there's state. Copy the Event Page (or just the entire troop) when making future Troops so you don't have to keep typing it over again.

There is only one problem with this method. This is straight exactly 30 damage, every time. Since you want to use a combination of skills to determine the damage, you can use "Deal Damage: Variable." You can fiddle around with an actors' attributes, and set the result of whatever formula you want to another variable, and deal damage with said variable. The problem is (as I can see in your sample) that you have to define which actor you are dealing with yourself. You do one for each actor, but then it would mess around with ALL actor's attributes for the outcome. If you find out a solution, please tell me.
 
Zariab, thanks for the demo it helps a lot.
I just don't get the part in common event process tick that says:
control variables: tempvar= turn number
control variables: tempvar %=2

I dont really know what =% does.

All damage over time effects in my game will do damage/healing on every turn, and each effect will be unique to its actor or enemy boss.

if i changed the 2 to a 1 would that make it every turn?

thanks!
 
% is the 'modulus' operator. It returns the remainder from a division

Anytime you combine an operator with = (%=, +=, *=, ...) It means the same as...

tempvar %= 2

tempvar = tempvar % 2

so, if tempvar = 5, tempvar %= 2 would return 1

dig? :scruff:
 
makes sense. i got the system working, i also imagine i can use the same idea to make cooldowns for moves too, which will help me a lot since my game is really 'tactical moves' oriented.

last thing tho, would there be any way to change the color of the ticks?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top