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

Too many conditions, too many problems

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Thu Jul 08, 2004 12:01 pm    Post subject: Too many conditions, too many problems Reply with quote

I have a script that messes up badly. When triggered, its supposed to let you pick ONE character and check something. However, due to a large amount of conditions, it checks both people. Can anyone tell me what's wrong?

Code:

script, CCcheck, begin
set variable (savex, herox (me))
set variable (savey, heroy (me))
set variable (savemap, current map)
variable (i)
set variable (i, pickhero)
if (herobyslot (i)==hero:beefzokbw, and, beefzokup>= 100,
 and,
 beefzokup<=300,
 and,
 tag: beefzoklv1==true,
 or,
herobyslot (i)==hero:beefzokbw,
and,
 beefzokup>=300,
 and,
 tag:beefzoklv2==true)
 then
 (
teleport to map (map: beefzok's classes, 8, 6)
)
else
(
showtextbox (119)
wait for textbox
if (beefzokup<=49) then
(
showtextbox (120)
wait for textbox
)
else
(
showtextbox (121)
wait for textbox
)
)
if (herobyslot (i)==hero:pierabh, and, pieraup>= 100,
 and,
 pieraup<=300,
 and,
 tag: pieralv1==true,
 or,
herobyslot (i)==hero:pierabh,
and,
 pieraup>=300,
 and,
 tag:pieralv2==true)
 then
 (
teleport to map (map: piera's classes, 8, 6)
)
else
(
showtextbox (122)
wait for textbox
if (beefzokup<=49) then
(
showtextbox (120)
wait for textbox
)
else
(
showtextbox (121)
wait for textbox
)
)
end
Back to top
View user's profile Send private message
KainMinter
*~*




Joined: 10 Jan 2004
Posts: 155
Location: Austin

PostPosted: Thu Jul 08, 2004 5:02 pm    Post subject: Reply with quote

i don't know if this will help, but try finding a way to seperate all of those ands from the or that is floating in there.


a simple and crude example::

instead of this
if (a and
b and
c and
d or
e and
f and
g)
then(do+++)
else(do***)

try doing this
if (a and b and c and d)
then(do+++
set variable already_ok)

if (e andf and g)
then (do+++
set variable already_ok)

if (already_ok was not activated)
then(do***)
Back to top
View user's profile Send private message
*Worthy*
Critical Thinker




Joined: 11 Aug 2003
Posts: 186

PostPosted: Thu Jul 08, 2004 7:06 pm    Post subject: Reply with quote

The command "if (beefzokup<=49)" runs no matter which hero is picked. That should be your problem.

~Worthy
_________________
You can do whatever you want...but prison is full of people who make bad decisions.
Back to top
View user's profile Send private message Send e-mail AIM Address
Dan the Man Entertainment




Joined: 31 May 2003
Posts: 204

PostPosted: Thu Jul 08, 2004 7:15 pm    Post subject: Reply with quote

I got the problem fixed. That extra "beefzokup" in piera's script was another problem that needed to be dealt with. It turns out my script wasn't being specific enough. I needed another "If(herobyslot....." command after the first one. Otherwise, it would check the next person if the first one wasn't eligible for a class change and completely forget who was chosen.
Back to top
View user's profile Send private message
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