How do I update dialogue through slice collection?
Moderators: marionline, SDHawk
I'm inclined to agree with Bob here. I thought it sounded inefficient, but it actually wouldn't be much harder than creating and editing new actual textboxes.
@bis_senchi, I recommend you disregard everything I've said up until now and make the text boxes manually, rather than with scripting.
Since you can copy and paste slices, this shouldn't be too difficult or even that tedious.
First, make the first Container slice a child of the first Rectangle slice.
Next, select the Rectangle slice with the cursor and press CTRL+C.
Then, move to the next empty slice collection and press CTRL+V.
Now you have the template for your textboxes saved in Slice Collection 5. Every time you make a new text box, copy the Rectangle slice from Slice Collection 5 and paste it into the next empty slice collection.
For each new textbox, simply edit each sprite in the Grid to be the appropriate character and palette. In order to load one of these textboxes, all you will need to do is call 'load slice collection(id)' in a script, where 'id' is the specific collection that has the textbox you want.
This will be just as effective as storing the text somewhere else and less complicated, too.
@bis_senchi, I recommend you disregard everything I've said up until now and make the text boxes manually, rather than with scripting.
Since you can copy and paste slices, this shouldn't be too difficult or even that tedious.
First, make the first Container slice a child of the first Rectangle slice.
Next, select the Rectangle slice with the cursor and press CTRL+C.
Then, move to the next empty slice collection and press CTRL+V.
Now you have the template for your textboxes saved in Slice Collection 5. Every time you make a new text box, copy the Rectangle slice from Slice Collection 5 and paste it into the next empty slice collection.
For each new textbox, simply edit each sprite in the Grid to be the appropriate character and palette. In order to load one of these textboxes, all you will need to do is call 'load slice collection(id)' in a script, where 'id' is the specific collection that has the textbox you want.
This will be just as effective as storing the text somewhere else and less complicated, too.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
How does child count work
Thanks for you answer. I'll get back to my first idea and use slice codes. There are a lot of slice lookp up code avaliable and I only need 42 of them.
Slice code allow me to do exactly what I would like to before starting to search for another way
to save up some of them.
Just like tags or strings, you need to know when (you really need) to use them while implementing a gameplay. They have been made for that!
I still have trouble to undertand how child count works. Let's say that there a slice collection menu. One of the sub menu is composed of various text, a cusor sprite, a rectangle and text line (for menu names) like the one I've made in my post last september.
Let's say it's a battle menu that the player uses to make the hero attack.
So in the slice tree you would something like
battle ground pic/ background 320.200 image
hero 1 pic
-> selected/ unselected sprite
[...]
<--- hero 1 attack menu-->
Rectangle
container
sub menu cursor
Attack
Defend
Items
run
How to I use child count and other plotscript commands to access all the elements of my slice collection? Again, slice look up code would be useful in this case.
You also need to take into account that the menu appears when the key is pressed and disappears when the battle turn is validated... How you kylekrack would tackle this "problem"?
A always thanks in advance for your help kylekrack and also thank to Bob The Hamster for noticing that those coding attempts were heading the wrong direction.
Slice code allow me to do exactly what I would like to before starting to search for another way
to save up some of them.
Just like tags or strings, you need to know when (you really need) to use them while implementing a gameplay. They have been made for that!
I still have trouble to undertand how child count works. Let's say that there a slice collection menu. One of the sub menu is composed of various text, a cusor sprite, a rectangle and text line (for menu names) like the one I've made in my post last september.
Let's say it's a battle menu that the player uses to make the hero attack.
So in the slice tree you would something like
battle ground pic/ background 320.200 image
hero 1 pic
-> selected/ unselected sprite
[...]
<--- hero 1 attack menu-->
Rectangle
container
sub menu cursor
Attack
Defend
Items
run
How to I use child count and other plotscript commands to access all the elements of my slice collection? Again, slice look up code would be useful in this case.
You also need to take into account that the menu appears when the key is pressed and disappears when the battle turn is validated... How you kylekrack would tackle this "problem"?
A always thanks in advance for your help kylekrack and also thank to Bob The Hamster for noticing that those coding attempts were heading the wrong direction.
Last edited by bis_senchi on Sat Jan 30, 2021 8:44 am, edited 1 time in total.
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
you could code a japanese text generator in the engine, that can export the japanese text (as a slice collection) for using in menus and textboxes.
you can have a kanji selector, for example, and some gui tools like mode toggle for hira/kata and so on.
it may be easier if you are not confident in scripting everything directly
to access the element of your slice collection:
- assign a lookup to a slice so you can get its handle
- store the handle of a slice in a (global) variable
https://hamsterrepublic.com/ohrrpgce/ni ... g%20Slices
(most of these commands return the handle of a slice which you can store in a variable)
- after getting the parent, you can access the children with various commands
https://hamsterrepublic.com/ohrrpgce/ni ... ice%20Tree
you can have a kanji selector, for example, and some gui tools like mode toggle for hira/kata and so on.
it may be easier if you are not confident in scripting everything directly
to access the element of your slice collection:
- assign a lookup to a slice so you can get its handle
- store the handle of a slice in a (global) variable
https://hamsterrepublic.com/ohrrpgce/ni ... g%20Slices
(most of these commands return the handle of a slice which you can store in a variable)
- after getting the parent, you can access the children with various commands
https://hamsterrepublic.com/ohrrpgce/ni ... ice%20Tree
Last edited by SwordPlay on Sat Jan 30, 2021 8:53 am, edited 1 time in total.
"Imagination. Life is your creation."
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
i have a prototype working, it reads a string in romaji, but its not finished yet
you can write in Capital letters/Upper Case for Katakana or Lower Case for Hiragana, but I need to add the katakana glyphs
a bit difficult to add dakuten/handakuten and case for ...y... cluster (rya, gya, nya... etc.,) but its basically added
then i will add a way to change palette perhaps, and then later a way to write kanji if i can figure it out
you can write in Capital letters/Upper Case for Katakana or Lower Case for Hiragana, but I need to add the katakana glyphs
a bit difficult to add dakuten/handakuten and case for ...y... cluster (rya, gya, nya... etc.,) but its basically added
then i will add a way to change palette perhaps, and then later a way to write kanji if i can figure it out
- Attachments
-
- supposed to say "aeiou kakekikoku naneninonu nnn baba gyu pu bu" but it doesnt handle "n" and "gyu" properly
- Japanese Font0003.png (1.99 KiB) Viewed 5186 times
-
- this is just a test. it works kinda
- Japanese Font0000.png (1.95 KiB) Viewed 5187 times
-
- it supposed to say domo arigatou gozaimasu, but its broken :P
- Japanese Font0001.png (1.67 KiB) Viewed 5187 times
Last edited by SwordPlay on Sat Jan 30, 2021 11:04 am, edited 1 time in total.
"Imagination. Life is your creation."
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
WARNING: Very broken messy and incomplete. Feel free to use whatever you like.
you need to import the box border sets into the right place, or offset it in the code
Sorry I didn't do a good job, I'm so very tired right now. I might come back to this later on.
you need to import the box border sets into the right place, or offset it in the code
Sorry I didn't do a good job, I'm so very tired right now. I might come back to this later on.
Code: Select all
global variable(1000, Scons)
global variable(1001, Cons)
global variable(1002, Vowel)
global variable(1003, Dak)
global variable(1004, Y)
global variable(1005, Modal)
# you can run this script to test it out.
plotscript, test j text, begin
#$1="nandeyo baka shitenjiryo soka mashunembupi aabarai oo noomi kaazekii"
$1="nani nandeyo nannonekinin"
process string(1)
end
# vowel list
define constant(0, eVwl) # special case for N
define constant(1, AV) # 0
define constant(2, IV) # 8
define constant(3, UV) # 20
define constant(4, EV) # 4
define constant(5, OV) # 14
# consonant list. their ascii number and offset
define constant(0, VC) # just a vowel
define constant(1, KC) # 75 107... 10 AND G AND GY
define constant(2, SC) # 83... 18 AND Z AND J
define constant(3, TC) # 84... 19 AND D AND DJ
define constant(4, NC) # 78... 13
define constant(5, HC) # 72... 7 AND B AND P AND BY AND PY
define constant(6, MC) # 77... 12
define constant(7, RC) # 82... 17
define constant(8, YC) # 89... 24
define constant(9, WC) # 87... 22
define constant(10, N) # 78 again... 13
# ascii codes
# 65 to 90 is capitals... hiragana
# 97 to 122 is lower case... katakana
plotscript, process string, str, begin
# will contain the new japanese text sprites
variable(grid)
grid:=create grid(320,200)
set grid rows(grid,10)
set grid columns(grid,16)
# this is data read from the ascii string (input)
variable(cas,offset)
# upper and lower case from 65 and 97 respectively
# offset to the letter from
variable(pos,i,ascii) # position in string while reading it
for(pos,1,string length(str),1)do(
ascii:=ascii from string(str,pos)
# exit script when no more ascii to read
IF(ascii==0)THEN(exit returning(grid))
# a space. end the cluster start a new one
ELSEIF(ascii==32)THEN(
set parent(create container,grid)
cons:=0,vowel:=0,dak:=0,y:=0
) # insert a space
IF(97>=ascii && ascii>=65)THEN(cas:=65)
IF(122>=ascii && ascii >=97)THEN(cas:=97)
show value(cas)
# create a branch if stored consonant is special...
VARIABLE(sscons)
sscons:=scons
scons:=cons
cons:=0
vowel:=0
switch(ascii--cas)do(
case(0)
do(vowel:=AV)
case(8)
do(vowel:=IV)
case(20)
do(vowel:=UV)
case(4)
do(vowel:=EV)
case(14)
do(vowel:=OV)
case(10) # K
do(cons:=KC)
case(6) # G
do(cons:=KC,dak:=1)
case(18) # S
do(cons:=SC)
case(9) # J
do(cons:=SC,dak:=1,y:=1)
case(25) # Z
do(cons:=SC,dak:=1)
case(19) # T
do(cons:=TC)
case(3) # D
do(cons:=TC,dak:=1)
case(13) # N
do(cons:=NC)
case(7) # H
do(cons:=HC)
case(1) # B
do(cons:=HC,dak:=1)
case(15) # P
do(cons:=HC,dak:=2)
case(12) # M
do(cons:=MC)
case(17) # R
do(cons:=RC)
case(24) # Y
do(cons:=YC)
case(22) # W
do(cons:=WC)
)
variable(spr)
IF(vowel)THEN( # the end of the cluster
IF(scons==yc)THEN(
spr:=find char(sscons,vowel,dak,1,modal)
) # a ...y... case
ELSE(spr:=find char(scons,vowel,dak,0,modal))
)
ELSE(
IF(scons==NC)THEN(spr:=find char(cons,-1,0,0,modal)) # N Case
)
IF(spr)THEN(
set parent(spr,grid),
spr:=0,
cons:=0,vowel:=0,dak:=0,y:=0)
# vowel with no consonant before it. push!
# 2 consonants in a row! this is for nY- cases. push!
# consonant and vowel! push!
# consonant and no vowel! push Except "N"
# dont check N first. it doesnt appear at the front of words
# maximum case. dak. + Y
# special N case
# special Y case
# cons on their own
# at the end. dak
) # for each character in the string
subscript, wChar, where, begin # which car
return(ascii from string(str,pos+where))
end
subscript, clcl, begin # clear cluster
cons:=-1
vowel:=-1
dak:=-1
end
end
plotscript, find char, cnsnt, vwl, dakt, ym, mde, begin
variable(sprset, frame, count)
sprset:=1
count:=cnsnt
while(count>0)do(count-=1, frame+=5)
while(frame>15)do(frame-=15,sprset+=1)
frame+=(vwl--1)
IF(vwl==-1 && cnsnt==NC)THEN(sprset:=4,frame:=10)
variable(spr)
spr:=load border sprite(sprset)
set sprite frame(spr,frame)
IF(dakt)THEN(
variable(d)
d:=load border sprite(4)
set sprite frame(d,10+dakt)
set parent(d,spr)
center slice(d)
)
IF(Ym)THEN(
variable(yp)
yp:=load border sprite(4)
set sprite frame(yp,frame)
set parent(yp,spr)
center slice(yp)
set slice x(yp,15)
set sprite frame(spr,IV)
)
set slice extra(spr,0,cnsnt)
set slice extra(spr,1,vwl)
set slice extra(spr,2,frame)
return(spr)
end
- Attachments
-
- Japanese Font boxborder set 1.bmp (2.12 KiB) Viewed 5181 times
-
- Japanese Font boxborder set 2.bmp (2.12 KiB) Viewed 5181 times
-
- Japanese Font boxborder set 3.bmp (2.12 KiB) Viewed 5181 times
-
- Japanese Font boxborder set 4.bmp (2.12 KiB) Viewed 5181 times
Last edited by SwordPlay on Sat Jan 30, 2021 11:48 am, edited 3 times in total.
"Imagination. Life is your creation."
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
Accents through strings
Thanks sword play for your offer but the solution I have I mind will work better for me.
Always linked to languages, I have another question. It's linked to string and
accents
end #end for the tag
Let's stay, I want to put in spanish. How are you? -> Hola ¿Que Tal?
If I write $"Hola ¿Que Tal?" there will problems with the ¿
The only way I know would be to write Hola ¿Que Tal? in a text box and use the string from textbox.I drew the fonts for spanish and no problems whatsoever when keying the text under custom.exe
But if need be, I would like to be able to, just like with the english language (with only a string and slice rectangle) to make it appear this on screen.
My question is the following, is there a way using scancode or the code custom.exe use for the font table (e.g char 97 => a) to be able to entre accents through strings. The font ¿ is on the
table so it shouldn't be impossible with a coding system to make it pass though a string...
As always thank you very much for your pieces of advice.
Always linked to languages, I have another question. It's linked to string and
accents
end #end for the tag
Code: Select all
Global variable (12, box)
#-------------------------------------------------------------------------
plotscript, Npc script, begin
switch (dialogue update), do, begin
case (0), do begin
$3= "Hello! How are you?"
show string at (3, 10, 10)
#slice is rect (box)
box:= create rect (320, 35, 0) #witdh, height style style number from 0 to 14,
#set slice x (box, 10)
#set slice y (box, 10)
set rect trans (box, false)
end #end for the case
end #end for the switch
end #end of the plotscript
#-------------------------------------------------------
If I write $"Hola ¿Que Tal?" there will problems with the ¿
The only way I know would be to write Hola ¿Que Tal? in a text box and use the string from textbox.I drew the fonts for spanish and no problems whatsoever when keying the text under custom.exe
But if need be, I would like to be able to, just like with the english language (with only a string and slice rectangle) to make it appear this on screen.
My question is the following, is there a way using scancode or the code custom.exe use for the font table (e.g char 97 => a) to be able to entre accents through strings. The font ¿ is on the
table so it shouldn't be impossible with a coding system to make it pass though a string...
As always thank you very much for your pieces of advice.
Last edited by bis_senchi on Sun Feb 07, 2021 3:44 pm, edited 1 time in total.
Text in the OHR will only be able to use the characters in the game's font. Eg. Edit Graphics > Edit Font. That page will show you what all the characters available are and what index number they have, from 32 - 255. If the character is not represented there, you will not be able to write it in the game.
As for how the script interpreter translates strings into the game font, I'm not sure.
As for how the script interpreter translates strings into the game font, I'm not sure.
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
Ascii characters and symbols
Kylecrack
In this example above I called them show index code and clear index code but you get
the idea.
A command with make appear one screen a font according to its place on the font table.
After some search, the command append ascii seems to be quite close to this.
If I could store a ascii into a string and make appear that would be perfect....
So has someone seen something like this in the plotscripting dictionnary? If not what
about making a submission for this?
I think developping such a command would be useful in case like the one I'm talking about. Languages apart you may want to be able to use the symbols you put in your font table directly on screen, without having to use a line of the text and put everything into a string.
As always thanks for answering so quickly!
-> that's what I'm asking about. I would like to know if you can use the index code in plotscripting.. That page will show you what all the characters available are and what index number they have, from 32 - 255.
In this example above I called them show index code and clear index code but you get
the idea.
A command with make appear one screen a font according to its place on the font table.
After some search, the command append ascii seems to be quite close to this.
If I could store a ascii into a string and make appear that would be perfect....
Code: Select all
Global variable (12, box)
#-------------------------------------------------------------------------
plotscript, Npc script, begin
switch (dialogue update), do, begin
case (0), do begin
show index code (144) # display message Hola ¿Que Tal?" inde code 255 is ¿
show index code (145)
clear index code (144)
clear index code (145)
#slice is rect (box)
box:= create rect (320, 35, 0) #witdh, height style style number from 0 to 14,
#set slice x (box, 10)
#set slice y (box, 10)
set rect trans (box, false)
end #end for the case
end #end for the switch
end #end of the plotscript
#-------------------------------------------------------
about making a submission for this?
I think developping such a command would be useful in case like the one I'm talking about. Languages apart you may want to be able to use the symbols you put in your font table directly on screen, without having to use a line of the text and put everything into a string.
As always thanks for answering so quickly!
Last edited by bis_senchi on Mon Feb 08, 2021 6:57 am, edited 3 times in total.
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
i think thats a good idea. it would be cool to have a text code that loads symbols from the font table into strings... is that what you mean? so you can make a code like "[Q" for to load a specific ascii character like ¿
then when you want ¿ you write it like $="[Q Que pasa ?" and it will be read when you want to display it by another script that will replaces the [Q with ¿
actually you could just ask for the ascii codes like "[148" for number 148 in the font table
you could use another punctuation mark other then open bracket, or you could even add a closed bracket... like [n]. but this would result in an argument to make this optional
maybe it should be an unusual combination which users are unlikely to accidentally type... maybe like !{n or !.n or something like that
you could also assign your members of the font table as constants, so you can call them by name... !{UpsideDownQuestionMark or !{UQ or !{Que} or whatever
then when you want ¿ you write it like $="[Q Que pasa ?" and it will be read when you want to display it by another script that will replaces the [Q with ¿
actually you could just ask for the ascii codes like "[148" for number 148 in the font table
you could use another punctuation mark other then open bracket, or you could even add a closed bracket... like [n]. but this would result in an argument to make this optional
maybe it should be an unusual combination which users are unlikely to accidentally type... maybe like !{n or !.n or something like that
you could also assign your members of the font table as constants, so you can call them by name... !{UpsideDownQuestionMark or !{UQ or !{Que} or whatever
Last edited by SwordPlay on Tue Feb 09, 2021 3:10 am, edited 2 times in total.
"Imagination. Life is your creation."
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
After some search, I wanna use append ascii
Great news.
After some searches the command I was searching for already exists. It's called "append ASCII"
Combine with show string at, you can pick up and search for any font and make it appear on screen.
Now my question has changed. I would like to use only a few strings and store a bunch of appended ascii and make them appear all the same time.
Let's take back the previous example. With the English sentence : 'Hello! How are you?" I use only one string $3= "Hello! How are you?"
To do the same with spanish, it appears that I have to use ascii because if I write
$3= "Hola ¿Que Tal?" the buffer won't work correctly.
To get the same result my current knowledge, I need to do this: append ascii one by one and show them one by one
The problem is that for a simple phrase I used 11 strings for the spanish sentence instead
of only one for the english one.
I would like to create a system would use much less strings and get the same result
make appear a simple sentence with using a text box content.
I was thinking about using a global variable to store the value of the ascii with the command: ascii from string. (Each font is associated with a figure which is its place in the font table
so you may be able to store this value in a variable.)
This way, by using 11 variables instead of string, I can save up strings for other things.
you have 4095 global variables available but only 99 strings, so it's better this way...
But I don't see how to make ascii pile up in a string.
Could someone tell how to add several ascii characters in a single string, just like the
buffer does?
Thanks in advance for your help!
After some searches the command I was searching for already exists. It's called "append ASCII"
Combine with show string at, you can pick up and search for any font and make it appear on screen.
Code: Select all
switch (dialogue advance) do, begin
case (0) do, begin
suspend player
suspend npcs
append ascii (10, 176) #ascii 176 177 et 178 are spanish writing specifics é,¿,Ñ
show string at (10, 10, 10)
append ascii (12, 177)
show string at (12, 20, 10)
append ascii (13, 178)
show string at (13, 30, 10)
box:= create rect (320, 35, 0) #1rst number witdh, 2nd number height, 3rd number style (can take value ony from 0 to 14)
set rect trans (box, true)
wait (3)
wait for key (key: space)
if (key is pressed (key: space)) then, begin
clear string (10)
clear string (12)
clear string (13)
free slice (box)
end #end for the if
Let's take back the previous example. With the English sentence : 'Hello! How are you?" I use only one string $3= "Hello! How are you?"
To do the same with spanish, it appears that I have to use ascii because if I write
$3= "Hola ¿Que Tal?" the buffer won't work correctly.
To get the same result my current knowledge, I need to do this: append ascii one by one and show them one by one
Code: Select all
append ascii (10, 72) #letter H
append ascii (11, 111) #letter o
append ascii (12, 108) #letter l
append ascii (13, 97) #letter a
append ascii (14, 176) # sp font ¿
append ascii (15, 81) #letter Q
append ascii (16, 177) #letter u
append ascii (17, 101) #letter e
append ascii (18, 116) #letter t
append ascii (19, 97) #letter a
append ascii (20, 108) #letter l
append ascii (21, 63) #question mark
show string at (10, 10, 10) #show the above sentence on screen
show string at (11, 20, 10)
show string at (12, 30, 10)
show string at (13, 40, 10)
show string at (14, 50, 10)
show string at (15, 60, 10)
show string at (16, 70, 10)
show string at (17, 80, 10)
show string at (18, 90, 10)
show string at (19, 10, 20)
show string at (20, 20, 20)
show string at (21, 30, 20)
of only one for the english one.
I would like to create a system would use much less strings and get the same result
make appear a simple sentence with using a text box content.
I was thinking about using a global variable to store the value of the ascii with the command: ascii from string. (Each font is associated with a figure which is its place in the font table
so you may be able to store this value in a variable.)
This way, by using 11 variables instead of string, I can save up strings for other things.
you have 4095 global variables available but only 99 strings, so it's better this way...
But I don't see how to make ascii pile up in a string.
Code: Select all
variable (spanish letter1, spanish letter2, spanish letter3)
spanish letter:= ascii from string (10, 72) #string 10 is for appending ascii characters
spanish letter2:= ascii from string (10, 111)
spanish letter3:= ascii from string (10, 118)
buffer does?
Thanks in advance for your help!
Last edited by bis_senchi on Tue Feb 09, 2021 7:01 am, edited 1 time in total.
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
I think you just do it like this:
this makes it all appear in one string, i hope
append ascii adds the ascii to the end of a string.
so write whatever string you want as a string, then use append ascii on that string
then if you want to write more, use $+ to add more to the string
Code: Select all
$3= "Hola "
append ascii (3, 176)
$3+"Que Tal?"
append ascii adds the ascii to the end of a string.
so write whatever string you want as a string, then use append ascii on that string
then if you want to write more, use $+ to add more to the string
Last edited by SwordPlay on Tue Feb 09, 2021 1:36 pm, edited 1 time in total.
"Imagination. Life is your creation."
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
It works! Thanks a lot!
You idea worked... Thank you very much!
So you need to simple text and the command append ascii.... After all these questions
I can know make dialogues in whatever languages without even having to be afraid of the text box limitation!
My next question will be this time more linked with figures but still has to with appending and recording value
As my knowledge regarding slice collection has improved, I would like to embetter my card machine script.
For thoses who don't don't the card machine in a yugioh game in a machine that game let you try for $1000 to enter a password. (The password is in a fact a number written in each card in real life)
A lot of password are recorded in the machine one for each card. There are now aroung 500 of them but I would like to focus on these three below first
For example
"Blue Eyes White Dragon" card number/ password 89631139
"Mystical Elf" card number/ password 15025844
"Hitostu-Me Giant" card number/password 76184692
Last year I try to made on using the command imput string and string compare but
it didn't have to the same quality of game design. So I would like another one which look like more the one I used while playing YuGiOh! Game
So the trickier part here is that you have to linked the fact the player press a figure (let's say 4)
the sprite palette changes (to notify on screen the action of the player) and appear in the correct place on the upper part (= the one in the red rectangle)
Other problem is that this number is part a series of 8 figures that have to be stored in a global variable and then check....
Any advise on where to start and what commands to use is more than welcomed!
So you need to simple text and the command append ascii.... After all these questions
I can know make dialogues in whatever languages without even having to be afraid of the text box limitation!
My next question will be this time more linked with figures but still has to with appending and recording value
As my knowledge regarding slice collection has improved, I would like to embetter my card machine script.
For thoses who don't don't the card machine in a yugioh game in a machine that game let you try for $1000 to enter a password. (The password is in a fact a number written in each card in real life)
A lot of password are recorded in the machine one for each card. There are now aroung 500 of them but I would like to focus on these three below first
For example
"Blue Eyes White Dragon" card number/ password 89631139
"Mystical Elf" card number/ password 15025844
"Hitostu-Me Giant" card number/password 76184692
Last year I try to made on using the command imput string and string compare but
it didn't have to the same quality of game design. So I would like another one which look like more the one I used while playing YuGiOh! Game
Code: Select all
global variable (collection)
plotscript, card machine version2, begin
if (pay money(1000)) then, begin
collection := load slice collection (8)
end, else, begin
show text box (55) # Not enough money
wait for text box
end #end of the if
end #end of the script
the sprite palette changes (to notify on screen the action of the player) and appear in the correct place on the upper part (= the one in the red rectangle)
Other problem is that this number is part a series of 8 figures that have to be stored in a global variable and then check....
Any advise on where to start and what commands to use is more than welcomed!
Last edited by bis_senchi on Wed Feb 10, 2021 7:34 am, edited 1 time in total.
You need to make a keypress handler plotscript in order to track inputs like that. Make the plotscript called keypress handler, then set it to the map's keypress handler script in the general map settings. The script should look something like this.
The script "pressnumber" is whatever action you want pressing the key to take. Maybe it'd look something like
You can use the "append number" command to add numbers on the end of a string. Later, you can use "number from string" to compare what the player input against correct values.
Code: Select all
plotscript, keypress handler, begin
if(keypress(key:1)) then(pressNumber(1))
if(keypress(key:2)) then(pressNumber(2))
if(keypress(key:3)) then(pressNumber(3))
if(keypress(key:4)) then(pressNumber(4))
if(keypress(key:5)) then(pressNumber(5))
if(keypress(key:6)) then(pressNumber(6))
if(keypress(key:7)) then(pressNumber(7))
if(keypress(key:8)) then(pressNumber(8))
if(keypress(key:9)) then(pressNumber(9))
if(keypress(key:0)) then(pressNumber(0))
end
Code: Select all
script, pressNumber, number, begin
if(string length(stringid) >= 8) then(exit script)
append number(stringid, number) # stringid is the id of the string you're using to store the number
set slice text(texthandle, stringid) # update the slice that displays the number
end
My pronouns are they/them
Ps. I love my wife
Ps. I love my wife
- SwordPlay
- Chemical Slime
- Posts: 966
- Joined: Sun Jan 22, 2017 9:32 am
- Location: London, England
- Contact:
you can see an example i have posted here.
feel free to look at the scripts. it is very messy though
I attempted to make this without global variables or lookups
https://www.slimesalad.com/forum/viewtopic.php?p=139275
feel free to look at the scripts. it is very messy though
I attempted to make this without global variables or lookups
https://www.slimesalad.com/forum/viewtopic.php?p=139275
- Attachments
-
- numpad0001.gif (10.83 KiB) Viewed 5049 times
Last edited by SwordPlay on Wed Feb 10, 2021 8:33 pm, edited 5 times in total.
"Imagination. Life is your creation."
-
- Red Slime
- Posts: 64
- Joined: Sat Apr 20, 2019 8:59 am
As always thanks for the pieces of advice
Thanks for your script SwordPlay! I took a look and indeed the script look messy. But it seems to work, so I'll take it as back up. I'm more at ease with global variables and look up!
To KylerKrack, I have a little problem. When I include
Hspeak says:
On the plotscript dictionnary it is mentionned under the category
Math, Comparison, and Logic Operators
Is it a simple figure like 12, 58?
As always thanks everybody for their replies!
To KylerKrack, I have a little problem. When I include
Code: Select all
script, pressNumber, number, begin
if(string length(stringid) >= 8) then(exit script)
append number(stringid, number) # stringid is the id of the string you're using to store the number
set slice text(texthandle, stringid) # update the slice that displays the number
end
Could you please what number is supposed to be? A constant? A variable?expocted number but found number
On the plotscript dictionnary it is mentionned under the category
Math, Comparison, and Logic Operators
Is it a simple figure like 12, 58?
As always thanks everybody for their replies!
Last edited by bis_senchi on Thu Feb 11, 2021 6:32 am, edited 1 time in total.