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

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Mon Apr 06, 2009 10:48 pm Post subject: I've downloaded the wip and... |
|
|
I've downloaded the Nighly Built Version of Hspeak.exe and the command is regonised! Hourra!
The problem now is that when I test, nothing happens on screen
I've made the following test script to to work on the command. Could somoene tell me if she/he see something wrong?
| Code: |
script, test2, begin
variable (box)
box := create rect (300, 180, 0)
center slice(box)
set rect trans(box, true)
wait (9)
#delete the box
free slice (box)
end #end for the script
|
_________________ It's time to make games! |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Apr 12, 2009 4:32 am Post subject: So? Could somoene help me? |
|
|
So? Could somoene help me? I can't understand why the command "create rect" doesn't work!
As always thanks, for the help! _________________ It's time to make games! |
|
| Back to top |
|
 |
TwinHamster ♫ Furious souls, burn eternally! ♫

Joined: 07 Mar 2004 Posts: 1352
|
Posted: Sun Apr 12, 2009 4:56 am Post subject: |
|
|
The Nightly HSpeak only works with the Nightly CUSTOM/GAME.
(Or rather, it only works properly in the Nightly CUSTOM/GAME)
So you'll want to make sure you're using those. |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Sun Apr 12, 2009 10:48 pm Post subject: It better using the wip version of game.exe indeed! |
|
|
| TwinHamster wrote: |
The Nightly HSpeak only works with the Nightly CUSTOM/GAME.
(Or rather, it only works properly in the Nightly CUSTOM/GAME) |
Indeed! I should have realised it by myself! Sorry for asking this!
Here is a new version of my menu script
| Code: |
script,menu,textbox used=87,number of lines=3, backcolor=0, textcolor=15, choice color=5,x=160,y=100,spacing=8,begin
#Initialization of the menu
variable(MenuChoice,temp)
variable (sub_menu)
if(numberoflines<<4)then(numberoflines:=4) #We want to make sure that the minimum lines is 4
number of lines:=numberoflines--1
#The actual numbering is 0 based, not 1 based, meaning if the number of lines is 2, the count is 0, 1; not 1,2
menuchoice:=0 #default choice is 0 that is to say the first line , case (0) (see below)
sub_menu:=menuchoice
#this step clears the number of strings based on the number of lines.
#EX: number of lines = 2, it will clear string 0, 1; so if there are 8 lines menu choices, string
#0-7 will be cleared, so make sure you don't use those for anything important
for(temp,0,numberoflines)do(
if(backcolor>=1)then( #Since you cannot provide backcolor for outline style strings,
stringstyle(temp,string:flat) #its important to change the string style to flat
stringcolor(temp,textcolor,backcolor)
)else(stringcolor(temp,textcolor))
clearstring(temp)
#FREE SLICE (BOX) here?
stringfromtextbox(temp,textboxused,temp)
centerstringat(temp,x,y) #Change this to showstringat(temp,x,y) to make the menu be left-aligned
variable (box)
box := create rect(140, 50, 0)
center slice (box)
set rect trans(box, true)
increment(y,spacing)
#vertical space between each string has to be >= 8, otherwise the strings will overlap
end
#highlights the default choice
stringstyle(menuchoice,string:flat)
stringcolor(menuchoice,textcolor,choicecolor)
#main loop, this is where all the menu browsing happens
while(keyispressed(key:enter)==false)do(
if(keyispressed(key:up))then( #Behavior for up key
while(keyispressed(key:up))do(wait(1)) #This turns off key repeat
if(menuchoice>>0)then( #makes sure that the menu cursor stays in place and doesn't go overboard
if(backcolor>>0)then(
stringstyle(menuchoice,string:flat)
stringcolor(menuchoice,textcolor,backcolor)
)else(stringstyle(menuchoice,string:outline))
decrement(menuchoice)
decrement (sub_menu)
stringstyle(menuchoice,string:flat)
stringcolor(menuchoice,textcolor,choicecolor)
end
end
if(keyispressed(key:down))then( #Behavior for down key
while(keyispressed(key:down))do(wait(1)) #This turns off key repeat
if(menuchoice<<numberoflines)then( #makes sure that the menu cursor stays in place and doesn't go overboard
if(backcolor>>0)then(
stringstyle(menuchoice,string:flat)
stringcolor(menuchoice,textcolor,backcolor)
)else(stringstyle(menuchoice,string:outline))
increment(menuchoice)
increment(sub_menu)
stringstyle(menuchoice,string:flat)
stringcolor(menuchoice,textcolor,choicecolor)
end
end
wait(1) #very important prevents the menu from moving down
end
return(menuchoice) #returns the value of MenuChoice
#clears the strings we just used
for(temp,0,numberoflines)do(
hidestring(temp)
clearstring(temp)
end
Switch (sub_menu) do(
case(0)do(show text box (90)
sub_menu:=0) #submenu:=0 => reset sub menu
case(1)do(show text box (89)
sub_menu:=0)
case(2)do(show text box (88)
sub_menu:=0)
case(3)do(
show text box (80) #allows to leave the game
sub_menu:=0)
case(-1)do(
return(menuchoice),
#clears the strings we just used
for(temp,0,numberoflines)do(
hidestring(temp)
clearstring(temp)
#wait for text box
) #end for for.. do
) #end for the switch
) #end for case (-1)
resume player #allows game to came back to normal
end #end of the plotscript
|
I managed to make appear the box correctly by I don't see where to put the free slice (box) lines so if you have some advice....
I also have another question about clearing strings. It is explained in the commentary that strings are automatically cleared basing on the number of line but when I test string up to string 14 is cleared. How come?
As always thanks for the help and thanks for having answered so quickly! _________________ It's time to make games! |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Apr 16, 2009 9:34 pm Post subject: So? Any advise? |
|
|
So? Could somoene help me to find where the free slice sommand could go?
Thanks a lot! _________________ It's time to make games! |
|
| Back to top |
|
 |
msw188
Joined: 02 Jul 2003 Posts: 1041
|
Posted: Fri Apr 17, 2009 8:52 am Post subject: |
|
|
You're gonna have to get TMC or James in here most likely. The slices are still very new plotscripting devices and I don't understand what they are or what they do at all. I think a lot of users feel similarly at the moment; are slices even in a stable version yet? _________________ My first completed OHR game, Tales of the New World:
http://castleparadox.com/gamelist-display.php?game=161
This website link is for my funk/rock band, Euphonic Brew:
www.euphonicbrew.com |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Thu Apr 23, 2009 7:32 am Post subject: |
|
|
Oh, sorry, I forgot about this.
This is in the wrong place:
| Code: | variable (box)
box := create rect(140, 50, 0)
center slice (box)
set rect trans(box, true) |
You put it inside the for loop which sets each string to a line from the textbox, so it will create multiple rects/boxes instead of just one.
free slice deletes the box you created. Without it, it would continue to appear on the screen until you quit! So put freeslice at the end of your script, where you clear the strings.
Also, now that you know how to display boxes, do you still want to draw strings in the flat style, with a background colour? _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Tue Apr 28, 2009 2:16 am Post subject: Sorry but... I can't see where it goes |
|
|
I've tried to place free slice several times in the script but it didn't worked
Should I place it just near the command
| Code: |
free slice box
resume player #allows game to came back to normal
|
or a bit above?
| Code: |
return(menuchoice) #returns the value of MenuChoice
#clears the strings we just used
for(temp,0,numberoflines)do(
hidestring(temp)
clearstring(temp)
free slice (box)
end
|
Thanks for your help! _________________ It's time to make games! |
|
| Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Wed Apr 29, 2009 6:55 am Post subject: |
|
|
You should have only one rect and only call freeslice once. So the first code you pasted should work. What happens? _________________ "It is so great it is insanely great." |
|
| Back to top |
|
 |
bis_senchi

Joined: 08 Jun 2004 Posts: 460 Location: Reims, France
|
Posted: Thu Apr 30, 2009 1:08 am Post subject: It just doesn't work... |
|
|
Well I tested with the free slice line placed just after resume player and it appears that it has no effect when the script ends.
But I think this may be due to the fact my onkeypress may interfer and launch the menu and don't know what do after?
| Code: |
script, mykeypressedscript map6v2, begin
#if (key is pressed(key:esc), xor, key is pressed(key:alt),xor, key is pressed(key:space)) then, begin # menu is unactivated
# pb il faut rajouter la barre espace mais on dialogue aussi avec
if (key is pressed(key:esc), xor, key is pressed(key:alt)) then, begin # menu is unactivated
suspend player
wait (1)
menu #launch script with new menu in it
end #end for the if keypress
if (key is pressed(key: numlock)) then, begin
if (pauseisactive==false) then, begin
pause script
end, else, begin
#thus, pauseisactive must be true
unpaused script
end #end of the first if
end #end of the second if
#numlock is pressed for pause
if (key is pressed(key: d)) then, begin
if (check tag (tag:dsecond)==on) then, begin #if another key have been pressed
advance text box
wait(1)
resume box advance
resume npcs
set tag (tag:dsecond, off)
end, else, begin
duelmodemap6
end #end for the tag
end #end for if keypress
end #end of the plotscript
|
What could be the other reasons that could explain why the code doesn't work?
Thanks very much in advance for the help! _________________ It's time to make games! |
|
| 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
|