Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

What's wrong with my script?

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Eggheadcheesybird
Peshwari Naan.




Joined: 03 Apr 2008
Posts: 2
Location: Hertfordshire

PostPosted: Thu Apr 03, 2008 12:01 pm    Post subject: What's wrong with my script? Reply with quote

Complete newbie, just started playing with this program a few days ago:

Code:
include, plotscr.hsd
include, cw.hsi

define script (1,castlegroundsbattle,none)
define script (2,castlegroundsentrance,none)

script,castlegroundsbattle,begin
variable(fight)
if(checktag(8)==off) then (show text box(2),set tag(8,on),setvariable(fight,random(0,2))
else (setvariable(fight,random(0,5))
if((fight>>2)&&(checktag(9)==off)) then (show text box(3))
fight formation(fight)
end

script,castlegroundsentrance,begin
if (checktag(5)==OFF) then (show text box(22),set tag(5,ON))
end


It's probably something really obvious but I've been over it again and again and I just can't see it.

The error when I try to compile is "Perhaps castlegroundsbattle has an extra begin"... I couldn't find one, though.
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Moogle1
Scourge of the Seas
Halloween 2006 Creativity Winner
Halloween 2006 Creativity Winner



Joined: 15 Jul 2004
Posts: 3377
Location: Seattle, WA

PostPosted: Thu Apr 03, 2008 12:35 pm    Post subject: Reply with quote

Mismatched parentheses. The line should read:

Quote:
if(checktag(8)==off) then (show text box(2),set tag(8,on),setvariable(fight,random(0,2)))
else (setvariable(fight,random(0,5)))


It'd be easier for you to work with if you made it look like this:

Code:
script,castlegroundsbattle,begin
variable(fight)
if(checktag(8)==off) then
(
  show text box(2)
  set tag(8,on)
  setvariable(fight,random(0,2))
)
else
(
  setvariable(fight,random(0,5))
)
if((fight>>2)&&(checktag(9)==off)) then (show text box(3))
fight formation(fight)
end

script,castlegroundsentrance,begin
if (checktag(5)==OFF) then
(
  show text box(22)
  set tag(5,ON)
)
end


Hope that helps!
_________________
Back to top
View user's profile Send private message Visit poster's website AIM Address
Eggheadcheesybird
Peshwari Naan.




Joined: 03 Apr 2008
Posts: 2
Location: Hertfordshire

PostPosted: Thu Apr 03, 2008 2:39 pm    Post subject: Reply with quote

Ach. And I thought I'd tried that too.

This serves me right for trying to be the big fancyman with iddy little bits of code all squashed together in there with all the things and the horror and terrible, terrible affliction never did fully regain the use of his left toe you know blaaaarrrrcgghhhe.

So, yes. Thank you, it's fine now.
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP! All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group