Change Pre-emptive and Surprise

I am in need of a script that:

  1. Change the probability to get preemptive and surprise into true or false, or using true or false only...instead of getting the probability into the troop agility. So if I call preemptive = true, then it would be a preemptive battle and so on.
Thank you very much.
Hum I can try my hand on this~
Thanks, I'll be waiting for it 😀
module BattleManager   #change via a script call : BattleManager.prep or surp = true or false   class << self    attr_accessor 😛rep    attr_accessor :surp  end def self.on_encounter  @preemptive = ( rate_preemptive)    @surprise = ( rate_surprise && !preemptive )   enddef self.rate_preemptive  if @prep == true    @preemptive = true  else   @preemptive = false    endenddef self.rate_surprise  if @surp == true && @prep == !true    @surprise = true  else    @surprise = false  endendendendHere finish I don't know if it work I don't tested it and I don't know what is the surprise and premptive effect so if it anny kind of bug say it xD
Looks good and working, however, when I script call it and start a battle, it just shows a regular battle without being a preemptive or a surprise.
I play with the script and for the moment I am in the unability to find how to settle your problem... I will try to find a way to fix this...sorry for not be able to help you..

Original thread: https://forums.rpgmakerweb.com/threads/change-pre-emptive-and-surprise.27372/