So im trying to add a bit of strategy to my game by using a turn based system on the overworld. (Think the total war games or Civilization)
I already know how to trigger events and change things when X turn is reached. But i also need certain events to trigger after every 3 turns pass, for example (with turns being a variable)
Basically in the conditional branch page i can set the event to activate once the variable turns reach a certain amount, like turn 2, 10, etc... Now i only need to make it trigger every time the variable goes up 3 times for example.
Is there a way to do this?
goes up 3 times like increase-increase-increase with values completely irrelevant:
have a variable track the amount of times a variable has increased.
Variable goes up 3 times (variable = 3*variable):
if - script - $gameVariables.value(1) == 3*$gameVariables.value(1)
simple.
You have common event increasing variable 1, which symbolizes passed days.
Instead of the common event only doing
variable operations: 0001, +1
do this:
variable operations: 0001, +1
variable operations: 0002, +1
if (0002 is equal to 3)
trigger switch 0001 on
variable operations: 0002, = 0
and that switch 0001 is the trigger switch for your parallel process common event that is supposed to activate after 3 days passed. And every 3 days the switch 0001 turns on and the parallel process activates.
There are many ways to do this, depending on what you exactly want to do.
You're welcome 😀
Yup, playing with it is the best way to learn 🙂 I have spent 3 years playing with RM2003 😀 (never really created a serious project :'( )
You could also use the Modulo Function in Control Variable Eventcommand.
It gives the left overs of something (sorry my english is lacking).
10 modulo 3 = 1 ( 3+3+3 = 9 and the Leftover is 1)
In your example do this:
Variable?? = VariableTurn Count
Variable?? modulo 3
conditional branch variable?? equals 0
if yes show textbox: You did it 🙂.
If the leftover is 0 its 3 turns pass ^^ if its 1 or 2than the condition is false.
That means every 3 turns this condition would be true.
This would only work under the assumption that the op would increase the variable always by 1 though, so I opted to give the more general answer.
He mentioned in his first post that he knows how to let something happen at a certain turn in the fight,
thats why i assumed he uses inbuild variable or counter to keep track of that. i also just wanted to mention this as extra angle for solution ways.
ah i made a mistake in the code, it would activate at turn 0, to prevent that the pseudo code would be:
In your example do this:
Conditional Branch "Variable for Turn Count" more then 0 ?
if yes
-Variable?? = VariableTurn Count
-Variable?? modulo 3
-conditional branch variable?? equals 0
-if yes show textbox: You did it 🙂.
else
nothing
Edit: I reread first post and iam sorry my english aint the best. i partialy missread the problem. And poryg also allready posted modulo in his first answer with the scriptline ^^.
Have to take more time reading next time.
Edit2: what exactly are you building in terms of mechanic? iam just curious.