Post new topic    
King Slime
Send private message
Kill It With Fire(Ball)! 
 PostFri Jan 06, 2012 1:47 am
Send private message Reply with quote
The title refers to what I want to do to the compiler. Mad

The script keeps saying that Check Fireball Mana has an extra begin. I can't find the problem.

Code:
plotscript, fireball animation, begin
   check fireball mana
   if (check tag(2) == OFF) then (
   end
   
   else
   
   $action = "Velus casted Fireball!"
   update action
   set NPC position(0,11,4)
   alter NPC(0,NPCstat:move speed,10)
   walk hero(me,left,1)
   wait for hero(me)
   set hero frame(me,0)
   set hero picture(me,6,outside battle)
   set hero direction(me,down)
   wait(5)
   set hero frame(me,1)
   wait(5)
   set hero frame(me,0)
   set hero direction(me,left)
   wait(5)
   set hero frame(me,1)
   wait(5)
   set hero direction(me,up)
   set hero picture(me,2,outside battle)
   wait(5)
   alter NPC(0,NPCstat:picture,7)
   alter NPC(0,NPCstat:palette,3)
   suspend obstruction
   walk NPC(0,left,8)
   fireball attack
   alter NPC(0,NPCstat:picture,0)
   alter NPC(0,NPCstat:palette,0)
   set NPC position(0,8,0)
   resume obstruction
   set hero direction(me,left)
   walk hero(me,right,1)
   wait for hero(me)
   set hero direction(me,left)
   end
   
plotscript, fireball attack, begin
   variable(fireball base)
   variable(FBchance)
   fireball base := 4
   FBchance := random(1,10)
   
   increment (fireball base,magic)
   decrement (fireball base, EOne defense)
   
   hit or miss := random(1,5)
   
   increment(hit or miss,accuracy)
   decrement(hit or miss,EOne agility)
   
   if (FBchance << 10) then (increment(hit or miss,luck))
   if (hit or miss <<5>> 5), then
        else
   decrement(enemy one current health,fireball base)
   $action = "The fireball hit!"
   update action
   $action = "The fireball did"
   wait(5)
   update action
   
   end
   
         plotscript, check fireball mana, begin
   if (black mage current mana >> 5), then
        set tag (2,OFF)
   $action = "Fireball fizzles!"
   update action
   wait (15)
   $action = "You need 5 Mana to use it!"
   update action
   set tag (2,OFF)
   
   else (
   
   set tag (2,ON)
   
   end
   
plotscript, attack miss, begin
   set NPC position(0,3,3)
   alter NPC(0,NPCstat:picture,12)
   $action = "The attack missed!"
   update action
   wait(25)
   alter NPC(0,NPCstat:picture,0)
   set NPC position(0,8,0)
   end


If you spot any more errors, feel free to fix them.
Metal Slime
Send private message
 
 PostFri Jan 06, 2012 1:55 am
Send private message Reply with quote
can you post the actual "check fireball mana" script?
King Slime
Send private message
 
 PostFri Jan 06, 2012 1:59 am
Send private message Reply with quote
Whoops, I left out part of the script. I fixed it. >XD
Liquid Metal King Slime
Send private message
 
 PostFri Jan 06, 2012 4:07 am
Send private message Reply with quote
I think the problem is the way you are doing "else". You seem to be leaving out parenthesis (which is the same a leaving out begins and ends)

Here is how I write mine:

Code:

if(condition) then(
  # action
)else(
  # alternative
)


which is exactly the same as:

Code:

if(condition) then, begin
  # action
end, else, begin
  # alternative
end


But I don't recommend that second way. it is ugly.

Also, I notice that you have some ifs where the "then" is completely empty. it is legal to do this:

Code:

if(condition) else(
  # alternative
)


And another way to get the same effect is:

Code:

if(not(condition)) then(
  # alternative
)
Display posts from previous: