Main
Projects
Art
Music
Scripting
LiveJournal
Forum
Links
Back Attack
by Aethereal

This is a way of pretending the hero has been ambushed. It's well-commented; all I have to say is that you need to be very careful about changing the settings to fit your game. There's a lot to change here.


#You will need one script for each map that has random fights on it...fortunately, most of
#this script can be copied and pasted. The only real thing that might be different among
#maps is the random number set to variable "b".

#Set this script to be run as 'instead-of-battle' in the map editor. 
include, plotscr.hsd 
include, mygame.hsi 

define script (1, Back Attack, 0) 

script, Back Attack, begin 
variable (i) 
variable (b) 
variable (bob) 
#You will need to make an additional variable for each character in your game. 
variable (james) 
variable (dusty) 
#Yes, I used Wandering Hamster names for example purposes :) 
set variable (i, random (1, 5)) 
if(i == 1, or, i == 2, or, i == 3, or, i == 4) 
then( 
set variable (b, random (4, 11)) #Change this as appropriate. 
fight formation (b) 
) 
if (i == 5) 
then( 
set variable (bob, get hero stat(find hero (hero:bob), stat:defense, current stat)) 
set variable (james, get hero stat(find hero (hero:james), stat:defense, current stat)) 
set variable (dusty, get hero stat(find hero (hero:dusty), stat:defense, current stat))
#This is setting the variables to the characters' defense. 
set hero stat (find hero (hero:bob), stat:defense, bob / 2, current
stat) 
set hero stat (find hero (hero:james), stat:defense, james / 2, current stat)
#This halves the characters' defense stats. 
set hero stat (find hero (hero:dusty), stat:defense, dusty / 2, current stat)
#You can add other penalties if you wish. 
#Additionally, to add to the "back attack" feel, you can add scripting
#that changes your hero's pictures to a reverse of their regular graphics. 
suspend player 
suspend box advance 
show text box (162) #It says "You have been ambushed". 
wait (30) 
advance text box 
fight formation (random(4, 11)) #Again, alter for your map. 
resume player 
resume box advance 
set hero stat (find hero (hero:bob), stat:defense, bob, current stat) 
set hero stat (find hero (hero:james), stat:defense, james, current stat) 
set hero stat (find hero (hero:dusty), stat:defense, dusty, current stat)
#Sets stats back to normal! 
end 
end 

Site layout (c)2000 Jennifer Raby. Used by permission.