Personally, I hate working with slices. It's too complicated for my likings. To many brackets and variables causes my brain to malfunction.
However...so many good things can be done with them, so I need help. I knew this would be inevitable.
I'm running an evolution test game demo for my Pokemon Beige. It shall be a rough draft of Evolution. Anyways, I want to display Pokemon slices in the center of the screen...they'll be available as various enemy sprites. Since my alternative is making backdrops for every evolution...
How would I show a slice in the center of the screen, have it change palette to a full black palette, then have it switch back and forth from one slice to another, and then have it become a colored slice of the new Pokemon?
If you want clarity on how that should look, play Puckamon and evolve a Puckamon, or even play ANY Pokemon game.
something like this:
I haven't tested this, but I am pretty sure it will work. Let me know if it does.
Code:
script, pokemon evolve example, begin
large pokemon evolve(5, 6)
end
script, large pokemon evolve, sprite 1, sprite 2, begin
# This script assumes that palette 0 is all black
variable(sl)
sl := load large enemy sprite(sprite 1)
center slice(sl)
wait(20)
set sprite palette(sl, 0)
wait(6)
variable(i)
for(i, 0, 10) do(
replace large enemy sprite(sl, sprite 1, 0)
wait(2)
replace large enemy sprite(sl, sprite 2, 0)
wait(2)
)
wait(6)
set sprite palette(sprite 2)
wait(20)
free slice(sl)
end
script, pokemon evolve example, begin
large pokemon evolve(5, 6)
end
script, large pokemon evolve, sprite 1, sprite 2, begin
# This script assumes that palette 0 is all black
variable(sl)
sl := load large enemy sprite(sprite 1)
center slice(sl)
wait(20)
set sprite palette(sl, 0)
wait(6)
variable(i)
for(i, 0, 10) do(
replace large enemy sprite(sl, sprite 1, 0)
wait(2)
replace large enemy sprite(sl, sprite 2, 0)
wait(2)
)
wait(6)
set sprite palette(sprite 2)
wait(20)
free slice(sl)
end
I haven't tested this, but I am pretty sure it will work. Let me know if it does.
I've been trying to figure out how to use slices as a method of displaying pages for a bestiary myself...my only real issue is how to close the slice after opening it....
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
Meowskivich wrote:
I've been trying to figure out how to use slices as a method of displaying pages for a bestiary myself...my only real issue is how to close the slice after opening it....
The free slice command will remove any slice you have previously created (or loaded with "load slice collection")
Also, if you are storing your slice handle in a global variable, it is a good habit to zero it after you free the slice:
Code:
sl := load slice collection(0)
# do things with it
free slice(sl)
sl := 0
sl := load slice collection(0)
# do things with it
free slice(sl)
sl := 0
ohhhhh, I get it now. I was a little confused when I glanced at this yesterday, but I think I understand how this works now.
Thanks!
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
Thanks!
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
bonus question!
the hamsterspeak compiler thing object doesn't recognize "sl" as anything, annnnnd being I'm not exactly on first-name basis with hamsterspeak, I really don't know how to set that up....might I ask how?
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
the hamsterspeak compiler thing object doesn't recognize "sl" as anything, annnnnd being I'm not exactly on first-name basis with hamsterspeak, I really don't know how to set that up....might I ask how?
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
if you just need the variable to exist in the current script, then you do:
but if you need it to be shared between all scripts, you do:
where 0 is a unique id that can't be the same for any two variables. Also, if it is a global, you might want a more descriptive name. I usually use sl as a name for a local variable, but I give global slice variables more descriptive names like:
Code:
variable(sl)
but if you need it to be shared between all scripts, you do:
Code:
global variable(0, sl)
where 0 is a unique id that can't be the same for any two variables. Also, if it is a global, you might want a more descriptive name. I usually use sl as a name for a local variable, but I give global slice variables more descriptive names like:
Code:
global variable(0, map hp meter sl)
Poly carp, it works! Thanks a bunch! Now I've got a little more realistic goal for me to work with before I release my game.
Thanks again!
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x
Thanks again!
dOn'T MiNd mE! i'M jUsT CoNtAgIoUs!!!
Play Orbs CCG: http://orbsccg.com/r/4r6x



