News:

Welcome to the new Sinister Design forums!

Main Menu

Developer's Log

Started by CraigStern, February 11, 2013, 07:19:44 PM

Previous topic - Next topic

CraigStern

At long last, I have returned from Seattle! (I was there this weekend showing off the game at Power of Play.) I managed to take care of a few things while I was there:

--you can now increase the size of the font in those little pop-up info boxes that show up when you mouse over characters, objects and interface buttons. Hopefully this should help improve things for folks with crazy-huge monitors!
--info boxes now dynamically resize vertically (they already did that horizontally) to accommodate the larger supported font sizes.
--increased the font size in the detailed character screen from 11 to 12.
--the game now supports a new type of custom variable: arrays! There are three new script actions relating to the creation, pruning, and just general usage of arrays: SetArr, GetArr, and DelArr.

SetArr adds a new entry to an array, or changes the contents of an existing array entry. It has three parameters: array name (a string with the name of the array you want to add a string or a numerical value to), add at position (front, end, or a specific position integer), and the string or value to add. Note that if the named array doesn't already exist, SetArr will create it before adding the new entry.

GetArr retrieves a string or a value from an existing array entry. It has three parameters: array name (a string with the name of the array to get a string or a numerical value from), get from position (front, end, or a specific position integer), and get as ("STR" or "VAL"). If you set the get as parameter, to STR, it'll return the array entry as the custom string _ArrStr; by contrast, if it's VAL, it'll return the array entry as a custom numerical value called _ArrVal.

DelArr deletes an array entry, causing all of the entries after it to collapse forward one position. Two parameters: array name (a string with the name of the array to delete an entry from), and delete from position (front, end, or a specific position integer).

CraigStern

#856
More work on inventory swapping:

--I've come to suspect that the cause of the game's remaining inventory and equipment bugs originates from the function that saves updated character inventories upon closing the common inventory menu. Up till now, it's saved character inventories based upon character position within the saved character info array as it existed on first loading up the battle. I've now rewritten it so it specifically assigns changes to the correct character by name rather than array position.

--rewrote the process for gathering item and equipment info from the reserve supplies screen so as to avoid any possible issues with array entanglement or with items / equipment information getting assigned to the wrong character.

--updated character inventory arrangements are now only saved when the common inventory is managed during deployment, not during the battle.

CraigStern

I was forced to spend time on boring business stuff today: renewing my trademark with the USPTO and signing up to participate in the Steam summer sale. This means I didn't get to as much as I wanted. Still, I expect I'll push another update soon to see if the changes above resolved the inventory swapping bug.

--added a sound effect for Hover.

CraigStern

#858
Lots of new stuff with custom arrays! If you know how to program with arrays, then you should find these features extremely valuable:

--added a new "get as" setting for the GetArr script action: auto. This will make the game attempt to figure out on its own whether the array entry it's grabbing is a string or a numerical value. (If the entry contains letters, hyphens, asterisks, underscores, or spaces, then the game will assume that it is a string. If it doesn't find any of those, the game will then check for numerical characters. If it finds numerals, it'll assume that the entry is a value; if it doesn't, it'll assume that the entry is a string.) In addition, the Get As parameter is now optional; if you don't supply a setting, it'll choose auto by default.

--added a new special character, -ARR:Array Name,Get From,Get As-. If the game finds this special character, it'll replace it with the entry it finds at the "Get From" spot in the named array. (Get As is optional; if you leave it out, it will automatically detect whether the entry is a string or a numerical value.)

--added a new "delete from" setting for the DelArr script action: all. This completely clears the named array of all entries.

--new script action: ShuffleArr. Randomizes the order of a custom array's entries.

--new script action: ForArr. Runs a for loop with regard to a range of entries within a single named array--in each step of the loop, it will automatically run GetArr for the current position in the array, then run a named script. Parameters are (1) array name; (2) start position (front, end, or a specific position integer); (3) end position (front, end, or a specific position integer); (4) increment by (an integer value to increment the current position by at each step of the loop); and (5) script name (the name of the script to run at the end of each step in the loop).




So, in the likely event that you're wondering just how the heck you actually use all of this, here's an example! Suppose that we've used SetArr to populate an array named Sale Items with a selection of the name of every item that could possibly be for sale in a given town. Suppose that the Sale Items array has the following entries:

  Iron Sword
  Steel Sword
  Iron Axe
  Steel Axe
  Iron Bow
  Steel Bow
  Bandages
  Focus Pills
  Whet Stone
  Wine

That's an array with 10 entries spanning positions 0 through 9. (Array positions count up from 0, not from 1.) Now suppose that we have a second array for the particular items that are actually currently on sale in town, called On Sale. We can now draw a random selection of items from Sale Items, put them into On Sale, then use On Sale to populate our merchant dialogue.

To do this, we clear the contents of On Sale, randomize the order of the items in Sale Items using ShuffleArr, and then use ForArr to select the top 5 entries (that is, entries at positions 0 to 4) of our newly shuffled Sale Items array:

DelArr   On Sale,all
ShuffleArr   Sale Items
ForArr   Sale Items,0,4,1,Get Sale Item


The Get Sale Item script, in turn, is what we use to actually set the entries in On Sale. At each step of the loop, it'll add the the name of the current item to the end of On Sale:

<Script>Get Sale Item
   <Action>SetArr/On Sale,end,-STR:_ArrStr-</Action>
</Script>


With that process completed, we can then use -ARR:On Sale,0- , -ARR:On Sale,1- , -ARR:On Sale,2- , and so on to supply item names in our merchant dialogue, and use -ITEMVAL:- to supply the cost of each.

CraigStern

--you can now right-click the portraits of characters who've been recruited but haven't appeared on the battlefield yet (like Meridian right after you rescue her) during deployment / in the common inventory.

CraigStern

Currently testing out the new array functions to ensure that everything is hunky-dory. In the meantime...

--added a new legendary weapon to the game: the bow Lyrio. Strength 11, Accuracy +100, gives Range +1 to all ranged attacks.

CraigStern

--changed ITEMVAL format from -ITEMVAL:X- to ITEMVAL[X] to make it easier to nest the -STR:- and -ARR:- special characters inside it.

--fixed a bug where ForArr would malfunction whenever one used a negative integer for the increment by parameter.

--created a store with randomized items in it in the Recruitable Chars test campaign using the scripting techniques I discussed yesterday. :)

CraigStern

#862
--fixed some more edge cases where it could end up glitching out the game if an enemy was killed by wandering into a trap.

--fixed a bug in which Louise could show up in the ending even if she died or left the group earlier on.

--fixed the scripting in the chat immediately preceding the caravan battle so characters who may have died at Adelbrae don't talk.

CraigStern


CraigStern

#864
--new script action: GetCharsDist. Finds the distance in spaces between two named characters, sets the custom value _Dist to that number. Two parameters: the name of the first character, and the name of the second character.

--new script action: GetCharSpaceDist. Finds the distance in spaces between a named character and a given space on the battlefield, then sets the custom value _Dist to that number. Three parameters: the name of the character, the space's y coordinate, and the space's x coordinate.

--added a script to the training battle with Emma and Silithis so that if the _Dist between them is 1, it skips the instruction "To attack, move Emma right next to Silithis."

--added documentation of all the new array script actions to the manual.

--updated script actions list in map editor with helper info on all the newer actions.

CraigStern

--found and fixed a game-breaking save game bug in version 1.031 that was causing the game to not save any info on your characters between battles.

Super sorry about that, guys--I'll have 1.032 up today. Until you can update from 1.031, I advise sticking to local multiplayer.

CraigStern


CraigStern

--fixed a bug in which doors which are set to Locked with an OnLoading-triggered script action would sometimes glitch out and become impassable.

CraigStern

--fixed a bug in which it was possible to move between spaces with large elevation differences using Swim.

CraigStern

Heads-up: my parents are visiting me, and I'm moving on Sunday. The pace of development will return to its normal frenzy starting next week, once real life stops being a bother. :)