Post new topic    
Metal Slime
Send private message
Might need some help with slice/sprite stuff 
 PostSun Apr 18, 2010 6:13 pm
Send private message Reply with quote
Okay, I honestly have no idea how to use slices, or even what they are really... but I seem to remember hearing that they're what you need to use to display different types of sprites (hero, enemy, etc.) on a map.

And I've come to the point in my RGC entry where I'm making some scripts that need to show enemy sprites on a map screen.

Basically, what I'm trying to do is duplicate the "evolving" scenes from the Pokémon games. One enemy sprite shows up in the center of a screen, and then fades to black (change into palette 2.) Then, for about 15 seconds, the first sprite will occasionally flicker off of the screen and be replaced by a second enemy sprite (also in the all-black palette for now.) As time goes on, the second sprite will start showing up more often than the first, until at the end of the 15 seconds or so, only the second is on the screen. Then the second sprite switches to the normal palette, some other stuff unrelated to the sprites happens, and the script ends.

This is probably really simple to do for someone who actually knows how to use sprites/slices, but... I don't, heh. I'd really appreciate if someone could help me out with this.
Liquid Metal Slime
Send private message
 
 PostSun Apr 18, 2010 6:27 pm
Send private message Reply with quote
Just a basic rundown of what you need to do. This is assuming you are using enemy sprites.

Code:

variable(x)

# Start with the first sprite that will be shown
x:= load medium enemy sprite (m, n) # m = ID #, n = palette
set slice screen x (x, k) # THIS IS NOT THE MAP GRID
set slice screen y (x, l) # YOU HAVE TO MULTIPLY THE USUAL VALUES BY 20

# Here, do whatever text or waits you need before moving to the next frame

replace medium enemy sprite (x, o) # 0 = the next frame
# I believe you can replace the palette with a similar command.  I haven't used it myself

# Next, you'll just do waits and replaces successively until the animation is the way you want it.

# Then, when you are done...

free sprite (x) # This removes the slice from the screen



Working with Hero Sprites can also be good. Then you can use frames as such:

Code:


variable(x)
x:= load hero sprite (m, n)
set sprite frame(x,0)
set slice screen x (x, k) # THIS IS NOT THE MAP GRID
set slice screen y (x, l) # YOU HAVE TO MULTIPLY THE USUAL VALUES BY 20

# wait

set sprite frame(x,1)

# etc

free sprite (x)

My website, the home of Motrya:
http://www.jshgaming.com
Metal Slime
Send private message
 
 PostSun Apr 18, 2010 8:43 pm
Send private message Reply with quote
Oh, no wonder I was having trouble figuring it out on my own... a lot of those script commands don't seem to be in plotscr.hsd, and that was the only thing I was going by for scripting stuff. (are all these new commands documented somewhere else, like on the wiki maybe? I haven't checked.)

This actually looks... surprisingly not-complicated. I guess I kinda had this idea of slices as some really scary complex plotscripting thing that people who aren't that great at plotscripting would have a really hard time doing anything with. It may take some fiddling to get everything working the way I want it to work, but I should be able to figure it out.

Thanks for the help!
Liquid Metal Slime
Send private message
 
 PostSun Apr 18, 2010 9:00 pm
Send private message Reply with quote
Yeah, they aren't that bad, it's just that the documentation is hard to read. I made a walking script pretty easily for Duck, and it my first time using slices from scratch.
My website, the home of Motrya:
http://www.jshgaming.com
Red Slime
Send private message
 
 PostSun Apr 18, 2010 10:38 pm
Send private message Reply with quote
Yay! Slices!

I've been reading the xml plotscripting dictionary for documentation.
http://hamsterrepublic.com/ohrrpgce/docs/plotdict.xml

It includes slice documentation.
 
 PostTue Apr 20, 2010 12:42 pm
Send private message Reply with quote
Quote:
This actually looks... surprisingly not-complicated.


Ugh. Guess I'm still a beginner scripter. Here, I thought he was writing in a foreign language or something...
Liquid Metal Slime
Send private message
 
 PostTue Apr 20, 2010 1:16 pm
Send private message Reply with quote
J_Taylor wrote:
Quote:
This actually looks... surprisingly not-complicated.


Ugh. Guess I'm still a beginner scripter. Here, I thought he was writing in a foreign language or something...


What do you not understand about the code? If we work at it in chunks, I guarantee you can learn how to do this stuff.
My website, the home of Motrya:
http://www.jshgaming.com
Super Slime
Send private message
 
 PostTue Apr 20, 2010 2:56 pm
Send private message Reply with quote
FnrrfYgmSchnish wrote:
Oh, no wonder I was having trouble figuring it out on my own... a lot of those script commands don't seem to be in plotscr.hsd, and that was the only thing I was going by for scripting stuff. (are all these new commands documented somewhere else, like on the wiki maybe? I haven't checked.)


If the commands aren't in plotscr.hsd, you can't use them. You need to download a new version of hspeak.
Mega Tact v1.1
Super Penguin Chef
Wizard Blocks
Metal Slime
Send private message
 
 PostTue Apr 20, 2010 4:47 pm
Send private message Reply with quote
Wait, not plotscr.hsd... not sure why I typed that. I meant the little "Plotscripting Help" thing that you can open up in HSSEd, which lists a lot of the plotscripting commands and how to use them. Some sprite/slice commands were listed there, but "set slice screen" wasn't.

I know I remember hearing that HSSEd is not being updated anymore, but I've been using it anyway (mainly because it has text editing, plotscript help, and compiling all in the same place... and I just never really checked if there's any more-recent program I could use instead.)
Liquid Metal King Slime
Send private message
 
 PostTue Apr 20, 2010 5:35 pm
Send private message Reply with quote
Yes, HssEd is officially retired. please try Hamster Whisper instead.

http://hamsterrepublic.com/ohrrpgce/index.php/Hamster_Whisper.html

By the way, I have source code highlighting working in the Linux version of Hamster Whisper, but I still haven't had time to update the Windows build to support it too.
 
 PostThu Apr 22, 2010 10:33 pm
Send private message Reply with quote
Quote:
What do you not understand about the code? If we work at it in chunks, I guarantee you can learn how to do this stuff.


Hm. On closer inspection, I think it's the comments confusing me. It makes... kinda sense.
Display posts from previous: