Jump to content

Brightsea Empire

Photo

X button


  • Please log in to reply
2 replies to this topic

#1 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 05 April 2015 - 12:39 PM

There's a lot of words I can't use on this forum that I said out loud when I hit complie, zq said success, and I ran the game and the X button actually works. Like, for real works. This quest has three equipable buttons.

This, with the subscreen, took about 20 hours over the course of the weekend. And I am damn proud of that.
  • ShadowTiger, Avaro and Demonlink like this

#2 ShadowTiger

ShadowTiger

    The Doctor Is In

  • Members

Posted 05 April 2015 - 01:11 PM

As a person struggling with scripting myself, with your personal achievement being about as lofty of a goal as they come, please believe me when I say that my hat is fully and completely off to you. Probably being shredded in some convoluted ceiling fan, I'll bet. Worth it. Worth every scrap of hat.

What would you say was the hardest part?

#3 jsm116

jsm116

    Script kludger

  • Members
  • Location:The 301

Posted 05 April 2015 - 01:32 PM

Thank you for your kind words. I hope the experience lives up to the expectation.

 

Honestly, with the subscreen, there wasn't any particular thing that was difficult, mostly just tedious. My advice (which is repeating that of many others) is to figure out exactly what you want to happen, and where it should appear on the screen, before you start doing anything. Making changes after the fact can be tricky (or at the very least adding to the tedium). It helped that I've spent a lot of time playing with the subscreen editor that's built in, seeing how the elements interact with each other, and the rest of the game. I would strongly recommend learning every element of that editor inside and out before trying to make your own. http://www.shardstor...ubscreen_Editor this page was essential for that, for me.

 

For the X button, since all the items tied to that button are scripted, this was actually not nearly as bad as I expected. Previously, all the items were using a combination of item script and ffc script, with the values for D0-D7 put in in the item editor, then whatever was necessary to pass along to the ffc done so with RunFFCScript(). When setting up this third button, I made a bunch of arrays of equal size, since most of these items all use the same types of data (MP cost, power, sprite number, etc.) The main function that gets called when the button is pressed checks to see if the spell is allowed (for instance, you won't be able to cast Life magic if your HP is already full) and if you have enough MP. If so, there are individual functions for each spell that take the place of the item script that would have been called in the active slot of that item. At this point, whatever effects were handled by the item script are handled, and if an ffc needs to be called, it's called at this point.

 

Again, my best advice is having everything planned out in advance. Even if you don't have all the specific code written for a specific effect, knowing that you need it, how it's going to interact with other things, is important before you start to change the framework of the game.

 

The changes I'm making aren't just adding new items--they're expanding the game engine. If it helps to think of it that way, consider what you're trying to change. Are you adding something within the existing framework (like a new enemy or a new item) or are you bending the framework itself (like ghost.zh)?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users