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

script trouble

 
Post new topic   Reply to topic    Castle Paradox Forum Index -> HELP!
View previous topic :: View next topic  
Author Message
Laven Atries
Starmaster




Joined: 21 Mar 2003
Posts: 11

PostPosted: Mon Apr 21, 2003 9:04 pm    Post subject: script trouble Reply with quote

In my game, I'm trying to make and NPC that, when you talk to him once, he'll say text62, and then text63. talk to him again and he says text62 then text65. talk again and text62 then text 67. again and text62 then text69. talk again and text62 and text71. At this point I want it to do text62 then text71 for the next 6 times you talk to him. At that point it goes text62, text71,text72,text71,text73,text74,text75. Now if you talk to him he says text78. That's the idea, and I know it probably seems complicated. When I thought of it, it certainly seemed like it would be easy to do, but that's when I remembered how little I know about how this thing works. Anyway, here's the script I've got, but it simply skips straight to text78.

include, plotscr.hsd
include, 2KNIGHTS.HSI

global variable (1,oldmanc)

DEFINE SCRIPT (4,oldman,none)
script, oldman, begin
if (checktag(15=off))
then(
show text box (62)
wait for text box
show text box (63)
set tag(15,on)
)
else(
if (checktag(16=off))
then(
show text box (62)
wait for text box
show text box (65)
set tag(16,on)
)
)
else(
if (checktag(17=off))
then(
show text box (62)
wait for text box
show text box (67)
set tag(17,on)
)
)
else(
if (checktag(18=off))
then(
show text box (62)
wait for text box
show text box (69)
set tag(18,on)
)
)
else(
if (checktag(19=off))
then(
show text box (62)
wait for text box
show text box (71)
set tag(19,on)
)
)
else(
if (checktag(20=off))
then(
while (oldmanc << 7)
do(
show text box (62)
wait for text box
show text box (71)
wait for text box
oldmanc==oldmanc+1
)
show text box (72)
wait for text box
show text box (71)
wait for text box
show text box (73)
wait for text box
show text box (74)
wait for text box
show text box (75)
set tag(20,on)
)
)
else(
show text box (78)
)
end



so, can anyone tell me what I can do to fix it? I'd greatly appreciate whatever help you can offer.

-Laven Atries
_________________
Oro?


Last edited by Laven Atries on Tue Apr 22, 2003 12:09 am; edited 1 time in total
Back to top
View user's profile Send private message
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Mon Apr 21, 2003 10:43 pm    Post subject: Reply with quote

Have you checked the NPC? Are you certain it runs the script and not a textbox (particularly, 11)? Make sure of that, and make sure you don't have any in-game textbox links. There is no reason why it should trigger "text11", unless the NPC is set so that it does.

Regarding the script, I saw some problems here:

if (checktag(20=off))
then(
while (oldmanc << 7)
do(
show text box (62)
wait for text box
show text box (71)
wait for text box
oldmanc==oldmanc+1
)

You would probably run into some problems with that script, especially the "while" loop (since the "while" loop loops until its arguments are fulfilled, thus repeating the textbox infinitely, due to an important problem in your script). A better version for that would be this (I wrote it in my own format, just because it's easier for me that way):

if (checktag(20=off))
then,begin
if (oldmanc << 7)
then,begin
show text box (62)
wait for text box
show text box (71)
wait for text box
oldmanc:=oldmanc+1
end
end

Typing "oldmanc==olmanc+1" will not increment the variable by one, but rather would check to see if it was itself plus one (which would obviously return false). A setvariable command would be best used for this, though many people use its shortcut, ":=". I usually don't, but I firgured I should note that typo. The "while" loop just wouldn't work for this, as it would simply show those two textboxes six times without pause. An "if, then" would work much better.

Well, that's all that I noticed. I hope you can get this to work!
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Blazes Battles Inc.
I'm a chimp, not a




Joined: 25 Jan 2003
Posts: 505

PostPosted: Tue Apr 22, 2003 12:20 am    Post subject: Reply with quote

Also, remember that 'check tag (# == off)' will not work. It has to be 'check tag (#) == off'.
_________________
Preserve OHR history! Do it for the children!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Uncommon
His legend will never die




Joined: 10 Mar 2003
Posts: 2503

PostPosted: Tue Apr 22, 2003 4:26 am    Post subject: Reply with quote

Right, I missed that one... If I could run that script through HSPEAK, I could tell you anything that's wrong with it...
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
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