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

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Oct 25, 2005 2:36 am Post subject: I know the question is stupid but... |
|
|
I know it can seem stupid
Could somoene tell me where those scripts goes ?
I think the first one go inside lunafollowsme my on-keypressed script
Code:
variable(waiting)
waiting:= true
while(waiting) do, begin
if(key is pressed(any key)) then (waiting:= false)
wait(1) #really important!!!!!1
end
But what about this one below ? Shall it be included in my keyboard script ?(= the script on which I put many if key is pressed commands)
Or may be shall I put it independant with an autonumber ?
while(true) do, begin #loop forever (make sure it's only launched once!!!!!!!)
if(check tag(tag:asc), and, key is pressed(any key)) then, begin
#... put the conditionals in here
end
wait(1) #really really really ... important.
end
As always thanks very much for the help, it's very useful ! |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Oct 30, 2005 6:11 am Post subject: Could somoene help me writing the code ? |
|
|
I think using a loop to call use my keyispressed from another script is what I need but I don't see how to write the script. My keyispressed script is constant (because I want a npc pet to follow my hero) and the keyboard make my keyboarded customed (allowing the player to do more thing pressing the keys) so that may explain the overloading problems....
Anyway :
1) can somoene write me some suggestions with the loop ?
2) I tried to use the while loop with my keyboard script but It frozen the game. The player couldn't do anthing (even pressing esc has no effect)
I didn't make sure that my script is launch only once because I don't know how to check it. Can somoene explain me how to check a script is launched once ?
As always thanks for the help, I am sure it will useful!(as it is always) |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Sun Oct 30, 2005 2:25 pm Post subject: |
|
|
You don't recall anything of what I wrote, do you?
You don't needan on-key-press script, if you trigger the second bit of code somewhere, and put your checks in.
So, reviewing what I said:
| Code: | script, keyloop, begin
while(true) do, begin #loop forever (make sure it's only launched once!!!!!!!)
if(check tag(tag:asc), and, key is pressed(any key)) then, begin
#... put the conditionals in here
end
wait(1) #really really really ... important.
end
end |
If you put that in a script, and add whatever conditionals you want, using key is pressed, and call it from the new-game/load-game scripts, it will work. _________________ 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: Fri Nov 04, 2005 4:59 am Post subject: Sorry again but could somoene tell me... |
|
|
Ok! I put those lines into my load game script
| Code: | while(true) do, begin #loop forever (make sure it's only launched once!!!!!!!)
if(check tag(tag:asc), and, key is pressed(any key)) then, begin
#... put the conditionals in here
if key is pressed (key:r) then, begin
jumpscript
end
if key is pressed (kez:z)then, begin
getquickscript
end
wait(1) #really really really ... important.
end |
When I compile, hssed says that true is always valid
Can I use the following lines in my getquick script, or jump script ?
| Code: | variable(waiting)
waiting:= true
while(waiting) do, begin
if(key is pressed(any key)) then (waiting:= false)
wait(1) #really important!!!!!1
end |
Could somoene make a little schema for the loops and while loop as The Mad Cacti did for me with the if commands (see above for more details) ?
It will be really useful as it's the first I use loop or while loops !
| Code: | if (something)
then (do something)
then (do something more)
then (do even more)
if (is it A?)
then (is A)
else (
if (is it B?)
then (not A, is B)
)
else (
if (is it C?)
then (not A or B, is C)
) |
As many people know I am very good to make myself missunderstood. So feel free to ask further questions you don't see what I mean.
As always thanks very much for the help ! |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Sat Nov 05, 2005 9:44 am Post subject: |
|
|
Ok. The master loop (the one in the new game script):
| Code: | while(true) do ( #loop forever
if(listening for keys) then (
if(a key is pressed that we care about) then (do something)
)
wait a second, so the engine doesn't freeze up
) |
HSPEAK will complain about the while(true) bit, since it's saying "Erm, it won't evar finish". You can safely ignore it, or you can put a variable in that's set to true, and use that instead.
As for the second script, yes you can. But, what are you trying to do? That script will wait until the user presses any key. But, the same thing can be accomplished with a simple "wait for key". _________________ 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 Nov 06, 2005 8:43 am Post subject: |
|
|
I have the following error message
Please report this exact [...] when it happened
OHRRPGCE player ruskala 20051003
memory info 238560 44728 1980 43928
executable: .exe
rpg file d:\sailor~1\sailor.rpg
error code 9
subscript out of range in line no line number in module game at address 0e20 :c1517
Hit any key to return to the system
My questions will obviously be
1) what does the error means ?
2) what in scripts can cause this kind of errors ?
I don't know if it has something to do with it but I've modified a bit the while true command. I didn't want to use while (true) to prevent hssed from looping. (It would have said that the conditions implied by true is always valid) Here is the new version
| Code: |
#the whileloop make me able to launch sub scripts all along the game and make me able to customize the keyboard
script, whileloop for keyboard, begin
set tag (tag:asc, ON) # by the way, what "asc" is the shortcut of ?
loopkey:=true
while (loopkey) do, begin
if (check tag (tag:asc), and, key is pressed (any key)) then, begin
if (key is pressed(key: z)) then, begin
set tag (tag:acc, ON)
wait (1)
my keyboard getquick
end
#Key is pressed z to get quick
if (key is pressed(key: numlock)) then, begin
set tag (tag:pause, ON)
wait(1)
my keyboard pause
end
#Key is pressed numlock to make a pause
if (key is pressed(key: r)) then, begin
my keyboard jump
end
#Key r is pressed to make the hero jump
wait (1) #wait 1 is very very important
if(checktag(tag:luna follows me)==on) then, begin
lunafollowsme
end
if(checktag(tag:artemis follows me)==on) then, begin
lunafollowsme
end
wait (1)
loopkey:=false
end #end of the while (true) command
end #end of the if check tag
end #end of the plotscript |
To finish the while loop does not start in my new game script so to speak.
To be presice when my game starts the script "introduction" loads then "chapter1" and then "while loop" (see above for more details)
As "chapter1" starts at the end of "introduction" and as "whileloop" starts when "chapter1" is finished there shall be not problem. I don't call any script that is already inside a script. I use three scripts to prevent scripts from beeing too big.
Could somoene confirm me that there will be no problems with the while loop launching scripts this way ?
Feel to post as many infos and suggestions in your post . Feel also free to ask further details if you don't see what I want . |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Sun Nov 06, 2005 6:53 pm Post subject: |
|
|
(Side note: Luna and artemis? Is your game a Sailor Moon game? *checks the gamelist* oh, so it is... heh)
| bis_senchi wrote: | I have the following error message
Please report this exact [...] when it happened
OHRRPGCE player ruskala 20051003
memory info 238560 44728 1980 43928
executable: .exe
rpg file d:\sailor~1\sailor.rpg
error code 9
subscript out of range in line no line number in module game at address 0e20 :c1517
Hit any key to return to the system
My questions will obviously be
1) what does the error means ?
2) what in scripts can cause this kind of errors ? |
Hmm, that bug... we've been getting a crash on an unknown plotscripting command in rusalka (and, previous versions). We fixed it, but I don't have a new copy of GAME to see if this is the same bug. I'm working on it, though.
| bis_senchi wrote: | I don't know if it has something to do with it but I've modified a bit the while true command. I didn't want to use while (true) to prevent hssed from looping. (It would have said that the conditions implied by true is always valid) Here is the new version
| Code: |
#the whileloop make me able to launch sub scripts all along the game and make me able to customize the keyboard
script, whileloop for keyboard, begin
set tag (tag:asc, ON) # by the way, what "asc" is the shortcut of ?
loopkey:=true
while (loopkey) do, begin
if (check tag (tag:asc), and, key is pressed (any key)) then, begin
if (key is pressed(key: z)) then, begin
set tag (tag:acc, ON)
wait (1)
my keyboard getquick
end
#Key is pressed z to get quick
if (key is pressed(key: numlock)) then, begin
set tag (tag:pause, ON)
wait(1)
my keyboard pause
end
#Key is pressed numlock to make a pause
if (key is pressed(key: r)) then, begin
my keyboard jump
end
#Key r is pressed to make the hero jump
wait (1) #wait 1 is very very important
if(checktag(tag:luna follows me)==on) then, begin
lunafollowsme
end
if(checktag(tag:artemis follows me)==on) then, begin
lunafollowsme
end
wait (1)
loopkey:=false
end #end of the while (true) command
end #end of the if check tag
end #end of the plotscript |
|
No, it doesn't have to do with the loop. The tag:asc... er, I have no idea where that came from (this topic's been dragging out for a long time now...)
However, looking at the script, it's just a tag that says "do we want to do the things in this loop or not?" It doesn't need to be tag:asc, it could be anything. It would probably be best to turn that tag off during cutscenes, however.
One last thing: You have seprate if's for Luna and Artemis, but they both do the same thing: call "lunafollowsme". Is this intentional, a mistake, or have you just not written an "artemisfollowsme" script?
If it's intentional, you can combine the ifs like this:
| Code: | if(checktag(tag:luna follows me),or,checktag(tag:artemis follows me)) then, begin
... |
Also note that you don't need to put ==on, just like in English ("If I have money" vs "If have money == yes")
| bis_senchi wrote: | To finish the while loop does not start in my new game script so to speak.
To be presice when my game starts the script "introduction" loads then "chapter1" and then "while loop" (see above for more details)
As "chapter1" starts at the end of "introduction" and as "whileloop" starts when "chapter1" is finished there shall be not problem. I don't call any script that is already inside a script. I use three scripts to prevent scripts from beeing too big.
Could somoene confirm me that there will be no problems with the while loop launching scripts this way ? |
That should be fine. However, you need to call it from your load game script too, so that it'll run all the time, not just the first time someone plays. _________________ 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: Tue Nov 08, 2005 4:19 am Post subject: ok... |
|
|
I think I will send a email ohrrpgce@HamsterRepublic.com. I wonder if this bug have been reported yet...
Anyway, could somoene confirm me something about the following code ?
| Code: | | if(checktag(tag:luna follows me),or,checktag(tag:artemis follows me)) then, begin |
I need to know if the line above launch the script if both tags are on ?
I need in my game that if one of the tags (or the two tags) are ON the plotscript launch. (If necessary I can create obviously a script called artemisfollowsme)
Anyway if anyone sees anything strange in the scripts I've posted or if you have information about the error code 9 feel to post messages with further information!
Thanks very much for the help ! |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
Posted: Tue Nov 08, 2005 11:14 am Post subject: |
|
|
Yes, it's been reported. I just said that. I just don't know if this is the same bug, and I'm working on getting James to make nightly builds so we can test it.
Anyway, if you look closely, you'll notice that it's in the form: <something>, or, <something else>
That means, if the first tag is on OR the second tag is on, do the following: ...
So, yes. If either tags are on, it'll run. _________________ 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 |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Thu Nov 10, 2005 4:35 pm Post subject: |
|
|
Just a couple of things. I must admit that the whole problem here is a bit above my head, and maybe I'm just totally misunderstanding the issue, but I don't understand why the command
loopkey:=false
is placed right before the end of the script (but within the block of code that runs only if tag:asc is on AND a key is pressed; by the way, you have your 'ends' commented backwards - the first end is the end of the if block, and the second end is the end of the while(loopkey) command).
Right now, as far as I can see, if the player presses a key while the tag:asc is on, then they may move, jump, or whatever, and then luna may follow them, but then loopkey will be turned false and the while loop will end, and so the entire script will end. Is this script getting continuously called from somewhere else? If not, then currently the custom keyboard will only work for one press of a button.
It also seems that if there is any kind of movement going on in the 'mykeyboard' scripts, or the 'lunafollowsme' scripts, then those movements MUST include wait commands that wait for the entire movement to finish (otherwise, I think that this script could get into trouble with only waiting (1) in a few places).
I hope that I'm helping more than hurting here.
EDIT:
Oh yeah, I also wanted to let you know that there is a command (or operator, or whatever they call it) that does what you were afraid of concerning the 'or'. It is called 'xor':
if(A,xor,B)
then (runs if A is true, or if B is true, but not if both are true)
else (runs if A and B both true, or if A and B both false) |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Nov 11, 2005 3:49 am Post subject: |
|
|
| pkmnfrk wrote: |
Hmm, that bug... we've been getting a crash on an unknown plotscripting command in rusalka (and, previous versions). We fixed it, but I don't have a new copy of GAME to see if this is the same bug. I'm working on it, though.
|
What? You fixed the random crashing? Nobody told me. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Fri Nov 11, 2005 6:05 pm Post subject: |
|
|
Oh that. I'm would like to revert the fx if I could fine a better one. Sigh. I really screwed up runscript. No matter what I do, more bugs appear in it. _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
Mike Caron Technomancer

Joined: 26 Jul 2003 Posts: 889 Location: Why do you keep asking?
|
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Nov 24, 2005 1:18 am Post subject: Here I come again with a new problem |
|
|
Here's my problem. When I press on pause the second part of the script (the one which goes from if (key is pressed (key: numlock)==true) then, begin to write general (54, seconds) end # end of the check tag does not launch.
I want the script to do the following :
1) The player press on pause. It makes launch the plotscript and the time current values are stored. A text box on which it's written "pause" appears. The player lost control (=The heroes cannot move) The npcs musn't move either. The are suspended too!
There comes what I don't manage to write. The script must stay launched until the player press on num lock.
3) The player press on num lock and time values are restored as they were before the script starts. The text box with "pause" in it disappear and the player regain control of the heroes. Npcs starts to wander again too. (= plotscript controls are resumed)
| Code: |
script,my keyboard pause, begin
variable (waiting)
waiting:=true
while (waiting) do, begin
if (check tag(tag:pause)==ON) then (waiting:=false), begin
suspend box advance,
suspend npcs,
#increment (pause, 13)
show text box (334),
set variable (days, hours),
set variable (minutes, seconds),
days := days of play,
minutes := minutes of play,
hours := hours of play,
seconds := read general (54),
wait for key (anykey)
end
if (key is pressed (key: numlock)==true) then, begin
#increment (pause, 13)
wait (1)
advance text box,
resume npcs,
resume box advance,
set tag(tag:pause, OFF) #permet de ne pas repéter la pause
write general (51, days),
write general (52, hours),
write general (53, minutes),
write general (54, seconds),
end # end of the check tag
if (key is pressed (key: numlock)==false) then, begin
wait (1)
wait for key (anykey)
end
end #end of the while command
end #end of the plotscript
#--------------------------------------------------------------------------- |
I know that an article intitled "What are the differences between the wait for key and the key is pressed command?" could help me because I've written and post this article on the faq board.
My problems is that those commands are so much confused in mind that I need somoene to write it for me. I don't think I can do it by myself. That's why I've posted this message.
I know that's I already asked this question four or three years ago in the old Faq message board but since then I've lost my hss file.
As a consequence I would really appreciate if somoene could write the missing part again
As always be aware that I am very good to make myself misunderstood so feel free to ask as many questions as you need if you don't understand what I mean.
Thanks very much for the help! |
|
| 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
|