 |
Castle Paradox
|
| View previous topic :: View next topic |
| Author |
Message |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Apr 22, 2005 9:12 pm Post subject: Sorry but... |
|
|
I keep on making test and the script still doesn't work. Here is the lastest version. Please tell me if you see problems!
#---------------------------------------------------------------------------
define script (63,reset code, none)
define script (64,listen for code, none)
define script (68,proceed to the HQ, none)
define script (autonumber,check for finished codes,none)
define script (autonumber,add this key,1,0)
Global variable (1,L1,2,L2,3,L3,4,L4)
Global variable (5,nextletter)
Global variable (6,L6)
#---------------------------------------------------------------------------
script, reset code, begin
show text box (371) #you have entered the wrong code try again!
wait for text box
nextletter:=1
L1:=0
L2:=0
L3:=0
L4:=0
L6:=0
end
#---------------------------------------------------------------------------
# key is pressed script
script, listen for code, begin
if(checktag(tag:enter code)==on)then, begin
#tag enter the code allow the key is pressed script not to be displayed all the time
#I use a tag here because the key is pressed script is launch all the time.
suspend Npcs
suspend player
variable (key) for (key,2, 57), do, begin
if (key is pressed(key :backspace)) then, begin
#check all scancode from "1" to SPACE
add this key (key)
end
check for finished codes
end
resume player
resume Npcs
end
end
#---------------------------------------------------------------------------
#this script is displayed by an npc so that we can enter the code
script, add this key, key, begin
suspend Npcs
suspend player
if (key==key:esc) then, begin
# if escape is pressed, reset the code
reset code
end,else,begin
# any other key is recorded
increment (nextletter)
#No differences with nextletter:= nextletter+1
if(nextletter==2) then,begin
L1:=key
then, (show text box (347))
end,else,begin
if (nextletter==3) then,begin
L2:=key
then, (show text box (352))
end,else,begin
if (nextletter==4) then,begin
L3:=key
then, (show text box (353))
end,else,begin
if (nextletter==5) then,begin
L4:=key
then, (show text box (354))
end,else,begin
if (nextletter==6) then,begin
L6:=key
then,(show text box (354))
# 4 stars box is repeated because of the enter key .
end, else, begin
reset code
end
end
end
end
show value (nextletter)
end
end
resume Npcs
resume player
end
#---------------------------------------------------------------------------
script, check for finished codes, begin
if (L1==key:S,and,L2==key:P,and,L3==key:A,and,L4==key:M,and,L6==key:enter) then, begin
show text box (370) # You have managed to enter the password! Proceed to the Hq!
wait for text box
then, (proceed to the HQ)
end
if(L1==key:Q,and,L2==key:U,and,L3==key:I,and,L4==key:T,and,L6==key:enter) then, begin
reset code
game over #end the game
end
end
#---------------------------------------------------------------------------
script, proceed to the HQ, begin
suspend player
suspend Npcs
# I put those commands here just to be sure that be code display the right way.
walk hero (0, south, 2)
wait for hero (0)
wait for text box
set tag (142, OFF)
# tag 142= tag: enter the code prevents the key is pressed from beeing displaying again and agin
resume player
resume Npcs
end
#--------------------------------------------------------------------------- |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Apr 22, 2005 9:16 pm Post subject: as it may have something to do with |
|
|
Here are all the files include in my .hs file
include, extrascripts.hsd #language definition and adds
include, sailor.hsi #game-specific include
include, scancode.hsi
May be I shall add other ones like third utilities.hsi , or replace one of them by another one...
Anyway, as always thanks very much for the help ! |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Apr 22, 2005 9:49 pm Post subject: to finish... |
|
|
To finish here is a description when the script is lanuched
When I launched the game the player moves slowly (except when the if tag is active)
I go to the npc and make it run the plotscript. then I type s, the first letter on the keyboard but the only thing happen is that the game become slow for a few minutes and then everything comes back to normal
What should happen .
Well , if I type S a text box a with one star in it should appear such as defined in the command :
if(nextletter==2) then,begin
L1:=key
then, (show text box (347)) #text box with one star in it
I hope that it will helps to understand what is wrong... |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Mon Apr 25, 2005 2:54 am Post subject: |
|
|
In the 'key is pressed' script, what is the line
if(keyispressed(key:backspace)),then
for? Why are we looking for key:backspace? It seems to me that that line ought to be:
if(keyispressed(key)),then
because the variable 'key' is the index of the 'for' loop that is supposed to be going through all of the keys from space to whatever. But maybe there is something going on that I don't understand. |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Fri Jun 17, 2005 9:07 am Post subject: Sorry to post a message again but... |
|
|
After the last tests here is what the programm said
When I want to enter a password using the following script there is an message error that says: "script buffer overflow 32712" fail to load indirect script
The problems may be :
A wrong if statement does somoene sees below a if statement that looks wrong ?and or a missing tab on the nextletter value that would explain why the increment nextletter make the script buffered and overflowed. Could somoene help me to define an tab for the increment letter command ? (the plotscript dictionnary does not speak at all about tabs)
#---------------------------------------------------------------------------
define script (63,reset code, none)
define script (64,listen for code, none)
define script (68,proceed to the HQ, none)
define script (autonumber,add this key,1,0)
define script (autonumber,check for finished codes,none)
#---------------------------------------------------------------------------
script, reset code, begin
show text box (371)
wait for text box
nextletter:=1
L1:=0
L2:=0
L3:=0
L4:=0
L6:=0
end
#---------------------------------------------------------------------------
#This script make possible entering the code
script, add this key, key, begin
suspend Npcs
suspend player
if (key==key:backspace) then, begin
# if backspace is pressed, reset the code
reset code
end,else,begin
# any other key is recorded
increment (nextletter)
#No differences with nextletter:= nextletter+1
if(nextletter==2) then,begin
L1:=key
(show text box (347))
end,else,begin
if (nextletter==3) then,begin
L2:=key
(show text box (352))
end,else,begin
if (nextletter==4) then,begin
L3:=key
(show text box (353))
end,else,begin
if (nextletter==5) then,begin
L4:=key
(show text box (354))
end,else,begin
if (nextletter== then,begin
L8:=key
(show text box (354)) #repéter la text box a 4 étoiles.
end, else, begin
# too many keys pressed, start again
reset code
end
end
end
end
show value (nextletter)
end
end
resume Npcs
resume player
end
#---------------------------------------------------------------------------
script, check for finished codes, begin
if (L1==key:S,and,L2==key:P,and,L3==key:A,and,L4==key:M,and,L6==key:enter) then, begin
show text box (370) # You have managed to enter the password! Proceed to the Hq!
wait for text box
then, (proceed to the HQ)
end
if(L1==key:Q,and,L2==key:U,and,L3==key:I,and,L4==key:T,and,L6==key:enter) then, begin
reset code
game over #end the game
end
end
#---------------------------------------------------------------------------
#this script key is pressed script-> displayed by an Npc
script, listen for code, begin
if(checktag(tag:enter code)==on)then, begin
#tag enter the code allow the key is pressed script not to be displayed all the time
#I use a tag here because the key is pressed script is launch all the time.
suspend Npcs
suspend player
variable (key)
while (key is pressed (key: esc)==false) do, begin
for (key,2, 57), do, begin
if (key is pressed (key)) then, begin
#check all scancode from "1" to SPACE
add this key (key)
end
check for finished codes
end
end
resume player
resume Npcs
end
end
#---------------------------------------------------------------------------
#if this script is launched then the plotscripts works well.
script, proceed to the HQ, begin
suspend player
suspend Npcs
walk hero (0, south, 2)
wait for hero (0)
wait for text box
set tag (142, OFF)
resume player
resume Npcs
end
#---------------------------------------------------------------------------
As always thanks very much for the help !
Sorry for posting a message again. |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Sun Jun 19, 2005 6:33 am Post subject: |
|
|
Since this thread started, there's a better way to do this: inputstring(). However, I'm adding some more commands to do this properly. Specifically, I'm adding more string manipulation commands, such as ucase(), lcase(), string compare(), etc. I'll post more in a bit. _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Jun 19, 2005 10:55 pm Post subject: Ok! no problems |
|
|
All right! I am sure this script will help me a lot because I start to be fed up with testing this plotscript for more than three and seeing it overlowing over and over again whatever changes I put in it!
I wonder how the plotscripter who has posted it on Moogle1's website managed to make it work on his (or her) game....
Anyway thanks very much for posting the message !
That's sound relieving! |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Mon Jun 20, 2005 9:33 am Post subject: |
|
|
Unfortunately, right now, my working copy of the OHR explodes when battles happen. That's why we don't have a WIP for it yet.
The code is going through a large re-factoring, and I blame that for breaking everything, however... _________________ I stand corrected. No rivers ran blood today. At least, none that were caused by us.
Final Fantasy Q
OHR Developer BLOG
Official OHRRPGCE Wiki and FAQ |
|
| Back to top |
|
 |
|
|
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
|