iPhone App Directory
RPG Maker VX
 
Gallery Members Search Calendar Help


Welcome Guest ( Log In | Register )

Collapse

>Announcement

Keep an eye out for the upcoming 3rd Quarter Contest!
 
Reply to this topicStart new topic
> Auto-Preemptive or Surprise, Force a Preemptive or Surprise battle.
AlphaWhelp
post Jun 7 2009, 05:55 PM
Post #1


You can dance if you want to, you can leave your friends behind.
Group Icon


Type: Coder




Script is simple and self explanatory, so I'm not going to use a template. Just post here if you have an issue.

PREEMPTIVE = Party attacks first
SURPRISE = Enemies attack first

UPDATED TO v0.2a on 6/7 10:00 PM. (very) Minor bug fix involving putting auto-preempt or surprise into a random encounter. My apologies for not thinking clearly when I wrote the script.

CODE
=begin
AlphaWhelp's Auto Preemptive or Surprise

Add the troop ids to the appropriate variables below
noted with comments above them. If you input a troop
ID into both variables, auto-preemptive takes effect
instead of auto-surprise. Enjoy.

Version 0.2a
Changes from 0.1a
Minor bug fix involving random encounters
Created 6/7/09, 1:34 A.M.
=end
module AW
#Insert auto-preemptive troop IDs below
#E.X. [1, 2, 3, 4]
AUTOPREEMPTTROOPIDS = [1]

#Insert auto-surprise troop IDs below
#E.X. [5, 6, 7, 8]
AUTOSURPRISETROOPIDS = [2]
end

class Scene_Battle < Scene_Base
alias aw_preempt_pbs process_battle_start
def process_battle_start
awtroopid = $game_troop.troop.id
if AW::AUTOPREEMPTTROOPIDS.include?(awtroopid)
$game_troop.preemptive = true
else
if AW::AUTOSURPRISETROOPIDS.include?(awtroopid)
$game_troop.surprise = true
end
end
aw_preempt_pbs
end
end

class Scene_Map < Scene_Base
alias aw_preempt_pos preemptive_or_surprise
def preemptive_or_surprise
awtroopid = $game_troop.troop.id
if AW::AUTOPREEMPTTROOPIDS.include?(awtroopid)
$game_troop.preemptive = true
else
if AW::AUTOSURPRISETROOPIDS.include?(awtroopid)
$game_troop.surprise = true
else
aw_preempt_pos
end
end
end
end


This post has been edited by AlphaWhelp: Jun 8 2009, 01:06 AM


--------------------
My Scripts:
Spoiler:
Haste slow States for Tankentai with ATB 1.1c: http://www.rpgmakervx.net/index.php?showtopic=3781 (scroll down to about halfway through the first post and find it under add-ons.)

Old Fashioned Gameovers: http://www.rpgmakervx.net/index.php?showtopic=11819

Comic Book Scenes: http://www.rpgmakervx.net/index.php?showtopic=14072

Force Preemptive or Surprise battles: http://www.rpgmakervx.net/index.php?showtopic=15135
Go to the top of the page
 
+Quote Post
   
Dioxyde
post Jun 8 2009, 12:03 AM
Post #2



Group Icon


Type: Designer




This is a great script, thanks for adding it.

--Dioxyde--
Go to the top of the page
 
+Quote Post
   
AlphaWhelp
post Jun 21 2009, 02:14 PM
Post #3


You can dance if you want to, you can leave your friends behind.
Group Icon


Type: Coder




QUOTE (Dioxyde @ Jun 7 2009, 08:03 PM) *
This is a great script, thanks for adding it.

--Dioxyde--


I see you registered just to post here! Thanks. biggrin.gif


--------------------
My Scripts:
Spoiler:
Haste slow States for Tankentai with ATB 1.1c: http://www.rpgmakervx.net/index.php?showtopic=3781 (scroll down to about halfway through the first post and find it under add-ons.)

Old Fashioned Gameovers: http://www.rpgmakervx.net/index.php?showtopic=11819

Comic Book Scenes: http://www.rpgmakervx.net/index.php?showtopic=14072

Force Preemptive or Surprise battles: http://www.rpgmakervx.net/index.php?showtopic=15135
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 1st September 2014 - 12:46 PM

RPGMakerVX.net is an Privacy Policy, Legal.