Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Auto-Preemptive or Surprise, Force a Preemptive or Surprise battle. Minor bug fix update.
AlphaWhelp
post Jun 7 2009, 07:40 AM
Post #1


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Developer
RM Skill: Skilled




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

Minor bug fix, if you downloaded it before, download it again.

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 7 2009, 07:09 PM


__________________________
My scripts...

Haste/Slow States for Tankentai SBS with ATB: http://www.rpgrevolution.com/forums/index....showtopic=18304 (scroll to the middle of the first post and find it under Add-ons)

Old Fashioned Game Overs http://www.rpgrevolution.com/forums/index....ic=29201&hl

Comic Book Cut Scenes http://www.rpgrevolution.com/forums/index....showtopic=30920

Force Preemptive or Surprise Battles: http://www.rpgrevolution.com/forums/index....showtopic=31668

[Show/Hide] Script Snippets written by me:
Fade Victory ME after battle end (fully compatible)
CODE
class Scene_Battle < Scene_Base
alias kill_victory_me battle_end
def battle_end(result)
RPG::ME.fade(500)
kill_victory_me(result)
RPG::ME.stop
end
end

Simple footsteps sound: Note Knock is a pretty terrible footstep sound, you should download your own.
CODE
class Game_Party < Game_Unit
alias footsteps_on_player_walk on_player_walk
def on_player_walk
footsteps_on_player_walk
RPG::SE.new("Knock", 1, 150).play
end
end

More to come as I think of them.
Go to the top of the page
 
+Quote Post
   
 
Start new topic
Replies (1 - 3)
AlphaWhelp
post Jun 22 2009, 03:03 PM
Post #2


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Developer
RM Skill: Skilled




Nobody's interested? I thought this would be an insanely useful script for anyone trying to event a preemptive or surprise battle.

Oh well.


__________________________
My scripts...

Haste/Slow States for Tankentai SBS with ATB: http://www.rpgrevolution.com/forums/index....showtopic=18304 (scroll to the middle of the first post and find it under Add-ons)

Old Fashioned Game Overs http://www.rpgrevolution.com/forums/index....ic=29201&hl

Comic Book Cut Scenes http://www.rpgrevolution.com/forums/index....showtopic=30920

Force Preemptive or Surprise Battles: http://www.rpgrevolution.com/forums/index....showtopic=31668

[Show/Hide] Script Snippets written by me:
Fade Victory ME after battle end (fully compatible)
CODE
class Scene_Battle < Scene_Base
alias kill_victory_me battle_end
def battle_end(result)
RPG::ME.fade(500)
kill_victory_me(result)
RPG::ME.stop
end
end

Simple footsteps sound: Note Knock is a pretty terrible footstep sound, you should download your own.
CODE
class Game_Party < Game_Unit
alias footsteps_on_player_walk on_player_walk
def on_player_walk
footsteps_on_player_walk
RPG::SE.new("Knock", 1, 150).play
end
end

More to come as I think of them.
Go to the top of the page
 
+Quote Post
   
SuperMega
post Jun 22 2009, 03:46 PM
Post #3


Public memberTitle(String n)
Group Icon

Group: Revolutionary
Posts: 683
Type: Developer
RM Skill: Skilled




Nice script you got here AlphaWhelp! It's a shame no one commented! Thanks for the nice script!


__________________________
Translated Scripts:
Diagonal Movement (Eight Direction) and Smooth Jumping
Attack Party, Heal Enemies
Display Party Status On Map (DQ Style)
Display Maps Under Maps
Save Screen Customization
Subtitled Menus

If you want to suggest a translation for something, PM me, and I'll take a look. I AM TRYING TO GIVE AWAY LOCKERZ.com INVITES, SO PLEASE LET ME KNOW IF YOU WANT ONE.
Currently Working on 2 RPG Maker VX Projects. They are very unique, and have a different kind of style then the usual RPGs. So don't think of them as just another RPG. Did that sound rude? :D Not sure if I want them to go public yet, but we'll see how it goes.
Need a script translated? Come talk to me, and I'll see what I can do.
Go to the top of the page
 
+Quote Post
   
AlphaWhelp
post Jun 22 2009, 05:02 PM
Post #4


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Developer
RM Skill: Skilled




QUOTE (SuperMega @ Jun 22 2009, 07:46 PM) *
Nice script you got here AlphaWhelp! It's a shame no one commented! Thanks for the nice script!

Thanks. Considering how easy it was to write this script, I'm very surprised nobody beat me to it (I couldn't find anything like it).


__________________________
My scripts...

Haste/Slow States for Tankentai SBS with ATB: http://www.rpgrevolution.com/forums/index....showtopic=18304 (scroll to the middle of the first post and find it under Add-ons)

Old Fashioned Game Overs http://www.rpgrevolution.com/forums/index....ic=29201&hl

Comic Book Cut Scenes http://www.rpgrevolution.com/forums/index....showtopic=30920

Force Preemptive or Surprise Battles: http://www.rpgrevolution.com/forums/index....showtopic=31668

[Show/Hide] Script Snippets written by me:
Fade Victory ME after battle end (fully compatible)
CODE
class Scene_Battle < Scene_Base
alias kill_victory_me battle_end
def battle_end(result)
RPG::ME.fade(500)
kill_victory_me(result)
RPG::ME.stop
end
end

Simple footsteps sound: Note Knock is a pretty terrible footstep sound, you should download your own.
CODE
class Game_Party < Game_Unit
alias footsteps_on_player_walk on_player_walk
def on_player_walk
footsteps_on_player_walk
RPG::SE.new("Knock", 1, 150).play
end
end

More to come as I think of them.
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: 18th May 2013 - 11:22 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker